随笔 - 589  文章 - 0 评论 - 116 trackbacks - 5

语法:

CREATE PROCEDURE {schema.}name {({IN|OUT|INOUT}
                                 param_name data_type {,...})}
      {LANGUAGE <LANG>} {SQL SECURITY <MODE>}
      {READS SQL DATA {WITH RESULT VIEW <view_name>}} AS
BEGIN
  ...
END

删除:

语法:DROP PROCEDURE {schema.}name {CASCADE}

修改:

ALTER PROCEDURE {schema.}name RECOMPILE {WITH PLAN}

 

sample:

CREATE PROCEDURE ProcWithResultView(IN id INT, OUT o1 CUSTOMER)
    LANGUAGE SQLSCRIPT READS SQL DATA WITH RESULT VIEW ProcView AS
    BEGIN
        o1 = SELECT * FROM CUSTOMER WHERE CUST_ID = :id;
    END;

 

 

How to call:

CALL getOutput (1000, 'EUR', NULL, NULL);

posted on 2013-04-11 00:14  沧海-重庆  阅读(2663)  评论(0编辑  收藏