Pro*C and DBMS_ALERT package -- won't precompile!
Date: 1997/03/18
Message-ID: <332dbbc0.0_at_news.usinternet.com>#1/1
[Quoted] 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
Semantic error at line 10, column 2, file mytest.pc:
begin
........1
(1) PCC-S-02346, PL/SQL found semantic errors
dbms_alert.waitany(:name, :etext, :status, :seconds);
............1
(1) PCC-S-02201, identifier 'DBMS_ALERT.WAITANY' must be declared
dbms_alert.waitany(:name, :etext, :status, :seconds);
............1
(1) PCC-S-02000, Statement ignored
Semantic error at line 25, column 2, file mytest.pc:
begin
........1
(1) PCC-S-02346, PL/SQL found semantic errors
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
My pre-compile command-line looks like:
[Quoted] proc iname=mytest.pc ireclen=1000 oreclen=1000 mode=ansi \
ltype=none lines=yes errors=yes sqlcheck=semantics
Here's what my source-file looks like:
[Quoted] - - - - - - 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
Received on Tue Mar 18 1997 - 00:00:00 CET