To: DBI-Users,
 
I am having a problem with the standard $sth->prepare, $sth-execute 
sequence
for non-SELECT statements ever since we upgraded from an HP-UX
system to SunOS system.
 
                                    HP-UX 10.20        SunOS 5.8
Oracle.pm                    0.47                        1.06
DBI.pm                       0.93                         1.14
DBD.pm                     1.9                            10.8
Perl                             5.00502                    5.6.0
Oracle                         7.3.4                         8i
 
Heres the scenario, 
 
I have a table that I update using a $sth->prepare, $sth-execute 
sequence. 
On the HP configuration, described above, it works flawlessly, however, 
on 
the Sun box it is giving an error.

desc contact_mech_tcm
 Name                                                      
Null?                           Type
 ----------------------------------------- -------- 
----------------------------
 CONTACT_MECHANISM_ID             NOT NULL               NUMBER
 
CONTACT_COUNTRY                                                         
  VARCHAR2(30)
 CONTACT_AREA_CODE                    NOT NULL               
VARCHAR2(30)
 CONTACT_NUMBER                           NOT NULL              
VARCHAR2(30)
 LAST_MODIFY_USER_ID                                                    
 VARCHAR2(20)
 LAST_MODIFY_TS                               NOT NULL              
DATE

------------------
-- CODE SNIPPET --
------------------
$upTCM = $dbh->prepare("update $SCHEMA.CONTACT_MECH_TCM
                         set CONTACT_AREA_CODE = ?,
                             CONTACT_NUMBER = ?,
                             LAST_MODIFY_USER_ID = ?,
                             LAST_MODIFY_TS = SYSDATE
                         where CONTACT_MECHANISM_ID = ?");

$rv = $upTCM->execute(' ',
        '12129999999',
        'TCM_TEST',
        1);
 
if ($DBI::err) {
        print "$DBI::errstr\n";
} 
----------------------
-- END CODE SNIPPET --
----------------------
-----------
-- HP-UX --
-----------
no error
-----------
-----------
-- SunOS --
-----------
ORA-01407: cannot update ("DIR"."CONTACT_MECH_TCM"."CONTACT_AREA_CODE") 
to NULL (DBD ERROR: OCIStmtExecute)
-----------
 
The error on the SunOS system seems to be due some component that
is trimming, and "NULL"ifying, the "blank" string value bound to the 
CONTACT_AREA_CODE column. Is this correct? 
 
How do I resolve this issue?
 
Your help is greatly appreciated.
 
Thanks,
Rikin

[EMAIL PROTECTED]
 

Reply via email to