Hi Sir RavinderSingh13,
thank you for your reply.
i got
awk: ^ syntax error
Please advise,
Thanks,
Hello znesotomayor,
on a Solaris/SunOS system, change awkto /usr/xpg4/bin/awk , /usr/xpg6/bin/awk , or nawk.
If you doesn't have Solaris/SunOS then please let us know which os you have with complete error details, I
have bash and it works for me.
Thanks,
R. Singh
Last edited by RavinderSingh13; 09-07-2015 at 10:33 AM..
Reason: Corrected output SQL file name now.
This User Gave Thanks to RavinderSingh13 For This Post:
In
unload to
"/usr/home/data.012202"
I wish to use a date variable as in
unload to
"/usr/home/data.`date`" for the file
is that possible in a query to do, or will i need to add a mv command after the query to do it.
I tried backquotes, , and () on `date` but didn't seem to work
Thanks... (2 Replies)
This is basically what I want to do:
I have a file that contains single lines of IDs.
I want to query the oracle database using these IDs
to get a count of which ones match a certain condition.
the basic idea is:
cat myfile |
while read id
do
$id in select count(PC.ptcpnt_id)
from... (4 Replies)
Hi,
I have data in my text file something like this.
adams
robert
ahmed
gibbs
I want to use this data line by line as input to an sql query which i run by connecting to an oracle database from shell.
If you have code for similar scenario , please ehlp.
I want the output of the sql query... (7 Replies)
Hi ,
I used the below script to get the sql data into csv file using unix scripting.
I m getting the output into an output file but the output file is not displayed in a separe columns .
#!/bin/ksh
export FILE_PATH=/maav/home/xyz/abc/
rm $FILE_PATH/sample.csv
sqlplus -s... (2 Replies)
Hello Guys,
This message is somewhat relates with last thread. But I need to re-write thing. I start over a little. I am stuck now and need your help.
Here is my script-
#! /bin/ksh
export ORACLE_HOME=/opt/oracle/app/oracle/product/9.2
/opt/oracle/app/oracle/product/9.2/bin/sqlplus -s... (5 Replies)
Guys can anyone just tell me whether i can pass a value(from UNIX SCRIPT) as an ARGUMENT in Oracle Query?
e.g.
echo "enter value"
read value
insert into tablename where col=$value /*something like this*/ (1 Reply)
I need to run sql script from shell script which takes the input from a file and contents of file will be like :
12345
34567
78657
and query will be like :
select seq_nbr from bus_event where event_nbr='12345';
select seq_nbr from bus_event where event_nbr='34567';
select seq_nbr... (1 Reply)
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)
Dear Friends,
I am looking for a shell script to merge input files into one file .. here is my idea:
1st paramter would be outfile file (all input files content)
read all input files and merge them to input param 1
ex: if I pass 6 file names to the script then 1st file name as output file... (4 Replies)
Hello All,
I'm trying to put together a shell script that will:
1. connect to an oracle database
2. execute a query
3. save the output to a csv file
I know that I can execute the sqlplus -s user/pass @dbsid and get logged in. What I would like to do is have my query in a separate text... (9 Replies)
Discussion started by: bbbngowc
9 Replies
LEARN ABOUT DEBIAN
class::dbi::abstractsearch
Class::DBI::AbstractSearch(3pm) User Contributed Perl Documentation Class::DBI::AbstractSearch(3pm)NAME
Class::DBI::AbstractSearch - Abstract Class::DBI's SQL with SQL::Abstract::Limit
SYNOPSIS
package CD::Music;
use Class::DBI::AbstractSearch;
package main;
my @music = CD::Music->search_where(
artist => [ 'Ozzy', 'Kelly' ],
status => { '!=', 'outdated' },
);
my @misc = CD::Music->search_where(
{ artist => [ 'Ozzy', 'Kelly' ],
status => { '!=', 'outdated' } },
{ order_by => "reldate DESC",
limit_dialect => 'LimitOffset',
limit => 1
offset => 2 });
DESCRIPTION
Class::DBI::AbstractSearch is a Class::DBI plugin to glue SQL::Abstract::Limit into Class::DBI.
METHODS
Using this module adds following methods into your data class.
search_where
$class->search_where(%where);
Takes a hash to specify WHERE clause. See SQL::Abstract for hash options.
$class->search_where(\%where,\%attrs);
Takes hash reference to specify WHERE clause. See SQL::Abstract for hash options. Takes a hash reference to specify additional query
attributes. Class::DBI::AbstractSearch uses these attributes:
o order_by
Array reference of fields that will be used to order the results of your query.
o limit_dialect
Scalar, DBI handle, object class, etc. that describes the syntax model for a LIMIT/OFFSET SQL clause. Please see
SQL::Abstract::Limit for more information.
o limit
Scalar value that will be used for LIMIT argument in a query.
o offset
Scalar value that will be used for OFFSET argument in a query.
Any other attributes are passed to the SQL::Abstract::Limit constructor, and can be used to control how queries are created. For
example, to use 'AND' instead of 'OR' by default, use:
$class->search_where(\%where, { logic => 'AND' });
AUTHOR
Tatsuhiko Miyagawa <miyagawa@bulknews.net> with some help from cdbi-talk mailing list, especially:
Tim Bunce
Simon Wilcox
Tony Bowden
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
SEE ALSO
Class::DBI, SQL::Abstract, SQL::Abstract::Limit
perl v5.10.0 2009-07-21 Class::DBI::AbstractSearch(3pm)