View Single Post

   
  #1 (permalink)  
Old 04-20-2008, 04:29 PM
an_dario
 
Posts: n/a
Default Problem trying insert data into a temp table via SP

Hello!
I've got a stored procedure which returns data for a report, but for
generate it, needs to load some data into a temp table. I do this with
this syntax:

--The temporary table is called 'xreg_kraft'
system "echo 'load from /tmp/listkraft_tmp.csv insert into
xreg_kraft;' > /tmp/subir_listkraft.sql";

system "dbaccess maindb /tmp/subir_listkraft.sql";

When the SP tries to run this line, throws an -668 exception (System
command cannot be executed), with -255 ISAM error (Not in
transaction). I tried to fix this error handling the exception like
this:

begin
on exception in (-668)
begin work;
end exception with resume;
system "dbaccess maindb /tmp/subir_listkraft.sql";
end

But throws another exception, -535 (Already in transaction), this
time, with -255 ISAM error (Not in transaction), and makes me confuse,
because I thought opened the transaction, but I can't see where it is.

Can you give me some clues about this? I appreciate your valuable
help!

Andres.

Reply With Quote