torascript onerror

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
monoplaz
Posts: 5
Joined: Wed 16 Aug 2006 06:46

torascript onerror

Post by monoplaz » Wed 16 Aug 2006 07:03

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;

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Wed 16 Aug 2006 08:40

You should not use BEGIN and END in the text of the script. TOraScript component considers BEGIN .. END block as single statement.

monoplaz
Posts: 5
Joined: Wed 16 Aug 2006 06:46

Post by monoplaz » Wed 16 Aug 2006 10:57

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');

monoplaz
Posts: 5
Joined: Wed 16 Aug 2006 06:46

solved

Post by monoplaz » Wed 16 Aug 2006 11:03

solved, i should have put execute to call a procedure. thanks for your time

monoplaz
Posts: 5
Joined: Wed 16 Aug 2006 06:46

no not solved

Post by monoplaz » Wed 16 Aug 2006 12:17

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.

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Wed 16 Aug 2006 14:11

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;
/

monoplaz
Posts: 5
Joined: Wed 16 Aug 2006 06:46

Post by monoplaz » Thu 17 Aug 2006 06:17

it worked, plash. many thanks.
i was about to search 'procedural option', you saved the time.

Post Reply