While compiling Proc code getting error for SELECT FIRST1
Pro*C/C++: Release 220.127.116.11.0 - Production on Fri Aug 23 20:15:56 2013
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
System default option values taken from: /Oracle11/app/oracle/product/11.2.0/precomp/admin/pcscfg.cfg
Syntax error at line 70, column 16, file OrderMatching_A1.pc:
Error at line 70, column 16 in file OrderMatching_A1.pc
SELECT FIRST 1
PCC-S-02201, Encountered the symbol "1" when expecting one of the following:
, ( * + - / . @ | an identifier, a quoted string, at, date,
into, as, count, from, day, extract, hour, interval, minute,
month, second, time, timestamp, treat, trim, year, avg, max,
min, sum, stddev, variance,
The symbol "," was substituted for "1" to continue.
Error at line 0, column 0 in file OrderMatching_A1.pc
PCC-F-02102, Fatal error while doing C preprocessing
The issue here is that Pro*C (and PL/SQL) use the Oracle SQL parser to parse SQL that is embedded in Pro*C (or PL/SQL) code at compile time but then at execution time it gets sent to the TimesTen SQL engine for execution. Since the Oracle and TimesTen SQL dialects are currently not identical issues liek thsi can arise. Oracle database does not support / understand the SELECT FIRST n syntax used here so the compilation fails. The solution is to use dynamic SQL so that the SQL is not parsed at Pro*C compilation time but rather at Pro*C execution time.
This is a bit like going to a doctor and saying 'I'm not feeling well, what might be the problem?'.
Please provide details, lots of details. Without details we cannot help. There are hundreds, maybe thousands of things that you could check but probably only a few of them are relevant...
Perhaps start with table schema, row count, indexes, are stats updated, what is the query plan, what does application code that processes the SELECT look like, is this direct mode or client server etc. etc.