Re: OCI programs and database triggers

From: Michael Krolewski <vandra_at_u.washington.edu>
Date: Sun, 24 May 1998 00:32:34 -0700
Message-ID: <3567CD12.223AD5D_at_u.washington.edu>


Not a database trigger. A database procedure or function. Sure.

char someSQLStatement[] = "declare\n"

" variable1    integer, "
" variable2    integer, "
"begin\n"
"    :variable2 := owner.someDatabaseFunction(:variable1);\n"
"end;";

The '\n' appear to be needed - but may just be my overly paronoid coding practices. I generally break lines in the sql statement like I would write them while working in SQLPlus or whatever PL/SQL writing tool. Hence the '\n' at the end of some lines. If they are unnecessary, they will not hurt.

open the database
open a cursor
parse the SQL into the cursor
bind to the variables to the cursor
execute the SQL. (I do not recall if a fetch is required ?? If it is use the execute-fetch

                to save time and space)

Remember to give execute priviledge to the procedure/function to the person that is logged in when the above SQL is being executed.

Mike Krolewski

rakesh wrote:

> Is there a way for a function defined in a OCI program to be notified thru
> a database trigger ?
>
> Rakesh
Received on Sun May 24 1998 - 09:32:34 CEST

Original text of this message