Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2002
    Location
    India
    Posts
    17

    Unanswered: Functions in DB2

    Hi All,
    We were working on Java and Oracle but suddenly client has asked us to shift on DB2. I am pretty new to db2 wth java stuff. Know db2 for os/390 in depth.

    Problems I am facing are as follows:

    1. how do we convert existing queries (which use Oracle specific
    functions like TO_DATE and TO_CHAR etc.) into DB2 queires.

    2. how to go about migrating data from Oracle to DB2

    3. how to create procedures and functions (SQL procedures and Java procedures) in DB2

    4. Analogy between a Schema/User concept in Oracle with DB2. I think in db2 u can not create user. OS Specific user is your db2 user.....

    Please help me in this regard.
    Thanks in advance.
    -D

  2. #2
    Join Date
    Apr 2002
    Posts
    188

    Re: Functions in DB2

    Originally posted by dkhambit
    Hi All,
    We were working on Java and Oracle but suddenly client has asked us to shift on DB2. I am pretty new to db2 wth java stuff. Know db2 for os/390 in depth.

    Problems I am facing are as follows:

    1. how do we convert existing queries (which use Oracle specific
    functions like TO_DATE and TO_CHAR etc.) into DB2 queires.

    2. how to go about migrating data from Oracle to DB2

    3. how to create procedures and functions (SQL procedures and Java procedures) in DB2

    4. Analogy between a Schema/User concept in Oracle with DB2. I think in db2 u can not create user. OS Specific user is your db2 user.....

    Please help me in this regard.
    Thanks in advance.
    -D

    hello,

    let me see if this can help you

    1 - for the date thing you can use
    SYSDATE --> timestamp_iso(current timestamp)
    select timestamp_iso(current timestamp) from sysibm.dummy1
    or
    values timestamp_iso(current timestamp)

    2- Oracle has some transformation process that can help you with that
    or try researching on the load utilities on DB2

    3- you have the choice of Java SP or SQL Language SP
    for the SQL Language SP you will need a C compiler on the server
    where the database resides , Visual Age C compiler from IBM is a
    very good one, I have tried gcc but I could not make it work.
    The same goes with the java SP environment, I know you can use it
    but I have not been able to make it work on my environment.

    4-In DB2 (Windows, Unix) the concep on schema is attached to the user that you created within your OS security context , and is not the same as Oracle.
    Create your database with your db2admin user, then whenever you are ready to created your objects (tables, indexes, tablespaces, etc),
    loging with the user that will have access to those objects (make sure to give this user at least DBADMIN rights), then any other user that will want to have access to those objects you will have to customize by ways of aliases under it schema.
    It is kind of interesting how this thing work, in Oracle as long as you give any user access to a particula schema that user will see the objects, in DB2 you can give them access to the objects but then if you have not crated aliases you will have to write well define sql statements to access them.

    my 2 cents, hope it helps

    marcos oliva

Posting Permissions

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