>-----Original Message-----
>From: Sid Katz [mailto:[EMAIL PROTECTED] 
>Sent: Tuesday, August 02, 2005 12:14 PM
>I am converting oraperl statments to the new Perl-DBI format and do
>not entirely understand the Perl-DBI syntax.  I have included code
>with the oraperl method and what I think is the correct Perl-DBI
method.
>My 2 questions are:
>#  is $INSERT correct as written or should it be ...values ( ?, ?, ?,
...) ? 
   I've never used oraperl and am no expert in DBI DBD but my code uses
?
   and works.  Although I usually specify the column names and values to

   insulate myself from changes to the table structure. 
   IE.  INSERT INTO table (column name1, column name2, etc)
          VALUES (?,?,etc); 
>#  is the insert request $csrd->execute... correct as written ?
   Yes, that's how I code it. 
   HTH, Paula
-------------- PERL CODE ----------------------------------
<snip>
#   insert command using oraperl....

  $INSERT = "insert into $TABLE values (:1, :2, :3, :4, :5, :6, :7, :8,
" ;
  $INSERT = $INSERT.":9, :10, :11, :12, :13)" ;
  $csrd   = &ora_open($lda, $INSERT) || die "$ora_errstr\n" ;

#   new insert command using perl-dbi

  my $csrd = $lda->prepare( qw{$INSERT}) ||"Can't prepare stmt:
$DBI::errstr\n" ;

 <snip> 

#   try insert operation using oraperl
     &ora_bind($csrd,$obsdate,$id,$obstime,$elemcod,$val,$rv,$dur,
               $tc,$sc,$ec,$org,'0',$qual) ;

#   try insert operation using perl-dbi
$csrd->execute($obsdate,$id,$obstime,$elemcod,$val,$rv,$dur,$tc,$sc,$ec,
$org,'0',$qual) 
;

Reply via email to