Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2005
    Location
    Philippines, Makati
    Posts
    11

    Unanswered: Declaring Variables in DB2 UDB v8.2

    I'm trying to migrate my knowledge from Microsoft SQL Server 2000 / 2005 to IBM UDB and currently encountering a lot of problems.

    Using Command Editor, how do i Declare a Variable.

    DECLARE intVar INTEGER DEFAULT 0;

    Tried executing the code above and i get an error, but this Declaration works when inside a Stored Procedure, is there a Difference?

    Thanks

  2. #2
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    Yes, it only works in procedures. Not sure about triggers.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  3. #3
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    Yes for triggers and also for UDFs.

    Andy

Posting Permissions

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