Get a Jumpstart with our Sample Apps
Results 1 to 5 of 5

Thread: SQL Query Runs Okay in Micrososoft SQL Management Studio But Not In List Component

  1. #1
    "Certified" Alphaholic iRadiate's Avatar
    Real Name
    Stephen
    Join Date
    Jan 2011
    Location
    London, ON
    Posts
    1,396

    Default SQL Query Runs Okay in Micrososoft SQL Management Studio But Not In List Component

    Can anyone help with why the following SQL Query runs just fine in Management Studio but when I try to use it as a query in a list component, it won't work?

    Here is the query running fine in MSMS:

    SQL Query MSMS.jpg


    As a query on a list component however, I get this:

    SQL List Preview.jpg AND this: SQL List Preview 2.jpg

    When I run it in Alpha Anywhere I get this error:

    Could not execute query.
    Error parsing SQL statement

    Your database has returned the following error code and description to Alpha Five.
    Consult your database documentation for further information.

    37 - 'line 3:21: unexpected token: ='



    I am running MS SQL Server 2008 R2 and Alpha Anywhere 3208_4563

  2. #2
    Member
    Real Name
    Jon Moody
    Join Date
    Sep 2010
    Location
    Brackley, UK
    Posts
    222

    Default Re: SQL Query Runs Okay in Micrososoft SQL Management Studio But Not In List Component

    As the error is pointing to line 3 column 21 of the select statement you might want to try using AS instead of the = where renaming the result columns. Just a guess - I'm no SQL expert.

  3. #3
    "Certified" Alphaholic iRadiate's Avatar
    Real Name
    Stephen
    Join Date
    Jan 2011
    Location
    London, ON
    Posts
    1,396

    Default Re: SQL Query Runs Okay in Micrososoft SQL Management Studio But Not In List Component

    Thanks Jon. That prevents the token: = error. But now it doesn't like the aggregate MAX function.
    It's been reported to Alpha, so will see what they say.

  4. #4
    Moderator
    Real Name
    Steve Workings
    Join Date
    Apr 2000
    Location
    The Dreaded Chair
    Posts
    5,507

    Default Re: SQL Query Runs Okay in Micrososoft SQL Management Studio But Not In List Component

    When you start doing things like this, I don't think you should be surprised if Alpha's portable SQL doesn't know what to do with it. There's no way they can cover everything.

    Instead, how about making a SQL view and just using that as your data source?
    -Steve


  5. #5
    "Certified" Alphaholic iRadiate's Avatar
    Real Name
    Stephen
    Join Date
    Jan 2011
    Location
    London, ON
    Posts
    1,396

    Default Re: SQL Query Runs Okay in Micrososoft SQL Management Studio But Not In List Component

    Portable SQL was turned off and I was using native SQL.
    Selwyn was very helpful, he was able to reproduce the problem and determined it was a combination of what I was doing in the query (using names that don't exist in the data ie) LastRepair, ServiceState)
    and a bug in Alpha not being able to display these as column names. He has provided me with a workaround to create a static data source first then going back to the native SQL as a datasource.
    This is a temporary workaround as you can't access list properties until the bug is fixed.

Similar Threads

  1. List Control - NEXT navigation runs off end of List.
    By CarlMPearson in forum Mobile & Browser Applications
    Replies: 0
    Last Post: 01-29-2015, 04:01 PM
  2. Replies: 1
    Last Post: 10-04-2013, 09:09 AM
  3. Is SQL management studio needed to connect to a DB with SQL Server 2008 backend
    By Cammy in forum Alpha Five Version 11 - Desktop Applications
    Replies: 12
    Last Post: 02-08-2012, 10:00 AM
  4. Query Runs Twice Why ?
    By Gary Phillips in forum Alpha Five Version 5
    Replies: 6
    Last Post: 08-07-2003, 07:51 AM
  5. Print current runs query
    By russ Boehle in forum Alpha Five Version 5
    Replies: 14
    Last Post: 04-04-2003, 01:18 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •