If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Integer to Char Conversion

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-28-03, 20:12
toby25 toby25 is offline
Registered User
 
Join Date: Sep 2003
Posts: 63
Integer to Char Conversion

I have to modify following SP to accept 'Char' parameters instead of integers. Whats the 'Char' equivalent of 'Integer'? Also what function should I use to convert Char to integer again or vice a versa?

CREATE PROCEDURE DXTEST.del_proc (
IN ip_actor_name CHAR(70),
ip_actl_fatlinkid INTEGER
)
LANGUAGE SQL
BEGIN
---------------------------------------------
-- Assign Variables --
---------------------------------------------
DECLARE v_actor_id INTEGER;
DECLARE v_actl_fatlinkid INTEGER;
---------------------------------------------
-- Get the User ID and the Group ID --
---------------------------------------------
select M_ACTOR_N_ID into v_actor_id from DXTEST.OBJ_M_ACTOR where M_ACTOR_C_NAME=ltrim(rtrim(ip_actor_name)) and M_ACTOR_N_LAT<>1;
select M_ACTL_N_FATLINKID into v_actl_fatlinkid from DXTEST.OBJ_M_ACTORLINK where M_ACTL_N_ACTORID=v_actor_id and M_ACTL_N_FATLINKID=ip_actl_fatlinkid;
---------------------------------------------
-- Check if UserId exists --
---------------------------------------------
IF v_actor_id is not null and v_actl_fatlinkid is not null then
delete from DXTEST.OBJ_M_ACTOR where M_ACTOR_N_ID=v_actor_id;
delete from DXTEST.OBJ_M_ACTORLINK where M_ACTL_N_ACTORID=v_actor_id and M_ACTL_N_FATLINKID=ip_actl_fatlinkid;
END IF;
END
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On