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  |
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 #320283 is a reply to message #320250] |
Wed, 14 May 2008 09:15   |
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;
|
|
|
|
Goto Forum:
Current Time: Sun Feb 23 12:46:41 CST 2025
|