[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Dynamic Query Variables



I am trying to use Dynamic Query Variables in the following way:

Begin-Procedure main

let $from_table='company'

begin-select

co_nbr

from [$from_table]

end-select

End-Procedure main

I receive the following message:

(SQR 5528) Sybase DBSQLEXEC error in cursor 1:
   (156) Incorrect syntax near the keyword 'where'.

SQL: select co_nbr  from  where 1 = 2

Error on line 76:
   (SQR 3716) Error in SQL statement.

Errors were found in the program file.

SQR: Program Aborting.

Why doesen't this work?

The  column co_nbr is a column in the company table.
I tried alot of variations like including the table name in the column
expression company.co_nbr,  using alaises in the from clause. but it still does
not work.
I followed the book line by line and I still cannot understand what is wrong.

Any help would by appreicated.

John Palmieri