Error checking // FEW records at once
Ruslan Zasukhin
sunshine at public.kherson.ua
Fri Sep 21 04:02:26 CDT 2007
On 21/9/07 11:19 AM, "Bart Pietercil" <bart.pietercil at gmail.com> wrote:
Hi Bart,
> Hi List,
>
> This stored procedure works:
>
> create or replace procedure spBuildUserTypes()
> begin
> DECLARE mylastrecid Long;
> insert into tbl_typelists(created_by,typelistname) values
> ('spBuildUserTypes','usertypes');
> set mylastrecid = select recid FROM tbl_typelists where typelistname
> = 'usertypes';
> insert into tbl_typelistvalues
> (displayname,listvalue,objptr_typelist) values ('active',1,mylastrecid);
> insert into tbl_typelistvalues
> (displayname,listvalue,objptr_typelist) values ('deactivated',
> 2,mylastrecid);
> insert into tbl_typelistvalues
> (displayname,listvalue,objptr_typelist) values ('blocked',
> 3,mylastrecid);
> exception
> when 50000 then
> print 'dummy';
> when others then
> print 'something went wrong';
> end
Btw,
SQL92 has the following syntax:
insert into
tbl_typelistvalues displayname,listvalue,objptr_typelist)
values
( 'active', 1, mylastrecid ),
( 'deactivated', 2, mylastrecid ),
( 'blocked', 3, mylastrecid );
This should work, and more simple for writing and reading and understanding.
Can be more effective also.
--
Best regards,
Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc
Valentina - Joining Worlds of Information
http://www.paradigmasoft.com
[I feel the need: the need for speed]
More information about the Valentina
mailing list