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

Home -> Community -> Mailing Lists -> Oracle-L -> Problem Creating Java Source

Problem Creating Java Source

From: Mark Burgess <mburgess_nz_at_yahoo.co.nz>
Date: Mon, 15 Dec 2003 13:24:41 -0800
Message-ID: <F001.005D9F97.20031215132441@fatcity.com>


Hi,

im currently running the following code inside a sql script:

.

CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED "TimeZoneConvert"

    AS public class TimeZoneConvert
{
  public static int get_utc_offset (String p_tz)   {
    java.util.TimeZone tz =
java.util.TimeZone.getTimeZone(p_tz);

    int i = tz.getRawOffset();
    return i;
  }
   public static String get_ds_tz_flag (String p_tz)   {
    java.util.Date now = new java.util.Date();     java.util.TimeZone tz =
java.util.TimeZone.getTimeZone(p_tz);

    if (tz.inDaylightTime(now))
    {
      return "TRUE";
    }
    else
    {
      return "FALSE";
    }
  }
}
/

.

When running this through SQL*Plus the script is failing with the following error:

Oracle8i Enterprise Edition Release 8.1.7.3.0 - Production
With the Partitioning option
JServer Release 8.1.7.3.0 - Production

CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED "TimeZoneConvert"

                                                *
ERROR at line 1:
ORA-29536: badly formed source: Encountered "<EOF>" at line 5, column 78.

.

It seems that SQL*Plus is reading the ';' as the completion of the statement. If I load this code into the SQL*Plus buffer and then execute the java source is loaded successfully. Is there something I am missing here as I would expect to be able to run this from within a script however the ';' seems to be causing a conflict with SQL*Plus. Has anyone seen anything similar before? I would have thought this to be an issue with PLSQL scripts as well however I dont have this same problem. This is running from within an Oracle Apps 11i environment and the sqlplus version is 8.0 against 8.1.7.3 on HP-UX 11.

Regards,

Mark

http://personals.yahoo.com.au - Yahoo! Personals New people, new possibilities. FREE for a limited time.

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: =?iso-8859-1?q?Mark=20Burgess?=
  INET: mburgess_nz_at_yahoo.co.nz

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Mon Dec 15 2003 - 15:24:41 CST

Original text of this message

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