Error checking // FEW records at once

Bart Pietercil bart.pietercil at gmail.com
Fri Sep 21 04:26:36 CDT 2007


On 21-sep-07, at 11:07, Bart Pietercil wrote:

>
> On 21-sep-07, at 11:02, Ruslan Zasukhin wrote:
>
>>
>>
>> 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.
>>
>>
> Good call, now why didn't I see that myself

Hmm, I adapted the sp

create or replace procedure cm_spBuildUserTypes()
begin
	DECLARE mylastrecid Long;
	insert into tbl_typelists(created_by,typelistname) values  
('cm_spBuildUserTypes','usertypes');
	set mylastrecid = select recid FROM tbl_typelists where typelistname  
= 'usertypes';
	insert into tbl_typelistvalues 
(displayname,listvalue,objptr_typelist) values ('active',1,mylastrecid),
																				('deactivated',2,mylastrecid),
																					('blocked',3,mylastrecid);
exception
	when 50000 then
      print 'dummy';
     when others then
       print 'something went wrong';
end

which is refused by the parser, the console gives:

Kernel error: 0x21502. It's too much values.


TIA

Bart


More information about the Valentina mailing list