Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2004
    Posts
    1

    Unanswered: how to increment an integer

    HI ALL
    i am a newbie in SQL.tell me how to increment an integer variable, i dont want autoincrement.

  2. #2
    Join Date
    Jun 2003
    Location
    West Palm Beach, FL
    Posts
    2,713

    Thumbs down

    Where is this integer? In a table in a variable, ...?
    In a table: UPDATE MYTAB SET INT1=INT1+1 WHERE <some condition>;
    In a variable: v_int:=v_int+1;
    In a loop: FOR i1 IN 1..n LOOP...
    In a query: SELECT INT1 + 1 INTO v_int from MYTAB...;

    The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb

Posting Permissions

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