Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Different Behaviour Of Syntax Checks

Re: Different Behaviour Of Syntax Checks

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Sat, 04 Sep 1999 08:55:56 -0400
Message-ID: <OBbRN9dY5z7EKrQBKgckqtXIjkIp@4ax.com>


A copy of this was sent to Martin Haltmayer <Martin_Haltmayer_at_in.augsburg.net> (if that email address didn't require changing) On Thu, 02 Sep 1999 01:41:18 +0200, you wrote:

>Hi all,
>
>I found a strange behaviour difference in Oracle8i as opposed to 7.3.4:
>

I ran this in 7.3 and 8.0.

Neither (correctly) stopped the procedure from compiling. Both versions behaved the same. This is a runtime error -- not a compile time error. Can you post a cut&paste from a 7.3 sqlplus session that shows this being flagged as a compile time error?

test1 is a procedure that takes a varchar2 as an input. there is no way:

> b:= test1 ('y'); -- should already blow up at compile time.

should be flagged as a compile error. it matches perfectly.

there is really no way (in general) the program error you would like to have caught at compile time could be.

>-- test_runtime_error.sql checks for an error that could be detected
>-- at compile time but was detected only at runtime.
>
>-- Martin Haltmayer, 2nd September 1999
>
>drop function test1;
>drop procedure test2;
>
>create function test1 (n in varchar2) return number is
>begin
> return 'x' || n;
>end test1;
>/
>
>show errors
>
>create procedure test2 (m in number) is
> b varchar2 (10);
>begin
> b:= test1 ('y'); -- should already blow up at compile time.
>end test2;
>/
>
>show errors
>
>execute test2 (3)
>
>drop function test1;
>drop procedure test2;
>
>exit
>
>These procedures would compile well but on execution time the will break
>with ORA-06502 in Oracle8i but they will break on compile time in Oracle
>7.3.4.
>
>Questions: 1. Does that mean that I no longer can assume that an okay
>compiled procedure is working? 2. How can I force Oracle8i to check as
>much as possible as formerly in 7.3.4?
>
>Thanks a lot.
>
>X-Mozilla-Status: 0009ep 02 01:41:49 1999
>X-Mozilla-Status: 0801
>X-Mozilla-Status2: 00000000
>FCC: /D|/Programme/Netscape/Users/martin_haltmayer/mail/Sent
>Message-ID: <37CDB9BD.71DE8FD9_at_in.augsburg.net>
>Date: Thu, 02 Sep 1999 01:41:49 +0200
>From: Martin Haltmayer <Martin_Haltmayer_at_in.augsburg.net>
>X-Mozilla-Draft-Info: internal/draft; vcard=0; receipt=0; uuencode=0; html=0; linewidth=0
>X-Mailer: Mozilla 4.61 [en] (WinNT; I)
>X-Accept-Language: en,de-DE
>MIME-Version: 1.0
>To: martin_haltmayer_at_betaresearch.de
>Subject: Zu Testen
>Content-Type: text/plain; charset=us-ascii
>Content-Transfer-Encoding: 7bit
>
>-- test_runtime_error.sql checks for an error that could be detected
>-- at compile time but was detected only at runtime.
>
>-- Martin Haltmayer, 2nd September 1999
>
>drop function test1;
>drop procedure test2;
>
>create function test1 (n in varchar2) return number is
>begin
> return 'x' || n;
>end test1;
>/
>
>show errors
>
>create procedure test2 (m in number) is
> b varchar2 (10);
>begin
> b:= test1 ('y'); -- should already blow up at compile time.
>end test2;
>/
>
>show errors
>
>execute test2 (3)
>
>drop function test1;
>drop procedure test2;
>
>exit
>

--
See http://govt.us.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 Sat Sep 04 1999 - 07:55:56 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US