And, as pointed out, you should be using bind variables (see bind_param) for 
this type of operation.

For instance, given a valid connect to Oracle:

$sth_o = $dbh_ora->qq{
  select col1, col2, col3
  from table1
  where col4=:val
}) || die $dbh_ora->errstr;

while(<some condition>)
{
  $sth_o->bind_param(':val', 1);
  $sth_o->execute;
  while (my $row = $sth_o->fetchrow_hashref)
  {
     # do something with the data
  }
}

I cannot speak to DB2, but I am very sure you should be using bind_parameters 
there also.

-----------------
Ron Reidy
Lead DBA
Array BioPharma, Inc.


-----Original Message-----
From: Vamsi_Doddapaneni [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 14, 2005 8:27 AM
To: Thutika, Srinivas (ODC - Satyam)
Cc: [email protected]
Subject: RE: how to get datatype of columns of a table in perl script
Importance: High


Hi ,

Thanks for replying.

My problem is, the perl script successfully gets rows from oracle database
but I have to insert it into similar table in db2 i.e( x in oracle -> x in
db2) . For this I need to know the datatypes of columns (varchar, char,date
,timestamp) as these need quotes for insertion.

Hope you got my problem  

Thanks & Regards
Vamsi

-----Original Message-----
From: Thutika, Srinivas (ODC - Satyam) [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 14, 2005 7:48 PM
To: Vamsi_Doddapaneni
Subject: RE: how to get datatype of columns of a table in perl script

Hi ,


I have worked in perl ..for database...

I can help u in getting the values from databse..

But I have to explore for getting the type of data...


Regares,
Srinivas.

-----Original Message-----
From: Vamsi_Doddapaneni [mailto:[EMAIL PROTECTED] 
Sent: Thursday, April 14, 2005 7:39 PM
To: [email protected]
Subject: how to get datatype of columns of a table in perl script
Importance: High


Hi all

I am new to perl just (1 1/2 month experience.). I am developing perl script
which connects to oracle database and selects rows from a (x) table and then
inserts them into its corresponding table in db2. So, while inserting i need
to find what is the datatype of columns , since we need to use quotes for
varchar,date etc.....

 

Could anybody help me out to find an approach .

 

Thanks in advance

 

 

Regards

Vamsi

************************************************************************** 
This email (including any attachments) is intended for the sole use of the
intended recipient/s and may contain material that is CONFIDENTIAL AND
PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or
distribution or forwarding of any or all of the contents in this message is
STRICTLY PROHIBITED. If you are not the intended recipient, please contact
the sender by email and delete all copies; your cooperation in this regard
is appreciated.
**************************************************************************
--------------------------------------------------------

If you are not an intended recipient of this e-mail, please notify the
sender, delete it and do not read, act upon, print, disclose, copy, retain
or redistribute it. Click here for important additional terms relating to
this e-mail.     http://www.ml.com/email_terms/
--------------------------------------------------------
************************************************************************** 
This email (including any attachments) is intended for the sole use of the
intended recipient/s and may contain material that is CONFIDENTIAL AND
PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or
distribution or forwarding of any or all of the contents in this message is
STRICTLY PROHIBITED. If you are not the intended recipient, please contact
the sender by email and delete all copies; your cooperation in this regard
is appreciated.
**************************************************************************

This electronic message transmission is a PRIVATE communication which contains
information which may be confidential or privileged. The information is 
intended 
to be for the use of the individual or entity named above. If you are not the 
intended recipient, please be aware that any disclosure, copying, distribution 
or use of the contents of this information is prohibited. Please notify the
sender  of the delivery error by replying to this message, or notify us by
telephone (877-633-2436, ext. 0), and then delete it from your system.

Reply via email to