Re: Pro*C and DBMS_ALERT package -- won't precompile!

From: Scott Urman <surman_at_dlsun338.us.oracle.com>
Date: 1997/03/18
Message-ID: <5gmoqn$r53_at_inet-nntp-gw-1.us.oracle.com>#1/1


In article <332dbbc0.0_at_news.usinternet.com>, ken_at_mn.csoft.com (Ken Frank) writes:
|> Can anyone tell me what I'm doing wrong? (Source-code follows at the
|> end). I'm trying to port a "daemon" program from Ingres to Oracle.
|> The program needs to connect to a database and watch for database
|> events (Ingres calls them "dbevents", Oracle apparently calls them
|> "dbms_alerts") and respond accordingly.
|>
|> Unfortunately, I cannot get past the Pro*C precompiler. The errors I
|> am getting are:
|> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|> dbms_alert.register(:name);
|> ............1
|> (1) PCC-S-02201, identifier 'DBMS_ALERT.REGISTER' must be declared
|>
|> dbms_alert.register(:name);
|> ............1
|> (1) PCC-S-02000, Statement ignored
|>
 [snip]
|>
|> My pre-compile command-line looks like:
|> proc iname=mytest.pc ireclen=1000 oreclen=1000 mode=ansi \
|> ltype=none lines=yes errors=yes sqlcheck=semantics

This is your problem right here. With sqlcheck=semantics, you need to specify the userid parameter. The precompiler will use this ID to connect to the database during the precompile to verify that you have access to the objects. Use USERID=scott/tiger for example.

|>
|>
|>
|> Here's what my source-file looks like:
|> - - - - - - file: mytest.pc - - - - - - -
|> #include <stdio.h>
|>
|> int dbevent_register(const char *eventname)
|> {
|> exec sql begin declare section;
|> char *name = eventname;
|> exec sql end declare section;
|>
|> exec sql execute
|> begin
|> dbms_alert.register(:name);
|> end;
|> end-exec;
|> }
|>
|> int dbevent_wait(int timeout, char *eventname, char *eventtext)
|> {
|> exec sql begin declare section;
|> char *name = eventname, *etext = eventtext;
|> double status;
|> int seconds = timeout;
|> exec sql end declare section;
|>
|> exec sql execute
|> begin
|> dbms_alert.waitany(:name, :etext, :status, :seconds);
|> end;
|> end-exec;
|> /* what will be put into "status"? */
|> }
|> - - - end of file: mytest.pc (just a library-sort of routine) - - -
|>
|>
|> Finally, this stuff *appears* to be installed -- I can DESCRIBE it in
|> SQLPLUS.
|>
|> Any help will be greatly appreciated!
|> Thanks,
|> Ken Frank
|> ken_at_mn.csoft.com
|>



Scott Urman Oracle Corporation surman_at_us.oracle.com

Author of _Oracle PL/SQL Programming_ ISBN 0-07-882176-2 Published by Oracle Press - http://www.osborne.com/oracle/index.htm

"The opinions expressed here are my own, and are not necessarily that of  Oracle Corporation"
Received on Tue Mar 18 1997 - 00:00:00 CET

Original text of this message