Have a look at this. Using union merges the queries together and sorts them. Logically this is not what you asked for though. Your example was getting a row on either side of the target value. This example gets the next highest and next lowest value relative to the target value. By definition the order of rows do not matter in a relational database table, so one would not really select a row on either side of a value in practice. Hopefully someone with better SQL skills can make this more efficient.
These 2 Users Gave Thanks to gary_w For This Post:
Hello all,
I have a test file that has the format:
.....
O
3.694950 -.895050 1.480000
O
5.485050 .895050 1.480000
Ti
-4.590000 4.590000 2.960000
Ti
-2.295000 ... (5 Replies)
I have a script problem that I am not able to solve due my very limited understanding of unix/awk.
This is the contents of test.sh
awk '{print $1}'
From the prompt if I enter:
./test.sh Hello World
I would expect to see "Hello" but all I get is a blank line. Only then if I enter "Hello... (2 Replies)
hello folks
i have a file that have data like
/test/aa/123
/test/aa/xyz
/test/bb/xyz
/test/bb/123
in above lines i just wants to grep "aa" and "bb".
Thanks,
Bash (4 Replies)
Hi to all.
I'm trying to sort this with the Unix command sort.
user1:12345678:3.5:2.5:8:1:2:3
user2:12345679:4.5:3.5:8:1:3:2
user3:12345687:5.5:2.5:6:1:3:2
user4:12345670:5.5:2.5:5:3:2:1
user5:12345671:2.5:5.5:7:2:3:1
I need to get this:
user3:12345687:5.5:2.5:6:1:3:2... (7 Replies)
Hi UNIX Gurus,
I want to use extract the where clause of a SQL present in a file. Please suggest me how can I do it.
Select * from emp where emp_id>10;
cat <file_name> | grep -i "where" returns whole SQL.
how can I extract only "where emp_id>10;"
Thanks in advance (4 Replies)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
1. Print the number of people that are in the /etc/passwd file with the name of George
2. Sort by name and... (8 Replies)
Hi All,
I want to run multiple sql queries and store the data in variable but i want to use sql command only once. Is there a way without running sql command twice and storing.Please advise.
Eg :
Select 'Query 1 output' from dual;
Select 'Query 2 output' from dual;
I want to... (3 Replies)
Hi, I need to join these statements for efficiency, and without having to make a new directory for each batch. I'm annotating commands below.
wget -q -r -l1 URL
^^ can't use -O - here and pipe | to grep because of -r
grep -hrio "\b\+@\+\.\{2,4\}\+\b" * > first.txt
^^ Need to grep the output... (14 Replies)
Discussion started by: p1ne
14 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)