Unix Technical Forum

plz help

This is a discussion on plz help within the DB2 forums, part of the Database Server Software category; --> hi all, IF p_flag='I' AND v_count<>v_limit THEN INSERT INTO user_vendor_table(account_id,vendor_id,user_login_ name,user_password,type) VALUES(p_account_id,p_vendor_id,p_user_login_name, p_user_password,p_type); i have this logic inside the ...


Go Back   Unix Technical Forum > Database Server Software > DB2

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-27-2008, 07:14 AM
situ
 
Posts: n/a
Default plz help

hi all,

IF p_flag='I' AND v_count<>v_limit THEN

INSERT INTO
user_vendor_table(account_id,vendor_id,user_login_ name,user_password,type)

VALUES(p_account_id,p_vendor_id,p_user_login_name, p_user_password,p_type);


i have this logic inside the procedure. i.e
it won't insert if v_count not equal to v_limit.

the problem is it won't return any error code or sqlstate .
could any body show me how to raise user defined exception for this.

thnaks and regards
situ.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-27-2008, 07:14 AM
Serge Rielau
 
Posts: n/a
Default Re: plz help

situ wrote:
> hi all,
>
> IF p_flag='I' AND v_count<>v_limit THEN
>
> INSERT INTO
> user_vendor_table(account_id,vendor_id,user_login_ name,user_password,type)
>
> VALUES(p_account_id,p_vendor_id,p_user_login_name, p_user_password,p_type);

ELSE SIGNAL SQLSTATE '78001' SET MESSAGE_TEXT = 'Bad v_count';
END IF;



--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-27-2008, 07:14 AM
situ
 
Posts: n/a
Default Re: plz help


thank u very much Serge, its working now

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:57 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com