Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2005
    Posts
    3

    Unanswered: stored procedures

    I am a green horn as regards stored procedures. I would like to know how i can write a stored procedure for an SQL script i wrote..i'm currently using INFORMIX(unix)..have seen not-too-clear statements...could someone please reel out the syntax with a few comments by the side..will really appreciate the help.

  2. #2
    Join Date
    Mar 2004
    Location
    Netherlands
    Posts
    183
    Hi,

    Although there are not a huge amount of SPL commands, I think it's undoable to discuus them all here. Please ask a more detailed question. Also note the version number of IDS. If it is 9.xx there are a lot more possibilities...;-)

    To get you started here a simple example:

    CREATE PROCEDURE myspl (ptable char(128)) RETURNING integer;
    DEFINE numrows INTEGER;

    select nrows into numrows
    from systables
    where tabname = ptable;

    RETURN numrows;
    END PROCEDURE;

    EXECUTE PROCEDURE myspl("systables");


    (I hope I did't made any typo's, I haven't really tested the code above;

Posting Permissions

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