Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
211 views
in Technique[技术] by (71.8m points)

sql - Alternate of sys_refcursor

What is the alternate of sys_refcursor.

After 12c upgrade, the resultset of sys_refcursor is unrecognizable by mulesoft/tibco. Reading it as null

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Use

TYPE cursor_type IS REF CURSOR;

or a strongly typed cursor:

CREATE PACKAGE SCHEMA_NAME.PACKAGE_NAME
AS
  TYPE Table_Name_Cursor IS REF CURSOR RETURN SCHEMA_NAME.TABLE_NAME%ROWTYPE;

  -- You said this does not work.
  -- PROCEDURE get_Weakly_Typed_Cursor (
  --   out_cursor OUT SYS_REFCURSOR
  -- );

  PROCEDURE get_Strongly_Typed_Cursor (
    out_cursor OUT Table_Name_Cursor
  );
END;
/

CREATE PACKAGE BODY SCHEMA_NAME.PACKAGE_NAME
AS
  PROCEDURE get_Strongly_Typed_Cursor (
    out_cursor OUT Table_Name_Cursor
  )
  AS
  BEGIN
    OPEN out_cursor FOR
    SELECT * FROM SCHEMA_NAME.TABLE_NAME;
  END;
END;
/

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...