How do I call an ORACLE function from OCI?

懵懂的女人 提交于 2019-12-06 17:28:07
Thomas Jones-Low

Construct your SQL statment as follows

strcpy ( sql_stmt, "BEGIN :v_seq := get_seq_number(:v_tabname, :v_seqtype); END;" );

Prepare your statement as previously. Bind the variables by name (including the v_seq as previous in your code and execute the statement. When the procedure completes, the value of :v_seq will be set correctly.

You either issue:

SELECT my_udf()
FROM dual

and parse the result as in SELECT query, or call anonymous block:

BEGIN
   :test := my_udf();
END;

, and bind :test as an output parameter.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!