>As a side note, why wouldn't invalid syntax cause the create function 
>statement to error?

you can use both AS and IS, it doesn't seem to have any effect (at least
in SQL*Plus):

SQL*Plus: Release 9.2.0.1.0 - Production on Fri Feb 4 16:25:07 2005

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.


Connected to:
Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.4.0 - Production

SQL> CREATE OR REPLACE FUNCTION c_to_f (in_c NUMBER)
  2     RETURN NUMBER
  3  IS
  4     out_f   NUMBER;
  5  BEGIN
  6     out_f := (in_c * 9 / 5) + 32;
  7     RETURN out_f;
  8  END c_to_f;
  9  /

Function created.

SQL> SELECT SUBSTR (object_name, 1, 25), object_type, status
  2    FROM user_objects
  3   WHERE object_name = 'C_TO_F';

SUBSTR(OBJECT_NAME,1,25)  OBJECT_TYPE        STATUS
------------------------- ------------------ -------
C_TO_F                    FUNCTION           VALID

SQL> DROP  FUNCTION c_to_f;

Function dropped.

SQL> CREATE OR REPLACE FUNCTION c_to_f (in_c NUMBER)
  2     RETURN NUMBER
  3  AS
  4     out_f   NUMBER;
  5  BEGIN
  6     out_f := (in_c * 9 / 5) + 32;
  7     RETURN out_f;
  8  END c_to_f;
  9  /

Function created.

SQL> SELECT SUBSTR (object_name, 1, 25), object_type, status
  2    FROM user_objects
  3   WHERE object_name = 'C_TO_F';

SUBSTR(OBJECT_NAME,1,25)  OBJECT_TYPE        STATUS
------------------------- ------------------ -------
C_TO_F                    FUNCTION           VALID

SQL>


>-----Original Message-----
>From: Rick Root [mailto:[EMAIL PROTECTED] 
>Sent: Friday, February 04, 2005 4:08 PM
>To: CF-Talk
>Subject: Re: Creating Oracle Functions in CFQUERY revisited
>
>James Holmes wrote:
>> You stil have AS in the Year Fn
>> 
>> RETURN NUMBER AS BEGIN
>> 
>> Should be IS 
>
>Changed, still getting the same error.
>
>As a side note, why wouldn't invalid syntax cause the create function 
>statement to error?
>
>  - Rick
>
>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:193086
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to