3 Replies Latest reply: Aug 24, 2013 6:52 AM by Chrisjenkins-Oracle RSS

    While compiling Proc code getting error for SELECT FIRST1

    bamolsh_tcs

      While compiling Proc code getting error for SELECT FIRST1

       

      Pro*C/C++: Release 11.2.0.3.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
      ...............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

        • 1. Re: While compiling Proc code getting error for SELECT FIRST1
          Chrisjenkins-Oracle

          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.

           

          Chris

          • 2. Re: While compiling Proc code getting error for SELECT FIRST1
            bamolsh_tcs

            Hi Chris,

             

            My application is taking more time with Timesten than Oracle for SELECT (approx 350 microseconds) and UPDATE (370 microseconds). Its hould be in the range of 20 - 30 microseconds. Please let me know if I need to check for any specific TT parameter.

            • 3. Re: While compiling Proc code getting error for SELECT FIRST1
              Chrisjenkins-Oracle

              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.

               

              Chris