Re: Pro*C compile hassle

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Tue, 14 Dec 1999 08:21:29 -0500
Message-ID: <j1hc5s8h7k26gp02c07tbn2j1dgvjdo09r_at_4ax.com>


A copy of this was sent to cjundieseastwd_at_powerup.com.au (Clint Eastwood) (if that email address didn't require changing) On Tue, 14 Dec 1999 08:07:36 GMT, you wrote:

>HiYa
>
>I am trying to mix embedded SQL and PL/SQL in the same module, and I am
>getting error messages that don't make sence, looking at the output
>below, the identifier ORDERS is a table, and this is in SQL and compiled
>fine (and worked) when I didn't have the PL/SQL in there.
>
>what am I doing wrong??
>

when you do sqlcheck, you should also provide a userid=user/pass_at_db to let it connect to do the sqlcheck. you are missing the userid= part.

>Ohhh BTW I find that I can get a compile if I remove the SQL and leave
>only the PL/SQL, and have the PL/SQL of :
>
> EXEC SQL EXECUTE
> DECLARE
> myDate DATE;
> BEGIN
> myDate := sysdate;
> END;
> END-EXEC;
>
>I can't select into myDate from dual!!
>
>
>
>INFAC2::<DEV>[EASTWOC.ROS_DEV] proc tester.pc; SQLCHECK=FULL
>
>Pro*C/C++: Release 2.2.3.0.0 - Production on Tue Dec 14 17:46:57 1999
>
>Copyright (c) Oracle Corporation 1979, 1996. All rights reserved.
>
>System default option values taken from: ora_proc20:pmscfg.cfg
>
> EXEC SQL SELECT ordr.provider_order_num,
>...1
>(1) PCC-S-02201, identifier 'ORDERS' must be declared
>
> EXEC SQL SELECT ordr.provider_order_num,
>...1
>(1) PCC-S-02000, SQL Statement ignored
>
>Semantic error at line 116, column 5, file tester.pc;:
> EXEC SQL SELECT ordr.provider_order_num,
>...1
>(1) PCC-S-02346, PL/SQL found semantic errors
>
> FROM dual;
>.....................1
>(1) PCC-S-02201, identifier 'DUAL' must be declared
>
> SELECT to_char(sysdate,'DD-MON-YYYY HH24:MI:SS')
>..........1
>(1) PCC-S-02000, SQL Statement ignored
>
>Semantic error at line 166, column 9, file tester.pc;:
> BEGIN
>.......1
>(1) PCC-S-02346, PL/SQL found semantic errors
>
>
>
>
>See Ya
>(when the bandwidth gets better ;-)
>Chris Eastwood Please remove undies for reply
>Photographer, Stunt Programmer
>Motorcyclist and dingbat

-- 
See http://osi.oracle.com/~tkyte/ for my columns 'Digging-in to Oracle8i'...
Current article is "Part I of V, Autonomous Transactions" updated June 21'st
 
Thomas Kyte                   tkyte_at_us.oracle.com
Oracle Service Industries     Reston, VA   USA

Opinions are mine and do not necessarily reflect those of Oracle Corporation
Received on Tue Dec 14 1999 - 14:21:29 CET

Original text of this message