I am coding shell script.
I need to connect to different databases like DB2, Oracle and Sybase.
I would then need to query tables where it has all the groups, users for that database.
I would also need who has what kind of permissions.
EG: I know for DB2 some TABAUTH table needs to be... (0 Replies)
hello
how to run shell script to excute oracle queries on remote db ?
i have tried as following
sqlplus -s user/password@remote_server "select query;"
but not working
also this one
sqlplus -s user/password@remote_server `select query;`
not working :(
i add this line to run another... (4 Replies)
Hi, unix gurnis
I need help for following requirement for writing a shell scritp.
log in to oracle database, query one table total records (select count(*) from table1), pass the return value to a file.
Thanks in advance (2 Replies)
hi Guys,
i have a problem with oracle query in my unix script..
I'm getting the following error while executing..
./logtab.sh: sqlplus -s "pmutv/pmutv1" << EOFSQL^Jset head off^Jinsert into... (2 Replies)
Hi,
I need to query Oracle database for 100 users. I have these 100 users in a file. I need a shell script which would read this User file (one user at a time) & query database.
For instance:
USER CITY
--------- ----------
A CITY_A
B CITY_B
C ... (2 Replies)
Hello everyone,
I have a RHEL 5 system and have been trying to get a batch of 3-4 scripts each in a separate variables and they are not working as expected.
I tried using following syntax which I saw a lot of people on this site use and should really work, though for some reason it doesn't... (3 Replies)
I need to run a SQL select query in Oracle database and have to capture the list of retrieved records in shell script. Also i would like to modify the query for certain condition and need to fetch it again. How can i do this?
Is there a way to have a persistent connection to oracle database... (9 Replies)
Hi,
I need a shell script, which would search the result values from another files.
1)execute " select column1 from table_name" query on the table.
2)Based on the result, need to be grep from .wft files.
could please explain about this.Below is the way i am using.
#!/bin/sh... (4 Replies)
Hi,
Im new to DB2.
I need to connect to DB2 from shell script and return the query output back to shell script variable.
this is my code
#!/bin/ksh
db_name=db
db_user=usr
db_pwd=pwd
db2 <<EOSQL
connect to $db_name user $db_user using "$db_pwd"
select count(1) from table
quit
EOSQL ... (3 Replies)
What I have:
I have a input.sh (script which basically connect to mysql-db and query's multiple tables to write back the output to output1.out file in a directory)
note: I need to pass an integer (unique_id = anything b/w 1- 1000) next to the script everytime I run the script which generates... (3 Replies)
Discussion started by: kkpand
3 Replies
LEARN ABOUT DEBIAN
sql::translator::producer::oracle
SQL::Translator::Producer::Oracle(3pm) User Contributed Perl Documentation SQL::Translator::Producer::Oracle(3pm)NAME
SQL::Translator::Producer::Oracle - Oracle SQL producer
SYNOPSIS
use SQL::Translator;
my $t = SQL::Translator->new( parser => '...', producer => 'Oracle' );
print $translator->translate( $file );
DESCRIPTION
Creates an SQL DDL suitable for Oracle.
producer_args
delay_constraints
This option remove the primary key and other key constraints from the CREATE TABLE statement and adds ALTER TABLEs at the end with it.
quote_field_names
Controls whether quotes are being used around column names in generated DDL.
quote_table_names
Controls whether quotes are being used around table, sequence and trigger names in generated DDL.
NOTES
Autoincremental primary keys
This producer uses sequences and triggers to autoincrement primary key columns, if necessary. SQLPlus and DBI expect a slightly different
syntax of CREATE TRIGGER statement. You might have noticed that this producer returns a scalar containing all statements concatenated by
newlines or an array of single statements depending on the context (scalar, array) it has been called in.
SQLPlus expects following trigger syntax:
CREATE OR REPLACE TRIGGER ai_person_id
BEFORE INSERT ON person
FOR EACH ROW WHEN (
new.id IS NULL OR new.id = 0
)
BEGIN
SELECT sq_person_id.nextval
INTO :new.id
FROM dual;
END;
/
Whereas if you want to create the same trigger using "do" in DBI, you need to omit the last slash:
my $dbh = DBI->connect('dbi:Oracle:mysid', 'scott', 'tiger');
$dbh->do("
CREATE OR REPLACE TRIGGER ai_person_id
BEFORE INSERT ON person
FOR EACH ROW WHEN (
new.id IS NULL OR new.id = 0
)
BEGIN
SELECT sq_person_id.nextval
INTO :new.id
FROM dual;
END;
");
If you call this producer in array context, we expect you want to process the returned array of statements using DBI like "deploy" in
DBIx::Class::Schema does.
To get this working we removed the slash in those statements in version 0.09002 of SQL::Translator when called in array context. In scalar
context the slash will be still there to ensure compatibility with SQLPlus.
CREDITS
Mad props to Tim Bunce for much of the logic stolen from his "mysql2ora" script.
AUTHORS
Ken Youens-Clark <kclark@cpan.org>, Alexander Hartmaier <abraxxa@cpan.org>, Fabien Wernli <faxmodem@cpan.org>.
SEE ALSO
SQL::Translator, DDL::Oracle, mysql2ora.
perl v5.14.2 2012-01-18 SQL::Translator::Producer::Oracle(3pm)