Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: absolute newbie: perl-cgi+oracle
Hi,
Thanks for the reply. I looked on the web and when I used the following
connect string, it works now:
my $dbh =
DBI->connect('DBI:Oracle:host=localhost;sid=odb;port=1521','Nishanth','Nishanth');
cheers,
A.Nishanth
On Thu, 26 Sep 2002, Vladislav Serbin wrote:
>Hi! See below-
>
>#!/usr/bin/perl -w
>use DBI;
>use CGI;
>use CGI::Carp('fatalsToBrowser');
>print "Content-type:text/html\n\n";
>print <<EHTML;
><html>
><head>
><title>Sequence retriever</title>
></head>
><body>
>EHTML
>my $dbh =
>DBI->connect("dbi:Oracle:my_test","system",pwd,{ RaiseError => 1, AutoCommit
>=> 1 }) ||
>die("Nope. Didn't make it\n");
>my $sth = $dbh->prepare(qq{
>SELECT * FROM SYS.USER_SEQUENCES});
>$sth->execute();
>while(@data = $sth->fetchrow_array()){
>print "@data\n<br>";
>}
>$sth->finish;
>$dbh->disconnect;
>print <<EHTML;
></body>
></html>
>EHTML
>
>/* output -
>
>Content-type:text/html
>
><html>
><head>
><title>Sequence retriever</title>
></head>
><body>
>REPCAT$_FLAVORS_S 1 999999999999999999999999999 1 N N 0 1
><br>REPCAT$_REFRESH_TEMPLATES_S 1 999999999999999999999999999 1 N N 20 1
><br>REPCAT$_REPPROP_KEY 1 999999999999999999999999999 1 N N 20 1
><br>REPCAT$_RUNTIME_PARMS_S 1 999999999999999999999999999 1 N N 20 1
><br>REPCAT$_TEMPLATE_OBJECTS_S 1 999999999999999999999999999 1 N N 20 1
><br>REPCAT$_TEMPLATE_PARMS_S 1 999999999999999999999999999 1 N N 20 1
><br>REPCAT$_TEMPLATE_SITES_S 1 999999999999999999999999999 1 N N 20 1
><br>REPCAT$_TEMP_OUTPUT_S 1 999999999999999999999999999 1 N N 20 1
><br>REPCAT$_USER_AUTHORIZATIONS_S 1 999999999999999999999999999 1 N N 20 1
><br>REPCAT$_USER_PARM_VALUES_S 1 999999999999999999999999999 1 N N 20 1
><br>REPCAT_LOG_SEQUENCE 1 999999999999999999999999999 1 N N 20 1
><br></body>
></html>
>........................
>Best regards,
>Vladislav Serbin
>Oracle DBA
>
>
>
>
Received on Thu Sep 26 2002 - 09:08:46 CDT
![]() |
![]() |