On Thu, 24 Sep 1998, SUNIL S. SINGH wrote:
>
> H! ....
>
> In a 4gl program I write
>
> UNLOAD TO abc.unl SELECT * FROM tab_chmast>
> It works fine, but my table name changes dynamically hence I rewrote
>
> LET sql_s = "UNLOAD TO abc.unl SELECT * FROM ",
> variable_containing_table_name
> PREPARE sql_str FROM sql_s
> EXECUTE sql_str
>
> It gives run time error -201 (syntax error)
>
> Any Ideas...
>
> TIA
> Sunil
You are not allowed to prepare an unload statement. (RTFM)
But you can do the following:
let tab = "some_table"
let unl_tab = tab clipped, ".unl"
let str = "select * from ", tab, " where cnt_nbr = 'XYZ'"
unload to unl_tab str
--
______________________________________________________________________
| Colin McGrath cmm@trac3000.ueci.com |
| Raytheon Engineers & Constructors, Inc. (215) 422-4144 |
| Phila, PA, USA |
| Any opinions I state are my own and not necessarily of my employer |
|____________________________________________________________________|