Using a Procedure to insert a row into an introspected table

Using a Procedure to insert a row into an introspected table

book

Article ID: KB0082965

calendar_today

Updated On:

Products Versions
TIBCO Data Virtualization 7.0.0 and higher

Description

This article explains the use of a SQL INSERT statement in a Procedure through an example.

Issue/Introduction

Using a Procedure to insert a row into an introspected table

Resolution

Below is an example of a Procedure that inserts a row into an introspected table.

PROCEDURE p_insert()
BEGIN   
   INSERT INTO /shared/DATASOURCES/Oracle_datasource1/JOE/TESTTABLE VALUES (10, 20); 
EXCEPTION
   ELSE IF (LENGTH(CURRENT_EXCEPTION.MESSAGE) > 1 )
THEN
      CALL PRINT ('The insert failed due to an exception :  '  || CURRENT_EXCEPTION.MESSAGE);
      CALL PRINT ('----------------the trace is below -----------------------------------');
      CALL PRINT (CURRENT_EXCEPTION.TRACE);
      CALL PRINT ('---------------- end of the trace  -----------------------------------');
END IF;

END