Home » Developer & Programmer » Precompilers, OCI & OCCI » pro*c compile error:(related to JOIN) (Unix,Oracle 10g)
pro*c compile error:(related to JOIN) [message #320250] Wed, 14 May 2008 07:37 Go to next message
xyzt
Messages: 27
Registered: April 2008
Junior Member
Hello,

I modified the Pro*C sample program's SELECT query. It now gives compile errors.
Here's the SQL query:
           EXEC SQL SELECT ename, sal, NVL(comm, 0)
                INTO :emprec INDICATOR :emprec_ind
                FROM EMP JOIN DEPT ON EMP.DEPTNO=DEPT.DEPTNO
                WHERE EMP.EMPNO = :emp_number;


here's the related compile errors:

Syntax error at line 93, column 31, file test.pc:
Error at line 93, column 31 in file test.pc
FROM EMP JOIN DEPT ON EMP.DEPTNO=DEPT.DEPTNO
..............................1
PCC-S-02201, Encountered the symbol "DEPT" when expecting one of the following:

; , for, union, connect, group, having, intersect, minus,
order, start, where, with,

Syntax error at line 93, column 49, file test.pc:
Error at line 93, column 49 in file test.pc
FROM EMP JOIN DEPT ON EMP.DEPTNO=DEPT.DEPTNO
................................................1
PCC-S-02201, Encountered the symbol "=" when expecting one of the following:

: ) [ ] / . an identifier, a numeric constant,

Syntax error at line 94, column 46, file test.pc:
Error at line 94, column 46 in file test.pc
WHERE EMP.EMPNO = :emp_number;
.............................................1
PCC-S-02201, Encountered the symbol ";" when expecting one of the following:

: ( [ * + - / . | ++ -- -> at, indicator, and, or, day, hour,
minute, month, returning, second, year,


Do I forget something?

NOTE:It works with this query:
            EXEC SQL SELECT ename, sal, NVL(comm, 0)
                INTO :emprec INDICATOR :emprec_ind
                FROM EMP 
                WHERE EMP.EMPNO = :emp_number;

[Updated on: Wed, 14 May 2008 07:39]

Report message to a moderator

Re: pro*c compile error:(related to JOIN) [message #320252 is a reply to message #320250] Wed, 14 May 2008 07:39 Go to previous messageGo to next message
Michel Cadot
Messages: 64153
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
What is your CLIENT/Pro*C version?

Regards
Michel
Re: pro*c compile error:(related to JOIN) [message #320254 is a reply to message #320252] Wed, 14 May 2008 07:42 Go to previous messageGo to next message
xyzt
Messages: 27
Registered: April 2008
Junior Member
Pro*C/C++: Release 9.2.0.7.0 - Production on Wed May 14 15:38:37 2008

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Re: pro*c compile error:(related to JOIN) [message #320283 is a reply to message #320250] Wed, 14 May 2008 09:15 Go to previous messageGo to next message
xyzt
Messages: 27
Registered: April 2008
Junior Member
when I convert the query to cartesian product form like below, it works correctly but using JOIN causes compile error:
            EXEC SQL SELECT ename, dname, sal, NVL(comm, 0)
                INTO :emprec INDICATOR :emprec_ind
                FROM EMP,DEPT
                WHERE EMP.EMPNO = :emp_number AND
                      EMP.DEPTNO=DEPT.DEPTNO;
Re: pro*c compile error:(related to JOIN) [message #320310 is a reply to message #320283] Wed, 14 May 2008 11:44 Go to previous message
Michel Cadot
Messages: 64153
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
This is why I asked for your Pro*C version.
It seems unable to understand ASCII syntax.

Regards
Michel
Previous Topic: Pro*C - Table or view doesn't exist error...
Next Topic: sqlcxt runtime exception after 8i -> 11g port
Goto Forum:
  


Current Time: Sun Dec 11 08:29:48 CST 2016

Total time taken to generate the page: 0.05774 seconds