Home » Developer & Programmer » Precompilers, OCI & OCCI » PCC-S-02201 occured while compiling proc file
PCC-S-02201 occured while compiling proc file [message #263501] Thu, 30 August 2007 03:41 Go to next message
nitzany
Messages: 4
Registered: August 2007
Junior Member
Hi,

My OS is Solrais 8 and the Oracle is Oracle 10g 10.2.0.1.0

I was trying to complie the following proc file :
--------------------------------------------------
#INCLUE <sqlca.h>

typedef char string5_type[5];
typedef string5_type str5_array_type;

void worker_prof(
    str5_array_type db_worker_prof,
    short*          db_worker_prof_ind
    )
{
    EXEC ORACLE OPTION(char_map=VARCHAR2);
    EXEC SQL SELECT(CASE WHEN WORKERS.Kind = 1 THEN (
        SELECT 'AAAAA' 
        FROM DUAL)
                         ELSE
                             NULL
                    END) Prof
              INTO :db_worker_prof
                   INDICATOR:db_worker_prof_ind
              FROM WORKERS
              WHERE Worker_id = 1;
}

-----------------------------------------------------

While compiling I received the following errors :

Pro*C/C++: Release 10.2.0.1.0
(c) Copyright 2005 Oracle Corporation. All rights reserved

System default option values taken from: /oracle/ora102/precomp/admin/pcscfg.cfg

Syntax error at line 12, column 67, file test.pc: Error at line 12, column 67 in file test.pc
EXEC SQL SELECT(CASE WHEN WORKERS.Kind = 1 THEN (SELECT 'AAAAA' FROM DUAL)

PCC-S-02201, Encountered the symbol "AAAAA" when expecting one of the following:
( ) * + - /. @ | at,day,hour,minute,month,seconds,year

Error at line 0, column 0 in file test.pc
PCC-F-02102, Fatal error while doing C preprocessing

I read a post similar to this one and there it was written :

"It turns out that the problem is that the Oracle 8.1.7.4 precompiler parses the AIX 5.l header files without knowing the default defines that are set for the compiler. Hence the default defines set by the C compiler need to be passed on to the precompiler. The solution is to set DEFINE=__64BIT__ or DEFINE=_LONG_LONG in the precompilation options. We added this setting to our makefile, but there are other ways to set precompilation options as needed. This worked for us!"

I tried to do so by executing the commands :
proc test.pc define=__64BIT__
proc test.pc define=_LONG_LONG but it did not help.

Two remarks :
1 By replacing the "SELECT 'AAAAA' FROM DUAL" to just 'AAAAA'
the problem was solved.
Of course this file code is a sample file
that presents the error and not my real code.
2. my pcscfg.cfg is an empty file.

Anyone ? HELP PLEASE .













[Updated on: Thu, 30 August 2007 08:35]

Report message to a moderator

Re: PCC-S-02201 occured while compiling proc file [message #263589 is a reply to message #263501] Thu, 30 August 2007 08:13 Go to previous messageGo to next message
Michel Cadot
Messages: 68624
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Please read and follow OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format. Use the "Preview Message" button.
Please always post your Oracle version (4 decimals).

Maybe it is a restriction in Pro*C SQL syntax analyzer.

Regards
Michel
Re: PCC-S-02201 occured while compiling proc file [message #263602 is a reply to message #263589] Thu, 30 August 2007 08:42 Go to previous messageGo to next message
nitzany
Messages: 4
Registered: August 2007
Junior Member
10x for the comments , I fixed the post.

what do u mean in "restriction in Pro*C SQL syntax analyzer"?
The syntax is correct. I checked it in SqlPlus.





Re: PCC-S-02201 occured while compiling proc file [message #263608 is a reply to message #263602] Thu, 30 August 2007 08:49 Go to previous messageGo to next message
Michel Cadot
Messages: 68624
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
what do u mean in "restriction in Pro*C SQL syntax analyzer"?
The syntax is correct. I checked it in SqlPlus

Yes, syntax is correct but maybe Pro*C syntax analyzer does not know this syntax.
If this is the case, add "sqlcheck=none" (or no, I don't remember) to your Pro*C command, default is "sqlcheck=syntax".

Regards
Michel
Re: PCC-S-02201 occured while compiling proc file [message #263638 is a reply to message #263608] Thu, 30 August 2007 10:15 Go to previous messageGo to next message
lecorr
Messages: 17
Registered: October 2006
Location: Courbevoie, France
Junior Member
Hi,

maybe I'm just a kid, but:

#INCLUE <sqlca.h>

Did you want to write:

#INCLUDE <sqlca.h>

So you compiler knows about Pro*C?

Regards.

Re: PCC-S-02201 occured while compiling proc file [message #263649 is a reply to message #263638] Thu, 30 August 2007 10:48 Go to previous messageGo to next message
Michel Cadot
Messages: 68624
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
I think it just a typo in copy & paste otherwise preprocessor have complained before as the syntax is one of the following ones:
EXEC SQL INCLUDE SQLCA; 
#include <sqlca.h>

Regards
Michel

Re: PCC-S-02201 occured while compiling proc file [message #264216 is a reply to message #263608] Sun, 02 September 2007 01:47 Go to previous messageGo to next message
nitzany
Messages: 4
Registered: August 2007
Junior Member
hey

I tried running the command with sqlcheck = none(and no) and it raised the same error.
I also tried the select_error parameter(don't realy know it but it looked related) , didn't help either.

Don't you think it's something about the compiler default DEFINEs which the preprocessor doesn't know about?
any other suggestions ?


[Updated on: Sun, 02 September 2007 01:51]

Report message to a moderator

Re: PCC-S-02201 occured while compiling proc file [message #264230 is a reply to message #263501] Sun, 02 September 2007 03:31 Go to previous message
nitzany
Messages: 4
Registered: August 2007
Junior Member
After a fast check I found that sqlcheck as only 3 values which are syntax,semantics and full.

tried all of them, no good so far.
Previous Topic: pro*c :Segmentation fault
Next Topic: Signal handling with osnsui & osncui
Goto Forum:
  


Current Time: Thu Mar 28 04:16:32 CDT 2024