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

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

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

 



yorozen
New User

Nov 18, 2009, 12:15 AM

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

Hi,

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;
END
"`;
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
setenv ORACLE_SID DB
sqlplus /
set linesize 100
select table_Name,partition_Name,last_analyzed from dba_partitions where table_owner='DB_OWNER';



Kindly assist


FishMonger
Veteran / Moderator

Nov 18, 2009, 5:49 AM

Post #2 of 2 (634 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