Hi,
Can someone please provide some sample code for a StoredProcedure to insert data as a CLOB in a table. I am trying to have a StoredProcedure that takes some arguments along with a CLOB data to be inserted. Insise a procedure I want to get a unique value from a sequence to be inserted in the table along with a CLOB and other values coming in the arguments to the StoredProcedure.
Here is a sample that I am trying to make it work. I am passing 2 parameters 1st one holds a string and the 2nd one holds the CLOB data. Also how can I make it to return some value on successful insertion.
Thanks
Can someone please provide some sample code for a StoredProcedure to insert data as a CLOB in a table. I am trying to have a StoredProcedure that takes some arguments along with a CLOB data to be inserted. Insise a procedure I want to get a unique value from a sequence to be inserted in the table along with a CLOB and other values coming in the arguments to the StoredProcedure.
Here is a sample that I am trying to make it work. I am passing 2 parameters 1st one holds a string and the 2nd one holds the CLOB data. Also how can I make it to return some value on successful insertion.
Code:
CREATE OR REPLACE PROCEDURE Insert_CLOB (
arg_1 MyTable.col1%type,
arg_2 MyTable.col2%type
)
AS
num_ID NUMBER;
BEGIN
SELECT seq_MyTable.NEXTVAL
INTO num_ID
FROM DUAL;
INSERT INTO
MyTable (
col1,
col2,
col3
)
VALUES (
num_ID,
arg_1,
arg_2
);
END;
Thanks