10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
HI Experts,
I am pretty new to scripting and i need to create a perl or shell script which should fetch a file from local directory and insert the data into a table using sql loader. This will be later added to chron job to run daily and fetch all files and load them into
the table.
Also i... (1 Reply)
Discussion started by: sam1234
1 Replies
2. UNIX for Dummies Questions & Answers
HI Experts,
I am pretty new to scripting and i need to create a perl or shell script which should fetch a file from local directory and insert the data into a table using sql loader. This will be later added to chron job to run daily and fetch all files and load them into
the table.
Also i... (1 Reply)
Discussion started by: sam1234
1 Replies
3. UNIX for Advanced & Expert Users
I am running the xampp on WINDOWS, and my php script is connecting to a unix script on a different server (ssh2_connect("11.31.138.56", 22). I am running the unix script and inside this script I am calling the .sql file . The SQL is connecting to oracle db on the unix server.
But the sqlplus... (2 Replies)
Discussion started by: madfox
2 Replies
4. UNIX for Advanced & Expert Users
Hi Experts:
I have a shell script that's kicked off by cron. Inside this shell script, I need to kick off two or more oracle sql scripts to process different groups of tables. And when both sql scripts are done, I will continue in the shell script to do other things like checking processing... (3 Replies)
Discussion started by: huasheng8
3 Replies
5. Shell Programming and Scripting
hi,
I want to know how to call a pl sql function testfunction(param1,..) that returns a value and grab that value in a shell variable.
Thnx in advance
---------- Post updated 03-30-10 at 11:58 AM ---------- Previous update was 03-29-10 at 03:49 PM ----------
thnx a lot jim (0 Replies)
Discussion started by: austinhell3_16
0 Replies
6. Shell Programming and Scripting
HI,
I'm trying to get this right, please can you help. In my unix korn shell script, I call an oracle stored proc within a package and I specify 3 parameters, 2 of which are IN OUT parameters (i.e. I expect the stored proc to change them and return them back to me).
Does the unix code... (7 Replies)
Discussion started by: csong2
7 Replies
7. UNIX for Advanced & Expert Users
Hi All
I would be thankful to you all if you will guide me the steps to call a stored proc. from unix shell script. that stored proc. could be parameterised or parameterless developed in SQL.
Any info. in this topic would help me.....
Thanks in advance.... (1 Reply)
Discussion started by: varungupta
1 Replies
8. UNIX for Dummies Questions & Answers
Hi GURUs,
I have following queries:
1) If its possible to configure Microsoft SQL Server database on a UNIX machine, if yes, can any body pls point me to the guide to acheive the same.
2) I know Oracle runs perfectly on UNIX based machines, can any body point me to the guide to achieve the... (6 Replies)
Discussion started by: patras
6 Replies
9. Shell Programming and Scripting
who can show me how to call pl/sql function or precudure in unix script..
cheers, (6 Replies)
Discussion started by: YoYo
6 Replies
10. Shell Programming and Scripting
sample code as following:
test_sql(){
#test#echo test_sql
str=`$ORACLE_BIN/sqlplus -s $user/$passwd <<EOM
set verify off
set heading off
set feedback off
#--------start pl/sql
{
DECLARE
CURSOR pah_cs IS
select id from table
where letter = 'abcd';... (6 Replies)
Discussion started by: YoYo
6 Replies
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)