Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

StoredProcedure to insert data as a CLOB

Status
Not open for further replies.

sheed

Programmer
Joined
Jun 14, 2005
Messages
38
Location
US
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.

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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top