Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2004
    Delhi, India

    Red face Unanswered: 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

  2. #2
    Join Date
    Jan 2003
    Provided Answers: 5
    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


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts