CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Beginner:
SQL command in perl


New User

Nov 18, 2009, 12:15 AM

Post #1 of 2 (761 views)
SQL command in perl Can't Post


I am using the following script to grab information from a DB:

#!/usr/bin/perlmy $command; # var for returned information
$command = `su - oracle -c "sqlplus -s user/password\@db<<END
set feedback off
set echo off
select count(*) from David;
print "Count from David";
print $command;

I can't use any DBI , since we don't have it in my organization

I have a problem that i can't perform the followed in script (can't login with sqlplus /)

su - oracle
sqlplus /
set linesize 100
select table_Name,partition_Name,last_analyzed from dba_partitions where table_owner='DB_OWNER';

Kindly assist

Veteran / Moderator

Nov 18, 2009, 5:49 AM

Post #2 of 2 (757 views)
Re: [yorozen] SQL command in perl [In reply to] Can't Post

I haven't worked with an Oracle database, so I may not be of much help, but I'll try.

First, does your sqlplus command work as expected when ran from the command line exactly the way it is in your backticks statement?

If not, then you first need to get that working or use a different approach in the script.

Have you tried talking with the sys admins to have them install DBI and DBD::Oracle? If so, what is there reason for not installing the modules?


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives