<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2838" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=009085316-13032006><FONT face="Courier New" 
size=2>Hi,</FONT></SPAN></DIV>
<DIV><SPAN class=009085316-13032006><FONT face="Courier New" 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=009085316-13032006><FONT face="Courier New" size=2>Not sure if 
this question is appropriate for this group, but here it is.</FONT></SPAN></DIV>
<DIV><SPAN class=009085316-13032006><FONT face="Courier New" 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=009085316-13032006><FONT face="Courier New" size=2>I am using 
PERL DBI to&nbsp;SELECTing all columns from a table on Neteeza database and am 
INSERTing into an existing table on Oracle.&nbsp; However, some of the columns 
are character based so they require ("") quotes around the column data to 
insert.&nbsp; I need to dynamically built the INSERT values.&nbsp; Is there an 
easy way to quote the column data for the INSERT statement.&nbsp; Here are some 
examples what I am trying to do:</FONT></SPAN></DIV>
<DIV><SPAN class=009085316-13032006><FONT face="Courier New" 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=009085316-13032006><FONT face="Courier New" 
size=2>&nbsp;&nbsp;&nbsp; $d_sth = $d_dbh-&gt;prepare("select column_name, 
data_type<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
from&nbsp;&nbsp; 
all_tab_columns<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
where&nbsp; table_name like 
upper('%$d_tblName%')<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
") || die "$DBI::errstr\n";</FONT></SPAN></DIV>
<DIV><SPAN class=009085316-13032006><FONT face="Courier New" 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=009085316-13032006><FONT face="Courier New" 
size=2>&nbsp;&nbsp;&nbsp; $d_sth-&gt;execute() || die 
"$DBI::errstr\n";<BR>&nbsp;&nbsp;&nbsp; while ( $d_arrayref = 
$d_sth-&gt;fetchrow_arrayref() ) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ( 
@$d_arrayref[1] =~ /CHAR|DATE/ ) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
$columnsToAssign{ @$_arrayref[0] } = 
"0";<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</FONT></SPAN></DIV>
<DIV><SPAN class=009085316-13032006><FONT face="Courier New" 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=009085316-13032006><FONT face="Courier New" 
size=2>&nbsp;&nbsp;&nbsp; $s_sth = $s_dbh-&gt;prepare("select * from 
$s_tblName") || die "$DBI::errstr\n";<BR>&nbsp;&nbsp;&nbsp; $s_sth-&gt;execute() 
|| die "$DBI::errstr\n";<BR>&nbsp;&nbsp;&nbsp; while ( $s_hashref = 
$s_sth-&gt;fetchrow_hashref ) {</FONT></SPAN></DIV>
<DIV><SPAN class=009085316-13032006><FONT face="Courier New" 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=009085316-13032006><FONT face="Courier New" 
size=2>&nbsp;Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
Null?&nbsp;&nbsp;&nbsp; Type<BR>&nbsp;----------------------------------------- 
-------- 
----------------------------<BR>&nbsp;DLVRB_GID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
NOT NULL 
NUMBER(10)<BR>&nbsp;PRC_REL_GID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
NOT NULL 
NUMBER(10)<BR>&nbsp;PRDCT_GID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
NOT NULL 
NUMBER(10)<BR>&nbsp;BIL_PYMT_TYP_CDE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
NOT NULL 
CHAR(1)<BR>&nbsp;PRJTD_TRX_CNT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
NOT NULL NUMBER(10)</FONT></SPAN></DIV>
<DIV><SPAN class=009085316-13032006><FONT face="Courier New" 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=009085316-13032006><FONT face="Courier New" size=2>The column 
above (BIL_PYMT_TYP_CDE) require quotes for the INSERT statement.&nbsp; I would 
like to dynamically create the INSERT statements like so:</FONT></SPAN></DIV>
<DIV><SPAN class=009085316-13032006><FONT face="Courier New" 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=009085316-13032006><FONT face="Courier New" 
size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $columnsToAssign = 
$columnsToAssign . ", \"" . @$d_arrayref[0] . 
"\"";<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else 
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $columnsToAssign = 
$columnsToAssign . ", " . 
@$d_arrayref[0];<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
}</FONT></SPAN></DIV>
<DIV><SPAN class=009085316-13032006><FONT face="Courier New" size=2>Is there an 
easier way?</FONT></SPAN></DIV>
<DIV><SPAN class=009085316-13032006><FONT face="Courier New" 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=009085316-13032006><FONT face="Courier New" 
size=2>Thanks.</FONT></SPAN></DIV>
<DIV align=left><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV align=left><FONT face="Courier New" size=2>Peter Loo</FONT></DIV>
<DIV align=left>&nbsp;</DIV>
<DIV>&nbsp;</DIV><p></p><p>This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information.  Any unauthorized review, use, disclosure or distribution is prohibited.  If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message.</BODY></HTML>