This is a discussion on Connecting Database using PERL within the Perl forums, part of the Software Development category; Hi, Can someone tell me how to connect MYSQL and ORACLE Databases using PERL?...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| hi murali, MySql: (its very similar to php mysql function) //#-- Connection $db = Mysql->connect($host, $database, $user, $password); link for your ref: Perl and MySQL - Connect MySQL with Perl Oracle: #!/opt/products/bin//perl # This path may be different, it is platform dependent. # use DBI; #--------------------------------------------------------------------------- #-- change user name, password, table name, column names #--------------------------------------------------------------------------- $dbname = 'dbi:Oracle:desy'; $dbuser = 'scott'; $pass = 'tiger'; $table = 'emp'; $columns = 'empno,ename'; # #--------------------------------------------------------------------------- # # connect to the database $dbh = DBI->connect($dbname, $dbuser, $pass) or die "Cant connect to : $DBI::errstr\n"; # select entries in the database $sth = $dbh->prepare(qq{select $columns from $table}); # execute the select statement $sth->execute; while (@row = $sth->fetchrow_array) { print "@row\n"; } # end the reading of results $sth->finish; # disconnect from the database $dbh->disconnect; # that's all exit; link for your ref: Oracle interfaces, Perl DBI TSG: Using Oracle from Perl |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Connecting Database using Javascript | oxygen | HTML, CSS and Javascript Coding Techniques | 2 | 02-04-2008 12:17 AM |
| types of object while connecting with mysql | venkatbi | PHP Programming | 0 | 11-22-2007 04:51 AM |
| Any idea about Connecting Windows Mobile to Wireless HID devices? | itbarota | Windows Mobile | 0 | 07-23-2007 06:12 AM |
| How to set Perl Interpreter within perl script | sivaramakrishnan | Perl | 1 | 07-19-2007 05:45 AM |
| connecting database | nssukumar | Flash Actionscript Programming | 1 | 04-24-2007 10:14 PM |