plsql

How can i call a function that return a BOOLEAN using MyBatis?

混江龙づ霸主 提交于 2021-02-11 13:02:04
问题 i'm using MyBatis to call a function in a PL SQL database. The function have one of the OUT parameter as BOOLEAN like this: FUNCTION f_foo_function(foo IN VARCHAR, foo_output OUT BOOLEAN, error OUT VARCHAR2) My problem is when i try to call the function from my xml mapper, every try i do mybatis don't recognize the boolean output and throw me and error like incompatible types. Also when i try to test the function from PLSQL Developer it make a convertion like this :pout_boolean_result := sys

Error(8,1): PLS-00103: Encountered the symbol “SET”

て烟熏妆下的殇ゞ 提交于 2021-02-11 12:30:14
问题 I'm trying to create a function using oracle, it should be working fine but i keep getting the following error: Error(8,1): PLS-00103: Encountered the symbol "SET" here is my Function: CREATE OR REPLACE FUNCTION CountViewers(nameofPlay plays.play%TYPE) RETURN NUMBER AS NUM NUMBER; BEGIN SELECT SUM(registerd) INTO num1 FROM plays WHERE play=nameofPlay; return num; END; SET SERVEROUT ON; DECLARE inc integer; res NUMBER; invalid_status EXCEPTION; CURSOR clients2 IS SELECT * FROM plays; name_of

Specify certificate and key in oracle wallet

怎甘沉沦 提交于 2021-02-11 12:13:03
问题 I'm making a POST request in PL/SQL, but I'm running into a Certificate validation failure error. If I run it outside of the database, in either cURL or Postman it works fine. In the latter programs, I need to specify the client certificate, private key and CA certificate. In cURL I am using --cert , --key and --cacert . When running in PL/SQL, I can only specify the wallet where these files are stored, but I don't seem to have an option of specifying which certificate and key I want to use,

Can i use REGEXP_LIKE as a condition with IF in a PL/SQL block

谁说胖子不能爱 提交于 2021-02-11 07:22:30
问题 I'm trying to create a function designed to traverse a tree of organisational units filtering out some based on their level in the tree structure and weather they appear on our intranet page. The input to the function is the ORG_UNIT_ID of the starting unit, a flag to show if we should care about the intranet flag and a comma separated list of levels. For instance '2,3'. I'm trying to use REGEXP_LIKE in conjunction with an ELSEIF inside a loop to run up the tree until I hit the first eligible

Can i use REGEXP_LIKE as a condition with IF in a PL/SQL block

这一生的挚爱 提交于 2021-02-11 07:20:09
问题 I'm trying to create a function designed to traverse a tree of organisational units filtering out some based on their level in the tree structure and weather they appear on our intranet page. The input to the function is the ORG_UNIT_ID of the starting unit, a flag to show if we should care about the intranet flag and a comma separated list of levels. For instance '2,3'. I'm trying to use REGEXP_LIKE in conjunction with an ELSEIF inside a loop to run up the tree until I hit the first eligible

Looping cursor throws error that cursor is not defined

青春壹個敷衍的年華 提交于 2021-02-10 16:55:37
问题 I want to loop results from stored procedure. My code: set serveroutput on VAR c_curs refcursor; EXECUTE pck_prov.get_value_type_list(1, :c_curs); BEGIN FOR record_test IN c_curs LOOP dbms_output.put_line(record_test.id); END LOOP; END; I don't understand why this is throwing error that c_curs must be declared: Error starting at line : 7 in command - BEGIN FOR record_test IN c_curs LOOP dbms_output.put_line(record_test.id); END LOOP; END; Error report - ORA-06550: line 2, column 24: PLS-00201

Looping cursor throws error that cursor is not defined

主宰稳场 提交于 2021-02-10 16:55:13
问题 I want to loop results from stored procedure. My code: set serveroutput on VAR c_curs refcursor; EXECUTE pck_prov.get_value_type_list(1, :c_curs); BEGIN FOR record_test IN c_curs LOOP dbms_output.put_line(record_test.id); END LOOP; END; I don't understand why this is throwing error that c_curs must be declared: Error starting at line : 7 in command - BEGIN FOR record_test IN c_curs LOOP dbms_output.put_line(record_test.id); END LOOP; END; Error report - ORA-06550: line 2, column 24: PLS-00201

Is it possible to run a sqlplus file inside a stored procedure?

隐身守侯 提交于 2021-02-10 15:56:01
问题 Hi is it possible to run and execute a sqlplus file from inside a stored procedure ? I have tried the following so far: CREATE OR REPLACE PROCEDURE SCRIPTRUN ( p_orgid IN VARCHAR2, p_axtype IN VARCHAR2, P_option IN VARCHAR2 ) AS runn VARCHAR2(200) := '@C:\Scripts\delete_ax\delete-ORG.sql '|| p_orgid ||' '|| p_axtype||' '|| P_option ; BEGIN execute IMMEDIATE runn; END SCRIPTRUN; Error Messages I'm getting : ORA-00900: invalid SQL statement ORA-06512: at "DWOLFE.SCRIPTRUN", line 17 ORA-06512:

PL/SQL assigning query results to a CLOB

僤鯓⒐⒋嵵緔 提交于 2021-02-10 07:54:30
问题 I have a problem, I am creating an CLOB variable with the contents of a query in oracle to email to users, the problem is that it does email as .csv but with no contents. I can not find the problems: CREATE OR REPLACE PROCEDURE trackekr(cursor1 IN OUT SYS_REFCURSOR) AS v_connection UTL_SMTP.connection; v_clob CLOB := EMPTY_CLOB(); v_len INTEGER; v_index INTEGER; c_mime_boundary CONSTANT VARCHAR2(256) := 'the boundary can be almost anything'; rec NUMBER(10, 0) := 0; d_id NUMBER(10, 0) := 0;

How to solved problem with Oracle DBMS_LOB

痴心易碎 提交于 2021-02-10 05:52:16
问题 I am trying to save the information of an XML file in a database table and I am using this procedure: create or replace PROCEDURE P_FILEUPLOAD_XML (P_CMTT_CODE IN NUMBER DEFAULT 15, P_TEXT IN VARCHAR2, P_TEXT_NAR IN VARCHAR2, P_PATH IN VARCHAR2, P_FILENAME IN VARCHAR2, P_RET_VAL OUT NUMBER) IS GRUPO VARCHAR2(20); l_dir CONSTANT VARCHAR2(35) := P_PATH; l_fil CONSTANT VARCHAR2(30) := P_FILENAME; l_loc BFILE; -- Pointer to the BFILE l_ret BOOLEAN := FALSE; -- Return value l_pos NUMBER := 1; --