06-11-2014
iirc, isql supports -o <output file>.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
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)
Discussion started by: Link_02
2 Replies
2. Shell Programming and Scripting
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)
Discussion started by: happyv
7 Replies
3. Shell Programming and Scripting
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)
Discussion started by: dolphin123
1 Replies
4. Shell Programming and Scripting
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)
Discussion started by: dolphin123
1 Replies
5. Shell Programming and Scripting
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)
Discussion started by: little_wonder
8 Replies
6. UNIX for Dummies Questions & Answers
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)
Discussion started by: whoknows
4 Replies
7. Shell Programming and Scripting
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)
Discussion started by: sailaja_80
1 Replies
8. Shell Programming and Scripting
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)
Discussion started by: Nareshp
2 Replies
9. UNIX for Advanced & Expert Users
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)
Discussion started by: thepurple
5 Replies
10. Programming
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
data::phrasebook::sql::query
Data::Phrasebook::SQL::Query(3pm) User Contributed Perl Documentation Data::Phrasebook::SQL::Query(3pm)
NAME
Data::Phrasebook::SQL::Query - Query Extension to the SQL/DBI Phrasebook Model.
SYNOPSIS
my $q = $book->query( 'find_author' );
my $q = $book->query( 'find_author', 'Dictionary' );
DESCRIPTION
An extension to the SQL class to specifically handle the DBI interface for each query requested.
CONSTRUCTOR
new
Not to be accessed directly, but via the parent Data::Phrasebook, by specifying the class as SQL.
METHODS
sql
Get/set the current "sql" statement, in a form suitable for passing straight to DBI.
sth
Get/set the current statement handle.
args
Return list of arguments that will be used as bind parameters to any placeholders. Any given arguments will replace the whole list.
Returns list in list context, arrayref in scalar.
order
As for "args", but regarding the corresponding list of argument names.
The assorted "order_XXX" methods are supported as for "args_XXX".
dbh
Get/set the database handle.
PREPARATION
/ EXECUTING METHODS
execute
Executes the query. Returns the result of "DBI::execute".
Any arguments are given to "order_args" with the return of that method being used as arguments to "DBI::execute". If no arguments, uses
those already specified.
Calls "prepare" if necessary.
order_args
Given a hash or hashref of keyword to value mappings, organises an array of arguments suitable for use as bind parameters in the order
needed by the query itself.
prepare
Prepares the query for execution. This method is called implicitly in most cases so you generally don't need to know about it.
rebind
Rebinds any bound values. Lets one pass a scalar reference in the arguments to "order_args" and have the bound value update if the original
scalar changes.
This method is not needed externally to this class.
DELEGATED METHODS
Any method not mentioned above is given to the statement handle.
All these delegations will implicitly call "prepare".
SEE ALSO
Data::Phrasebook, Data::Phrasebook::SQL.
SUPPORT
Please see the README file.
AUTHOR
Original author: Iain Campbell Truskett (16.07.1979 - 29.12.2003)
Maintainer: Barbie <barbie@cpan.org> since January 2004.
for Miss Barbell Productions <http://www.missbarbell.co.uk>.
COPYRIGHT AND LICENSE
Copyright (C) 2003 Iain Truskett.
Copyright (C) 2004-2010 Barbie for Miss Barbell Productions.
This module is free software; you can redistribute it and/or
modify it under the Artistic Licence v2.
perl v5.10.1 2010-08-31 Data::Phrasebook::SQL::Query(3pm)