PERL   42

table cgi

Guest on 1st July 2022 07:37:50 PM

  1. #!/opt/bin/perl -w
  2.  
  3. # Creates a table called appointment.
  4. # The appointment table has time of the
  5. # appointment and the chores as fields.
  6. # This program only requires to run once
  7.  
  8. use strict;
  9.  
  10. use DBI;
  11.  
  12. $ENV{"ORACLE_HOME"} = '/opt/oracle/9.0.1';
  13.  
  14. my $dbh = DBI->connect("dbi:Oracle:TRCH", "usrname", "passwrd")
  15.   or die "Connecting: $DBI::errstr";
  16. my $sth = $dbh->prepare(qq'
  17.     CREATE TABLE appointment
  18.     (appTime CHAR(255),
  19.      chore CHAR(255))')
  20.       or die "Cannot prepare: " . $dbh->errstr( );
  21. $sth->execute( ) or die "Cannot execute: " . $sth->errstr( );
  22. $sth->finish( );
  23. $dbh->disconnect( );

Raw Paste


Login or Register to edit or fork this paste. It's free.