Re: LET statement in 4GL
Posted in 2000
Topics: Stored Procedures & SPL, Connectivity: ESQL/C, 4GL & Embedded SQL, Server Administration, Migration, Import/Export & Data Conversion
From: "DarkEmperor" <darkemperor_uk@yahoo.co.uk>
>
>I want to prepare an SQL statement from
>the following LET:
>LET selstmt = "UNLOAD TO ", DELETE_DIR CLIPPED, gr_item.isn USING
>"<<<<<<<<<<", "dp", " SELECT * FROM process WHERE process.isn = ",
>gr_item.isn
>The prepare statement is falling over with a SQL -201 synntax error.
>When I DISPLAY the selstmt from the program the output is:
>UNLOAD TO /unloaddir/12345678dp SELECT * FROM process WHERE process.isn =>12345678
>If I cut and paste this into dbaccess it unloads the row correctly.
>Any suggestions?
Yes. UNLOAD is an extension to dbaccess, not SQL. So you can't do this.
________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
Obnoxio The Clown wrote:
>
> From: "DarkEmperor" <darkemperor_uk@yahoo.co.uk>
> >
> >I want to prepare an SQL statement from
> >the following LET:
> >LET selstmt = "UNLOAD TO ", DELETE_DIR CLIPPED, gr_item.isn USING
> >"<<<<<<<<<<", "dp", " SELECT * FROM process WHERE process.isn = ",
> >gr_item.isn
> >The prepare statement is falling over with a SQL -201 synntax error.
> >When I DISPLAY the selstmt from the program the output is:
> >UNLOAD TO /unloaddir/12345678dp SELECT * FROM process WHERE process.isn => >12345678
> >If I cut and paste this into dbaccess it unloads the row correctly.
> >Any suggestions?
>
> Yes. UNLOAD is an extension to dbaccess, not SQL. So you can't do this.
You may not be able to prepare then execute it, but what about in your
4GL something like . . .
-------------begin 4gl --------------
let p_unload_file = DELETE_DIR clipped, gr_item.isn using
"<<<<<<<<<<<<", "dp"
unload to p_unload file
select * from process where process.isn = gr_item.isn
-------------end 4gl ------------------
That should work . . .
--
John Carlson
Informix DBA
WHSmith USA
#include std_disclaimer.h /* These are my opinions, not my company's
opinion */