Are you sure that the query returns 1 ?
Have you tried the execute the query at the shel prompt (with option -x) ?
'But it is failing today ' meens that the query produces Oracle errors or that the exit status is not set to the right value ?
Hi,
I have an issue. There is a file that has got some values seperated by commas. I have to write a shell script that would extrct these values and insert them into a table. How can this be done
Thanx in advance (3 Replies)
Hi,
I am able to insert the values into a database table from a flat file using SQL loader. Now can I do the same using only shell script.Can this be done without using sql loader and only with shell scripting(ie use of awk). Please put some light on this.
Thanks in advance (3 Replies)
Hi-
I am trying to achieve the following in a script so I can schedule it on a cron job. I am fairly new to the unix environment...
I have written a shell script that reads a flat file and loads the data into an Oracle table (Table1) via SQLLDR. This Works fine. Then, I run a nested insert... (5 Replies)
Hi,
I need help urgently for following issue. Pls help me to resolve this issue.
I am calling sql script file(file1.sql) from UNIX Shell Script(script1.ksh) using sql plus and trying to create flat file that contains all records returned from SQL query in SQL script(file1.sql)
I given... (6 Replies)
I need help in the following script. I want to grep the sql errors insert into the error table and exit the shell script if there is any error, otherwise keep running the scripts.
Here is my script
#!/bin/csh -f
source .orapass
set user = $USER
set pass = $PASS
cd /opt/data/scripts
echo... (2 Replies)
sqlplus -s <<__END__
${USER}/${PASS}@${DB}
WHENEVER SQLERROR EXIT SQL.SQLCODE ROLLBACK
WHENEVER OSERROR EXIT FAILURE ROLLBACK
SET ECHO ON
SET TIMING ON
SET SERVEROUTPUT ON SIZE 1000000
select count(*) from table where start LIKE '10-JUN-10';
EXIT
__END__
result=$?
echo $resultThis gives... (9 Replies)
There are 4 parameters that I have to pass from korn shell to sql script.
1) I have to check if $1 , $2 , $3 and $4 are null values or not .
How can I do that ?
2) Once its determined that these values are null (in the sense they are empty) how can I pass null values to sql script... (11 Replies)
Hi, this's Pom. I'm quite a new one for shell script but I have to do sql on shell script to query some information from database.
I found a concern to get a new line...When I run my script, it retrieves all data as wondering but it's shown in one line :(
What should I do? I'm not sure that... (2 Replies)
Hi,
I need to excute two .sql scripts sequentially within file.sh
sqlplus user/pass@db1 @/opt/Infor/Outbound_Marketing/7.2.2/custom/iadeploy1.sql
THEN
sqlplus user/pass@db2 @/opt/Infor/Outbound_Marketing/7.2.2/custom/iadeploy3.sql
Thanks,
Soph (4 Replies)
Hi all,
$ echo $SHELL
/bin/bash
Requirement - How to pass oracle sql script as argument to unix shell script?
$ ./output.sh users.sql
Below are the shell scripts and the oracle sql file in the same folder.
Shell Script
$ cat output.sh
#!/bin/bash
.... (7 Replies)
Discussion started by: a1_win
7 Replies
LEARN ABOUT DEBIAN
sql::translator::schema::trigger
SQL::Translator::Schema::Trigger(3pm) User Contributed Perl Documentation SQL::Translator::Schema::Trigger(3pm)NAME
SQL::Translator::Schema::Trigger - SQL::Translator trigger object
SYNOPSIS
use SQL::Translator::Schema::Trigger;
my $trigger = SQL::Translator::Schema::Trigger->new(
name => 'foo',
perform_action_when => 'before', # or after
database_events => [qw/update insert/], # also update, update_on, delete
fields => [], # if event is "update"
on_table => 'foo', # table name
action => '...', # text of trigger
schema => $schema, # Schema object
scope => 'row', # or statement
);
DESCRIPTION
"SQL::Translator::Schema::Trigger" is the trigger object.
METHODS
new
Object constructor.
my $schema = SQL::Translator::Schema::Trigger->new;
perform_action_when
Gets or sets whether the event happens "before" or "after" the "database_event".
$trigger->perform_action_when('after');
database_event
Obsolete please use database_events!
database_events
Gets or sets the events that triggers the trigger.
my $ok = $trigger->database_events('insert');
fields
Gets and set which fields to monitor for "database_event".
$view->fields('id');
$view->fields('id', 'name');
$view->fields( 'id, name' );
$view->fields( [ 'id', 'name' ] );
$view->fields( qw[ id name ] );
my @fields = $view->fields;
table
Gets or set the table on which the trigger works, as a SQL::Translator::Schema::Table object.
$trigger->table($triggered_table);
on_table
Gets or set the table name on which the trigger works, as a string.
$trigger->on_table('foo');
action
Gets or set the action of the trigger.
$trigger->action(
q[
BEGIN
select ...;
update ...;
END
]
);
is_valid
Determine whether the trigger is valid or not.
my $ok = $trigger->is_valid;
name
Get or set the trigger's name.
my $name = $trigger->name('foo');
order
Get or set the trigger's order.
my $order = $trigger->order(3);
scope
Get or set the trigger's scope (row or statement).
my $scope = $trigger->scope('statement');
schema
Get or set the trigger's schema object.
$trigger->schema( $schema );
my $schema = $trigger->schema;
compare_arrays
Compare two arrays.
equals
Determines if this trigger is the same as another
my $is_identical = $trigger1->equals( $trigger2 );
AUTHORS
Anonymous, Ken Youens-Clark <kclark@cpan.org>.
perl v5.14.2 2012-01-18 SQL::Translator::Schema::Trigger(3pm)