Page 1 of 1

torascript onerror

Posted: Wed 16 Aug 2006 07:03
by monoplaz
hi. i want to execute a script which calls several stored procedures, but to continue if one of them fails. In torascript.onerror i set Action := eaContinue, but rest of the statements does not work. What am i doing wrong?
my script is like

begin
p_insert(1, 'abc', 2);
p_insert(2, 'abc', 2);
p_insert(3, 'abc', 2);
end;

Posted: Wed 16 Aug 2006 08:40
by Plash
You should not use BEGIN and END in the text of the script. TOraScript component considers BEGIN .. END block as single statement.

Posted: Wed 16 Aug 2006 10:57
by monoplaz
thanks for the quick reply.
when i remove begin and end from the script, i take 'Invalid SQL Statement' errors. and also when i try to run it using TOAD, it ignores my script completely.
btw if it has any importance i actually use packages, which i didn't mention in my first post, like

pck_1.p_insert(1, 'abc');
pck_1.p_insert(2, 'abc');
pck_1.p_insert(3, 'abc');

solved

Posted: Wed 16 Aug 2006 11:03
by monoplaz
solved, i should have put execute to call a procedure. thanks for your time

no not solved

Posted: Wed 16 Aug 2006 12:17
by monoplaz
not solved :(
using execute for calling procedures works in TOAD, not in torascript. it gives invalid sql statement. i don't get how two are different.

Posted: Wed 16 Aug 2006 14:11
by Plash
You can use script like this:

Code: Select all

BEGIN
  pck_1.p_insert(1, 'abc');
END;
/

BEGIN
  pck_1.p_insert(2, 'abc'); 
END;
/
 
BEGIN
  pck_1.p_insert(3, 'abc');
END;
/

Posted: Thu 17 Aug 2006 06:17
by monoplaz
it worked, plash. many thanks.
i was about to search 'procedural option', you saved the time.