DarkEmperor <darkemperor_uk@yahoo.co.uk> wrote:
>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?
Only prepare everything from the select on then make sure you quote your filename:
let filename = "'",DELETE_DIR clipped, gr.... etc. ...., "dp'"
(note the single quotes)
then you can format your unload statement using the 'unload to' command, your filename variable and the selstmt variable.
carlos
Currently on hiatus from unemployment.
----------------------
Do you do Linux? :)
Get your FREE @linuxstart.com email address at: http://www.linuxstart.com