Re: DBMS_ALERT in Proc*C program

From: Thomas J. Kyte <tkyte_at_us.oracle.com>
Date: 1996/10/18
Message-ID: <3265c6f1.15133350_at_dcsun4>#1/1


On Wed, 16 Oct 1996 16:31:15 -0400, Francois Rochette <frochett_at_drev.dnd.ca> wrote:

>How do you use the DBMS_ALERT functions in a Pro*c program anyway?
>
>Oracle says something about it in the Developer's guide 7.3 but not
>for C programs and it doesn't work. The compiler doesn't know anything
>about the DBMS_ALERT and cannot link the program.
>
>Please, I am in a hurry to use this feature!
>
>
>Francois Rochette
>frochett_at_drev.dnd.ca

You use dbms_alert in a c program the same way you use any pl/sql package/procedure, for example:

EXEC SQL BEGIN DECLARE SECTION;

	VARCHAR		Name[255];
        short		NameI;
	VARCHAR		Message[2000];
	short		MessageI;
	int		Status;

....

   Name.len = 255;
   Message.len = 2000;
   EXEC SQL EXECUTE
   BEGIN
        dbms_alert.waitany( :Name:NameI, :Message:MessageI, :Status );    END;
   END-EXEC;    printf( "The status is %d\n", Status );    if ( !NameI ) printf( "Alert Named '%.*s' signaled\n", Name.len, Name.arr );    if ( !MessageI ) printf("The Message is '%.*s'\n", Message.len, Message.arr);

......

See the pl/sql reference and/or the pro*c manual for examples of calling pl/sql from C.

Thomas Kyte
Oracle Government
tkyte_at_us.oracle.com                          

http://govt.us.oracle.com

  • Check out Oracle Governments web site! ----- Follow the link to "Tech Center" and then downloadable Utilities for some free software...

statements and opinions are mine and do not necessarily reflect the opinions of Oracle Corporation Received on Fri Oct 18 1996 - 00:00:00 CEST

Original text of this message