[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
Re: Dynamic Table name.. need syntax help
Bill,
You can do this:
begin-sql
[$my_sql]
end-sql
where $my_sql contains a valid NON-QUERY statement in SQL.
Typically this would be an INSERT, UPDATE, DELETE, CREATE,
DROP, GRANT, etc.
Ray.
> Will this code work within Begin-SQL/End-SQL paragraphs also? Or is it
> limited to Begin-SELECT/End-SELECT paragraphs? TIA!
>
> --
> William Beckner -- Stunt Programmer
> Illinois Central College, Rm L141 -- East Peoria, IL 61635-0001
> PH: (309) 694-8419 -- FAX: (309) 694-8995
> "C code. C code run. Please, code, RUN!"
>
> -----Original Message-----
> From: Bencke, Gina [mailto:GBencke@KICHLER.COM]
> Sent: Thursday, November 18, 1999 7:17 AM
> To: Multiple recipients of list SQR-USERS
> Subject: Re: Dynamic Table name.. need syntax help
>
> Cathlin,
>
> The FROM [ TABLE1 : $tablename ] allows SQR to actually
> compile the
> Select paragraph during the compile phase ensuring that the
> fields exist
> in TABLE1. Then during the execution phase SQR recompiles
> the select
> statement using the value of $tablename.
>
> The FROM [$tablename] is not compiled until execution.
>
> Both will work assuming the fields you are selecting exist
> in both
> TABLE1 and $tablename.
>
> Gina Bencke
> Bencke Consulting Corporation
> -----Original Message-----
> From: Cathlin DeRosa [mailto:cathlind@NSIGHTINC.COM]
> Sent: Wednesday, November 17, 1999 5:10 PM
> To: Multiple recipients of list SQR-USERS
> Subject: Dynamic Table name.. need syntax help
>
>
> The FROM statement in my SQL clause looks like this
>
> FROM [ TABLE1 : $tablename ]
>
> what the heck is going on here???
> this I would understand
> FROM [$tablename]
>
> but the other one has me baffled and I can't
> find a referance to it in the manuals.
>
> Thnks
>
----------------------------------------------------------------------
Ray Ontko rayo@ontko.com Phone 1.765.935.4283 Fax 1.765.962.9788
Ray Ontko & Co. Software Consulting Services http://www.ontko.com/