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 > sql stored procedure in db2

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-08-04, 08:34
jitendra kumar jitendra kumar is offline
Registered User
 
Join Date: Apr 2004
Location: Delhi, India
Posts: 1
Red face sql stored procedure in db2

Hi, someone tel me the following which i can use in place of oracle's.
1. what can i use in place of sysdate.
2. how can i perform data type conversion in db2.
3. what is the option of acheiving cursor for loop in db2.
4. how can insert the error message into a table when an error
occured while calling the procedure corrosponding an sqlcode.
5. can i convert a varchar type value to date type (i.e. 'dd/mm/yy')
and in integer vaue.
i.e. we can perform in oracle as
datavalue varchar(100);
and we perform the following function to convert thr data type such as
1. to_date(datavalue,'DD/MM/YYYY')
2. to_number(datavalue).

If any one has the solution for my problems please mail me soon.
I am very thankfull for that.
By by
Jitendr Kumar
jitu1105@rediffmail.com
Reply With Quote
  #2 (permalink)  
Old 04-08-04, 10:30
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
1) assyming sysdate is the current date from the server, in DB2 use: CURRENT DATE (also CURRENT TIME and CURRENT TIMESTAMP)

2) try using CAST

3) not sure what you are asking, Try FETCH

4) do not know what you are asking

5) yes see DATE and INTEGER functions, There is also a TO_DATE function

Andy
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