Re: [Q] Using Oraperl to INSERT data

From: Mike Prettejohn <mhp_at_lambda.demon.co.uk>
Date: Mon, 6 Dec 1993 18:46:15 +0000
Message-ID: <755203575snz_at_lambda.demon.co.uk>


In article <1993Dec6.041731.19012_at_ml.csiro.au> ryba_at_ml.csiro.au writes:

>Dear Fellow Netters,
>
>I am trying to load data into an Oracle table using Oraperl.
>It goes like this:
>
> ...
>
> # open cursor
> $csr = &ora_open(lda, "insert into phonelist values (:1, :2)");
> # insert data
> &ora_bind($csr, "Anette", "5336");
> &ora_bind($csr, "Brigitte", "6258");
> ...
> ...
>
>It works fine as long as none of the data items is NULL,
>i.e.:
>
> &ora_bind($csr, "Tom", "");
>
>results in: ORA-01722: invalid number ...
>
>Assuming that it is OK to have null telephone numbers, how should it be done?
>Any advice gratly appreciated.

Shouldn't you use 'undef' instead of "", vis.

    &ora_bind($csr,"Tom",undef);

>
>Miroslaw
>
>_________________________________________________________________
>Miroslaw Ryba _--_|\ ryba_at_ml.csiro.au
>CSIRO Marine Laboratories / \ tel +61 02 325 336
>PO Box 1538 Hobart 7001 \_.--._/ fax +61 02 325 000
>Australia v
>
>
 

-- 
Received on Mon Dec 06 1993 - 19:46:15 CET

Original text of this message