Return-Path: <oracle-l-bounce@freelists.org>
Delivered-To: 2-oracle-l@orafaq.com
Received: (qmail 21324 invoked from network); 12 Dec 2007 11:33:55 -0600
Received: from freelists-180.iquest.net (HELO turing.freelists.org) (206.53.239.180)
  by static-ip-69-64-49-119.inaddr.intergenia.de with SMTP; 12 Dec 2007 11:33:55 -0600
Received: from localhost (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 451F67D7C1C;
 Wed, 12 Dec 2007 12:33:56 -0500 (EST)
Received: from turing.freelists.org ([127.0.0.1])
 by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 31382-09; Wed, 12 Dec 2007 12:33:56 -0500 (EST)
Received: from turing (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id A775C7D7A2F;
 Wed, 12 Dec 2007 12:33:55 -0500 (EST)
Received: with ECARTIS (v1.0.0; list oracle-l); Wed, 12 Dec 2007 12:31:47 -0500 (EST)
Received: from localhost (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 2D10C7D7685
 for <oracle-l@freelists.org>; Wed, 12 Dec 2007 12:31:47 -0500 (EST)
Received: from turing.freelists.org ([127.0.0.1])
 by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 31034-08 for <oracle-l@freelists.org>;
 Wed, 12 Dec 2007 12:31:47 -0500 (EST)
Received: from outbound9-sin-R.bigfish.com (outbound-sin.frontbridge.com [207.46.51.80])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 757247D7536
 for <oracle-l@freelists.org>; Wed, 12 Dec 2007 12:31:46 -0500 (EST)
Received: from outbound9-sin.bigfish.com (localhost.localdomain [127.0.0.1])
 by outbound9-sin-R.bigfish.com (Postfix) with ESMTP id A8609112EE46
 for <oracle-l@freelists.org>; Wed, 12 Dec 2007 17:30:42 +0000 (UTC)
Received: from mail127-sin-R.bigfish.com (unknown [10.3.40.3])
 by outbound9-sin.bigfish.com (Postfix) with ESMTP id A6DB844004C
 for <oracle-l@freelists.org>; Wed, 12 Dec 2007 17:30:42 +0000 (UTC)
Received: from mail127-sin (localhost.localdomain [127.0.0.1])
 by mail127-sin-R.bigfish.com (Postfix) with ESMTP id 353DF1A781A8
 for <oracle-l@freelists.org>; Wed, 12 Dec 2007 17:30:53 +0000 (UTC)
X-BigFish: VP
X-MS-Exchange-Organization-Antispam-Report: OrigIP: 12.23.96.194;Service: EHS
Received: by mail127-sin (MessageSwitch) id 1197480647784430_7028; Wed, 12 Dec 2007 17:30:47 +0000 (UCT)
Received: from earthquake.ICAT.COM (earthquake.icat.com [12.23.96.194])
 by mail127-sin.bigfish.com (Postfix) with ESMTP id 6EB3F9F0006
 for <oracle-l@freelists.org>; Wed, 12 Dec 2007 17:30:45 +0000 (UTC)
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.2992
Content-Class: urn:content-classes:message
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 8bit
X-MIME-Autoconverted: from quoted-printable to 8bit by Ecartis
Subject: RE: Pl/sql bulk collect problem
Date: Wed, 12 Dec 2007 10:31:30 -0700
Priority: normal
Message-ID: <E323160E08E560459CD05A883546C3CE0B134715@earthquake.ICAT.COM>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: Pl/sql bulk collect problem
From: "Sweetser, Joe" <JSweetser@icat.com>
To: "Sweetser, Joe" <JSweetser@icat.com>,
 <oracle-l@freelists.org>
X-archive-position: 3882
X-ecartis-version: Ecartis v1.0.0
Sender: oracle-l-bounce@freelists.org
Errors-to: oracle-l-bounce@freelists.org
X-original-sender: JSweetser@icat.com
Precedence: normal
Reply-to: JSweetser@icat.com
List-help: <mailto:ecartis@freelists.org?Subject=help>
List-unsubscribe: <oracle-l-request@freelists.org?Subject=unsubscribe>
List-software: Ecartis version 1.0.0
List-Id: oracle-l <oracle-l.freelists.org>
X-List-ID: oracle-l <oracle-l.freelists.org>
List-subscribe: <oracle-l-request@freelists.org?Subject=subscribe>
List-owner: <mailto:steve.adams@ixora.com.au>
List-post: <mailto:oracle-l@freelists.org>
List-archive: <http://www.freelists.org/archives/oracle-l>
X-list: oracle-l
X-Virus-Scanned: Debian amavisd-new at localhost.localdomain

Omitted data:

Oracle 9i on RH
The id_building data is NOT sequential and there ARE gaps in it. 

-----Original Message-----

Disclaimer: I am not anything even close to a programmer.

But I am playing around with FORALL and BULK COLLECT.  I am trying to
convert character values to numeric ones and then update a table with
the numeric values.  The character data can have up to 10 digits to the
right of the decimal point so I am trying to convert that to a number
and round it to 6 digits of accuracy.  There are also some NULL values
in those character fields.

I have a table that has (among others) these columns defined:

desc risksr
ID_BUILDING    NUMBER(10)
<snip>
LOCLATITUDE    VARCHAR2(25)
LOCLONGITUDE   VARCHAR2(25)
<snip>

I have the following declarations in my pl/sql code:

TYPE id_type IS TABLE OF NUMBER INDEX BY PLS_INTEGER; TYPE lat_type IS
TABLE OF NUMBER(10,6) INDEX BY PLS_INTEGER; TYPE long_type IS TABLE OF
NUMBER(10,6) INDEX BY PLS_INTEGER; b_id_data id_type; b_lat_data
lat_type; b_long_data long_type;

And my select statement is:
    SELECT id_building,
           NVL(ROUND(TO_NUMBER(loclatitude), 6), 99999),
           NVL(ROUND(TO_NUMBER(loclongitude), 6), 99999)
    BULK COLLECT INTO b_id_data, b_lat_data, b_long_data
    FROM risksr;

When I try to run this, I get:

DECLARE
*
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error: Bulk bind: Error in define
ORA-06512: at line 102

102 is the line where my select statement is.  I've been OTN'ing,
Metalink'ing and google'ing with no luck on this error.

Is it wrong to try and convert the data during a BULK COLLECT operation?
Any other ideas/pointers/suggestions welcome as well.

Thanks,
-joe
 
Confidentiality Note: This message contains information that may be confidential and/or privileged. If you are not the intended recipient, you should not use, copy, disclose, distribute or take any action based on this message. If you have received this message in error, please advise the sender immediately by reply email and delete this message. Although ICAT Managers, LLC scans e-mail and attachments for viruses, it does not guarantee that either are virus-free and accepts no liability for any damage sustained as a result of viruses.  Thank you.

--
http://www.freelists.org/webpage/oracle-l


