Hi
I want to get the a field from a SQL query into unix shell script variable. the whole situation is like this.
1. Opened a cursor to a table in DB2 databse.
2. Fetching individual rows with the help of cursor.
3. Each row has 4 fields.
I want each of the field in individual shell... (1 Reply)
Hi All,
I needed to get the result of two sqlplus queris into shell variables.
After days of looking for the ultimate solution to this problem.. i found this...
sqlplus -s USER/PASS@DB <<EOF | awk '{if(NR==1) printf("%s ", $1); if(NR==2) printf("%s ",
$1);}' | read VAR1 VAR2
set head off... (2 Replies)
Hi
I would like to know if there is a way to just have one ORACLE connection established, using which we can execute different queries and store the results under different variables.
For e.g the following uses to two silent ORACLE connection to store the result under two different... (4 Replies)
I want to store the sql query output into a variable
#!/bin/ksh
ORACLE_SID=DB01;
export ORACLE_SID;
export FILE_PATH=/home/asg/Tmp
# Order Checking
echo " removing old files "
rm $FILE_PATH/Malformed_Order.txt
echo " Enter the Malformed Order ....!"
read orders
echo "Regrade... (5 Replies)
While assisting a forum member, I recommended running SQL/Plus in a coprocess (to make database connections and run a test script) for the duration of his script rather than starting/stopping it once for every row in a file he was processing.
I recalled I made a coprocess example for folks at... (2 Replies)
Hello,
I am very new to shell scripting and I am not sure of how best to handle the following scenario. I need to query a list of values from a table. I need to store those results and use them to selectively delete values in yet another table in a separate database. I do know how to store the... (3 Replies)
Hi,
I have a script where I make a sqlplus connection. In the script I have multiple sql queries within that sqlplus connection. I want the result of the queries to be stored in shell variables declared earlier. I dont want to use procedures. Is there anyway else.
Thanks in advance..
Cheers (6 Replies)
Hi,
I have connected to oracle database with sqlplus -s / <<EOF
select ename, age from emp where empid=1234;
EOF
I want to save the values of ename and age in unix shell variables. Any pointers would be welcome..
Thanks in advance!!1
Cheers :):):):) (1 Reply)
Requirement 1) I need to execute 15 SQL queries in oracle through linux script. All these query results needs to be stored in array variables.
Requirement 2) And these 15 queries needs to be executed in parallel.
Requirement 3) Once all the queries executed then the shell script should... (3 Replies)
Hi
iam new to shell scripting
how to declare variables as redshift query and I have to compare two counts by using if condition .
ex:count=select count(*) from prd;
select count(*) from prd;
select count(*) from tag;
can any one help me .
Please use CODE tags when displaying... (1 Reply)
Discussion started by: sam526
1 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)