Results 1 to 5 of 5

Thread: Signal Resignal

  1. #1
    Join Date
    Dec 2003
    Posts
    10

    Unanswered: Signal Resignal

    Hello,

    I have a problem with SIGNAL and RESIGNAL statements. May I call these statements at another place in SQL stored procedure like in CONDITION HANDLER ? Still I was not successful. If yes can you send me any example?

    Thanks for answer.

  2. #2
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    Yes,

    THis is taken straight out of the V8.1 SQL Reference:

    CREATE PROCEDURE SUBMIT_ORDER
    (IN ONUM INTEGER, IN CNUM INTEGER,
    IN PNUM INTEGER, IN QNUM INTEGER)
    SPECIFIC SUBMIT_ORDER
    MODIFIES SQL DATA
    LANGUAGE SQL
    BEGIN
    DECLARE EXIT HANDLER FOR SQLSTATE VALUE '23503'
    SIGNAL SQLSTATE '75002'
    SET MESSAGE_TEXT = 'Customer number is not known';
    INSERT INTO ORDERS (ORDERNO, CUSTNO, PARTNO, QUANTITY)
    VALUES (ONUM, CNUM, PNUM, QNUM);
    END

    HTH

    Andy

  3. #3
    Join Date
    Dec 2003
    Posts
    10
    Originally posted by ARWinner
    Yes,

    THis is taken straight out of the V8.1 SQL Reference:

    CREATE PROCEDURE SUBMIT_ORDER
    (IN ONUM INTEGER, IN CNUM INTEGER,
    IN PNUM INTEGER, IN QNUM INTEGER)
    SPECIFIC SUBMIT_ORDER
    MODIFIES SQL DATA
    LANGUAGE SQL
    BEGIN
    DECLARE EXIT HANDLER FOR SQLSTATE VALUE '23503'
    SIGNAL SQLSTATE '75002'
    SET MESSAGE_TEXT = 'Customer number is not known';
    INSERT INTO ORDERS (ORDERNO, CUSTNO, PARTNO, QUANTITY)
    VALUES (ONUM, CNUM, PNUM, QNUM);
    END

    HTH

    Andy


    Thanks, but I would like to put SIGNAL statement into other place of procedures body, not only in HANDLER. This is my problem.

  4. #4
    Join Date
    Jan 2003
    Posts
    4,292
    Provided Answers: 5
    Yes, you should be able to use it outside a CONDITION statement. Could you post what you are trying to do (code) and tell me what you want it to do, maybe then I can help.

    Andy

  5. #5
    Join Date
    Dec 2003
    Posts
    10
    Originally posted by ARWinner
    Yes, you should be able to use it outside a CONDITION statement. Could you post what you are trying to do (code) and tell me what you want it to do, maybe then I can help.

    Andy
    I don' t understand. Now everything works good, and 2 day ago I got error messages.

    Thank you.

Posting Permissions

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