Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Here is the module that I createdmy $q = new CGI; my($surname, $givenName); $ENV{REMOTE_USER} = $q->param('Login_Name'); my $room = $q->param('Room'); my $sth; my $table = SQL->new(); my $dbh= DBI->connect("dbi:Oracle:", "scott", "tiger") or die $DBI::er +rstr; if (!($dbh->selectrow_array("select * from user_tables where table_nam +e = '$table->{name}'"))){ $sth= $dbh->prepare($table->create) or die $dbh->errstr; $sth->execute or die $sth->errstr; } $sth = $dbh->prepare(q/INSERT INTO SignIn(cn, time, cdate, room) VALUE +S (?,?,?,?)/) or die $dbh->errstr; $sth->execute($ENV{REMOTE_USER}, $foo, $foo, $room); print <<ENDOFHTML $ENV{REMOTE_USER}, $time, $date, $room Content-type:text/html\n\n <html> <body> <SCRIPT language="JavaScript"> alert("$givenName $surname you have signed in successfully on $fullDat +e. Thank you and enjoy Computers 101.") </SCRIPT> </body> </html> ENDOFHTML
Thanks for any helppackage SQL; sub new{ my $self = {}; $self->{name}='SIGNIN'; bless $self; return $self; } sub create{ my $self = shift; $self->{create} = "create table SignIn (cn varchar2(64), time varc +har2(10), cdate varchar2(20), room varchar2(20))"; return $self->{create}; } sub index{ my $self = shift; $self->{index} = "create index CNIndex on self->{name}(cn)"; return $self->{index}; } 1;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: connect to Oracle through CGI
by OM_Zen (Scribe) on Jan 03, 2003 at 18:47 UTC | |
|
Re: connect to Oracle through CGI
by Jaap (Curate) on Jan 03, 2003 at 18:37 UTC | |
by Anonymous Monk on Jan 03, 2003 at 18:45 UTC | |
by thewalledcity (Friar) on Jan 03, 2003 at 18:59 UTC | |
by Anonymous Monk on Jan 03, 2003 at 19:07 UTC | |
by OM_Zen (Scribe) on Jan 03, 2003 at 19:59 UTC | |
by OM_Zen (Scribe) on Jan 03, 2003 at 20:01 UTC |