![]() |
Pro*C - PERCENT_RANK() compilation issue
Hello,
I have a pro*C compilation issue, while using PERCENT_RANK() in-built function. Here are the details : The Pro*C code : Code:
int srccct2_insert()/oracle/product/10.2.0/bin/proc iname=srascs01.pc ireclen=320 oreclen=320 sqlcheck=full userid=retr/rteru maxopencursors=32 dbms=v8 char_map=varchar2 release_cursor=yes include=/oracle/product/10.2.0/precomp/public include=/ihome/hp/../common/include include=/ihome/retr/include include=/usr/include include=/ihome/hp/portlib DEFINE=HPUX I have put the same sql statements in the sql promt and it works fine. But in Pro*C when i compile it using above options, here is the error : ================================================== ====== Pro*C/C++: Release 10.2.0.4.0 - Production on Thu Feb 25 00:57:42 2010 Copyright (c) 1982, 2007, Oracle. All rights reserved. System default option values taken from: /oracle/product/10.2.0/precomp/admin/pcscfg.cfg Syntax error at line 192, column 28, file srascs01.pc: Error at line 192, column 28 in file srascs01.pc PERCENT_RANK() OVER (ORDER BY base_saly) pr ...........................1 PCC-S-02201, Encountered the symbol "(" when expecting one of the following: , into, from, Error at line 0, column 0 in file srascs01.pc PCC-F-02102, Fatal error while doing C preprocessing *** Error exit code 1 Stop. *** Error exit code 1 Stop. ================================================== ======= The Pro*C precompiler might not be recognizing the PERCENT_RANK() function for some reason, so it is expecting "into" "from" for the SELECT statement above. Please help me in solving this issue. Thanks a ton in advance. Thanks, -Kumar |
Re: Pro*C - PERCENT_RANK() compilation issue
The problem here is that the Pro*C SQL parser isn't exactly the same as the RDBMS SQL parser, so it doesn't understand all valid SQL.
The solution is to use Dynamic SQL instead and pass the SQL as a string to the database, to be interpreted directly by the database. |
Re: Pro*C - PERCENT_RANK() compilation issue
Thank you for the reply. Yes, using Dynamic Programming solved the issue.
|
| All times are GMT +5.5. The time now is 18:12. |