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)
Hi,
I search all post...and no soluation about..if i would like to run a sql statement and output the result to txt file.
for example,
i usually run "sql" to logon the database and run select statement. Then I need to copy the output into the result.txt. Can I run the script to do this... (7 Replies)
Hi ,
I just found you while surfing for the string
'Redirecting sql select query output from within a shell script to txt file/excel file'
Could you find time sending me the code for the above question?
It'll be great help for me.
I have a perl file that calls the sql file... (1 Reply)
Hi Yogesh,
Lucky that i caught you online. Yeah i read about DBI and the WriteExcel module. But the server is not supporting these modules. It said..."Cannot locate DBI"..."Cannot locate Spreadsheet::WriteExcel"
I tried creating a simple text file to get the query output, but the... (1 Reply)
Hi All,
I want to format the result driven from the query into neat format.
For example pls find the below code,
#! /bin/sh
result='
sqlplus -s uname/passwrd@DBname
select no,name,address,ph_no, passport_no,salary,designation
from emp_table where salary>1000;
exit
EOF'
... (8 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 am executing sql files in my unix shell script. Now i want to find whether its a success or a failure record and redirect the success or failure to the respective files. meaning.
success records to success.log file
failure record to failure.log file.
As of now i am doing like... (1 Reply)
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)
Dear community,
please help with a query on Oracle. I'm using SQLPlus (but with SQLDeveloper is the same) to accamplish a sinple query like:
select count(*) from ARCHIT_D_TB where (TYP_ID=22 OR TYP_ID=23) and SUB_TM like '%SEP%' and CONS=1234This is a very simple query that works perfect until... (5 Replies)
Discussion started by: Lord Spectre
5 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)