From j.hatzistavrou@telesoft.gr Mon, 17 Sep 2001 23:35:37 -0700 From: Hatzistavrou Giannis Date: Mon, 17 Sep 2001 23:35:37 -0700 Subject: RE: Perl code example Message-ID: MIME-Version: 1.0 Content-Type: text/plain A good solution might be to read the eviromental parameters of the UNIX session. In there you can set the SID and username/password. >From within the Perl code then do: $data_source="dbi:Oracle:" . $ENV{}; $dbbscs = DBI->connect($data_source,$ENV{},$ENV{); $sqlstmt_tmcode = "select ... from ..."; $stmt_tmcode = $dbbscs->prepare($sqlstmt_tmcode) || die "Couldn't prepare the tmcode statement!\n"; $stmt_tmcode->execute || die "Couldn't execute the tmcode statement!\n"; Regards, Hatzistavrou Yannis > -----Original Message----- > From: Hagedorn, Linda [SMTP:lindah@epocrates.com] > Sent: Tuesday, September 18, 2001 01:00 > To: Multiple recipients of list ORACLE-L > Subject: Perl code example > > Hello, > > I'm looking for a Perl example passing parameters. > > The code below has the userids and passwords hardcoded in clear text in > the system line, parms 3 and 5 (five lines from the bottom), and the > Oracle sid is hardcoded also. The code has to be changed to 1) read .pwd1 > and .pwd2 files containing the passwords, and set a literal for the SID > and substitute it at in the code. > > I'm not a Perl coder, and would appreciate any information, hints, or > links to the manual. > > Thanks, Linda > > > > #!/usr/local/bin/perl > # > use CGI qw(:standard); > # > $| = 1; > ($sec,$min,$hour,$mday,$mmonth,$myear,$wday,$yday,$isdst) = > localtime(time); > if ($myear < 99) { > $myear++; > } > $myear += 1900; > $mmonth += 1; > print header; > if (!param()) { > print start_html('dev02 QRX4 DB Refresh'), > h1('
dev02 QRX4 DB Refresh for Formulary qRx Version 4.0'), > > hr, > "
", > "Enter a date to start the Oracle database refresh script,
", > "then hit Submit to kick off the refresh for that > date.

", > start_form, > "Enter the target refresh date: ", > textfield('day',$mday,2), > textfield('month',$mmonth,2), > textfield('year',$myear,4), > p, submit('Submit'), > end_form, > hr; > } else { > # print "You entered :

"; > $dy = param('day'); > $mo = param('month'); > $yr = param('year'); > print "You are transferring all data modified on or after ", $dy, "-", > $mo,"-", $yr, " to update"; > print "\n"; > print "QRX4: Starting script with > /opt/oracle/scripts/staging/cerebellum/refresh.sh $dy-$mo-$yr\n"; > print " 2.pl>>Return to previous page",hr; > > print "

"; 
>     system "/opt/oracle/scripts/staging/refresh.sh gui4 pwd1 qrx4 pwd2
> $dy-$mo-$yr dev02"; 
>     print "

"; > print " 2.pl>>Return to previous page",hr; > > print end_html; > } > > -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Hatzistavrou Giannis INET: j.hatzistavrou@telesoft.gr Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru@fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).