unload in a program 4gl
Posted in 1999
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL, Migration, Import/Export & Data Conversion
hi ! hello I need to execute a [unload] from a program 4gl but it give error could you help me? The sentences that I use are: LET fichero=ascii 34,"datos.dat",ascii 34 LET acc = " UNLOAD TO ",fichero clipped ," DELIMITER ",ascii 34,"|",ascii 34, " SELECT * FROM gmacli01f01 " PREPARE e_acc FROM acc EXECUTE e_acc FREE e_acc What is wrong?... Thanks
EUROTELA,S.A. wrote:
>
> hi !
> hello
> I need to execute a [unload] from a program 4gl but it give error
> could you help me?
> The sentences that I use are:
> LET fichero=ascii 34,"datos.dat",ascii 34
> LET acc = " UNLOAD TO ",fichero clipped ," DELIMITER ",ascii 34,"|",ascii
> 34,
> " SELECT * FROM gmacli01f01 "
> PREPARE e_acc FROM acc
> EXECUTE e_acc
> FREE e_acc
>
> What is wrong?... Thanks
UNLOAD is not an SQL command that the engine executes it is a 4GL and
dbaccess built-in command. Therefore you cannot PREPARE and EXECUTE an
UNLOAD. Just change that to:
UNLOAD TO "datos.dat" DELIMITER "|"
SELECT * FROM gmacli01f01
or:
LET fichero = "datos.dat"
UNLOAD TO fichero CLIPPED DELIMITER "|"
SELECT * FROM gmacli01f01
The embedded quotes are not needed.
Art S. Kagel