Re: LOAD In 4GL Problems
Posted in 2005
How about this:
LET mover = "ln -s ", g_filename, " tmpname"
RUN mover
LOAD FROM tmpname INSERT INTO t_sp
LET cleanup = "rm tmpname"
RUN cleanup
...
Art S. Kagel
----- Original Message -----
From: Navdeep Virk <nvirk@msn.com>
At: 2/22 21:36
> Art and all ,
>
> I tried to load rows into a temp table in a 4GL program ,where I am passing
> the filename as an argument .
> So I used the following syntax.
> DEFINE g_filename CHAR(10)
> .....
> LOAD FROM g_filename INSERT INTO t_sp ,where g_filename is a char variable
> and t_sp is a Temp table.>
> This did not work ,
>
> So I tried
>
> LET g_stmt = "LOAD FROM ",g_filename, " INSERT INTO t_sp "
>
> PREPARE p_curs FROM g_stmt
> EXECUTE p_curs
>
> did not work ,
>
> the third approach was
>
> LET g_stmt = "LOAD FROM ? INSERT INTO t_sp "
> PREPARE p_curs FROM g_stmt
> EXECUTE p_curs USING g_filename
>
> This also did not work .
>
> I can of course hard code the name of the load file ,also I can try fglgets
> to read in the rows one by one to solve the problem.
>
> But my question is that is there no way the "load into a temp table"
> achieved by passing a file as an argument and using prepare or otherwise
>
>
> TIA.
>
> Navdeep
sending to informix-list