Pro *C compiler error when using NULLS LAST... Help needed [message #218194] |
Wed, 07 February 2007 04:13 |
krishna.piska
Messages: 4 Registered: February 2007
|
Junior Member |
|
|
Hi
I am a newbie here and need some help in a problem that I am facing...
I have the following query:
Select * from Employee Order by JOIN_DATE DESC NULLS LAST;
I want the sorting to be done in descending order but want the NULLS to be considered last.
This query works fine when running in SQL editor (Toad). But when I put it in a ppc file and compile it I get the following error:
Pro*C/C++: Release 10.2.0.2.0 - Production on Wed Feb 7 12:11:18 2007
Copyright (c) 1982, 2005, Oracle. All rights reserved.
System default option values taken from: /oravl01/oracle/10.2.0.2/precomp/admin/pcscfg.cfg
Syntax error at line 425, column 25, file dbscore_gt_gl_Codes.pc:
Error at line 425, column 25 in file dbscore_gt_gl_Codes.pc
NR_PARAM_4_ID DESC NULLS FIRST;
........................1
PCC-S-02201, Encountered the symbol "NULLS" when expecting one of the following:
; , for, order,
Is there a limitation in Pro *C that it doesn't identify NULLS LAST option in ORDER BY clause?
Can someone please enlighten me in this regard?
Thanks in advance
Krishna
|
|
|
|
Re: Pro *C compiler error when using NULLS LAST... Help needed [message #218203 is a reply to message #218201] |
Wed, 07 February 2007 05:09 |
krishna.piska
Messages: 4 Registered: February 2007
|
Junior Member |
|
|
My mistake...
I was trying with DESC NULLS FIRST also and copied that error when posting it here.
Basically I get the same error when I use LAST or FIRST...
The error when I use DESC NULLS LAST is below:
Pro*C/C++: Release 10.2.0.2.0 - Production on Wed Feb 7 13:09:02 2007
Copyright (c) 1982, 2005, Oracle. All rights reserved.
System default option values taken from: /oravl01/oracle/10.2.0.2/precomp/admin/pcscfg.cfg
Syntax error at line 425, column 25, file dbscore_gt_gl_Codes.pc:
Error at line 425, column 25 in file dbscore_gt_gl_Codes.pc
NR_PARAM_4_ID DESC NULLS LAST;
........................1
PCC-S-02201, Encountered the symbol "NULLS" when expecting one of the following:
; , for, order,
|
|
|
|
Re: Pro *C compiler error when using NULLS LAST... Help needed [message #218212 is a reply to message #218211] |
Wed, 07 February 2007 05:58 |
krishna.piska
Messages: 4 Registered: February 2007
|
Junior Member |
|
|
I get the fatal error also but I did not list it out here...
Here is the complete error:
Syntax error at line 425, column 25, file dbscore_gt_gl_Codes.pc:
Error at line 425, column 25 in file dbscore_gt_gl_Codes.pc
NR_PARAM_4_ID DESC NULLS LAST;
........................1
PCC-S-02201, Encountered the symbol "NULLS" when expecting one of the following:
; , for, order,
Syntax error at line 0, column 0, file dbscore_gt_gl_Codes.pc:
Error at line 0, column 0 in file dbscore_gt_gl_Codes.pc
PCC-S-02201, Encountered the symbol "<eof>" when expecting one of the following:
; : an identifier, end-exec, random_terminal
Error at line 0, column 0 in file dbscore_gt_gl_Codes.pc
PCC-F-02102, Fatal error while doing C preprocessing
I tried removing the NULLS LAST part and it compiles without any error. So I dont think there are any syntax problems apart from NULLS LAST.
I did not understand when you said "Have a look on metalink". Can you elaborate?
Thanks for the help...
|
|
|
|
Re: Pro *C compiler error when using NULLS LAST... Help needed [message #218660 is a reply to message #218268] |
Fri, 09 February 2007 03:51 |
krishna.piska
Messages: 4 Registered: February 2007
|
Junior Member |
|
|
Found out some info. Thought I would post here.
It is a limitation in Pro C 9.0.1. It doesn't recognize the new constructs introduced in Oracle 9i.
Either I have to upgrade the Pro C or use dynamic statements so that the pre-compiler doesn't give me the syntax errors...
The solution I am going for is to use NVL in the ORDER BY clause for the column. Replace the NULL value with a value that I know will come last when ordering by descending...
Thanks again for the help.
|
|
|
|