It would be better if you asked this question in the oracle lists.

Anyhow, here's the code for a simple select script:

#!/usr/bin/perl -w
use DBI;
my $dbh = DBI->connect("dbi:Oracle:dbname", $user, $password)  || die "Can't
connect to dbname: $DBI::errstr";
my $sth = $dbh->prepare( q{
    SELECT name, phone
    FROM table
  }) || die "Can't prepare statement: $DBI::errstr";
my $rc = $sth->execute || die "Can't execute statement: $DBI::errstr";
print "Record Count: $sth->{NUM_OF_FIELDS}.\n\n";
print "$sth->{NAME}->[0]: $sth->{NAME}->[1]\n";
while (($name, $phone) = $sth->fetchrow_array) {
      print "$name: $phone\n";
}
warn $DBI::errstr if $DBI::err;  #checks for problems that may have
terminated the fetch.
$sth->finish;


Regards
Jorge

MySQL Development Team
    __  ___     ____ __   __
   /  |/  /_ __/ __/ __ \/ /   Jorge del Conde <[EMAIL PROTECTED]>
  / /|_/ / // /\ \/ /_/ / /__  MySQL AB, http://www.mysql.com/
/_/  /_/\_, /___/\___\_\____/ Mexico City, Mexico
        <___/



----- Original Message -----
From: "Javier Armendáriz" <[EMAIL PROTECTED]>
To: "MySQL" <[EMAIL PROTECTED]>
Sent: Thursday, January 11, 2001 1:48 AM
Subject: Off-topic, but database


> I know it is not the list to make this answer, but i can find good info
> anyware.
>
> I usually work with myqsl and perl, but I need to do the same with perl
and
> oracle, and i don´t know how to conect to the oracle database, make a
query
> or an insert comand and return the values of the query to perl variables.
>
> Can anybody help me with some example or a good URL about this question???
>
> Thank a lot, and sorry by the off-topic.
> ___________________________________________________
> I've seen things you people wouldn't believe.
> Attack ships on fire off the shoulder of Orion.
> I watched C-beams glitter in the darkness at Tan Hauser Gate.
> All those moments will be lost in time like tears in rain.
> Time to die.
> ===========================================
> Javier Armendáriz
> [EMAIL PROTECTED]
>
>
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to