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
webservice::solr::query
WebService::Solr::Query(3pm) User Contributed Perl Documentation WebService::Solr::Query(3pm)NAME
WebService::Solr::Query - Abstract query syntax for Solr queries
SYNOPSIS
my $query = WebService::Solr::Query->new( { foo => 'bar' } );
my $result = $solr->search( $query );
DESCRIPTION
WebService::Solr::Query provides a programmatic way to generate queries to be sent to Solr. Syntax wise, it attempts to be as close to
SQL::Abstract WHERE clauses as possible, with obvious exceptions for idioms that do not exist in SQL. Just as values in SQL::Abstract are
SQL-escaped, this module does the appropriate Solr-escaping on all values passed to the object (see "escape()").
QUERY SYNTAX
Key-Value Pairs
The simplest way to search is with key value pairs.
my $q = WebService::Solr::Query->new( { foo => 'bar' } );
# RESULT: (foo:"bar")
Implicit AND and OR
By default, data received as a HASHREF is AND'ed together.
my $q = WebService::Solr::Query->new( { foo => 'bar', baz => 'quux' } );
# RESULT: (foo:"bar" AND baz:"quux")
Furthermore, data received as an ARRAYREF is OR'ed together.
my $q = WebService::Solr::Query->new( { foo => [ 'bar', 'baz' ] } );
# RESULT: (foo:"bar" OR foo:"baz")
Nested AND and OR
The ability to nest AND and OR boolean operators is essential to express complex queries. The "-and" and "-or" prefixes have been provided
for this need.
my $q = WebService::Solr::Query->new( { foo => [
-and => { -prohibit => 'bar' }, { -require => 'baz' }
] } );
# RESULT: (((-foo:"bar") AND (+foo:"baz")))
my $q = WebService::Solr::Query->new( { foo => [
-or => { -require => 'bar' }, { -prohibit => 'baz' }
] } );
# RESULT: (((+foo:"bar") OR (-foo:"baz")))
Default Field
To search the default field, use the "-default" prefix.
my $q = WebService::Solr::Query->new( { -default => 'bar' } );
# RESULT: ("bar")
Require/Prohibit
my $q = WebService::Solr::Query->new( { foo => { -require => 'bar' } } );
# RESULT: (+foo:"bar")
my $q = WebService::Solr::Query->new( { foo => { -prohibit => 'bar' } } );
# RESULT: (-foo:"bar")
Range
There are two types of range queries, inclusive ("-range_inc") and exclusive ("-range_exc"). The "-range" prefix can be used in place of
"-range_inc".
my $q = WebService::Solr::Query->new( { foo => { -range => ['a', 'z'] } } );
# RESULT: (+foo:[a TO z])
my $q = WebService::Solr::Query->new( { foo => { -range_exc => ['a', 'z'] } } );
# RESULT: (+foo:{a TO z})
Boost
my $q = WebService::Solr::Query->new( { foo => { -boost => [ 'bar', '2.0' ] } } );
# RESULT: (foo:"bar"^2.0)
Proximity
my $q = WebService::Solr::Query->new( { foo => { -proximity => [ 'bar baz', 10 ] } } );
# RESULT: (foo:"bar baz"~10)
Fuzzy
my $q = WebService::Solr::Query->new( { foo => { -fuzzy => [ 'bar', '0.8' ] } } );
# RESULT: (foo:bar~0.8)
Boost
my $q = WebService::Solr::Query->new( { foo => { -boost => [ 'bar', '2.0' ] } } );
# RESULT: (foo:"bar"^2.0)
Literal Queries
Specifying a scalar ref as a value in a key-value pair will allow arbitrary queries to be sent across the line. NB: This will bypass any
data massaging done on regular strings, thus the onus of properly escaping the data is left to the user.
my $q = WebService::Solr::Query->new( { '*' => '*' } )
# RESULT (*:*)
ACCESSORS
o query - stores the original query structure
METHODS
new( \%query )
Creates a new query object with the given hashref.
stringify( )
Converts the supplied structure into a Solr/Lucene query.
escape( $value )
The following values must be escaped in a search value:
+ - & | ! ( ) { } [ ] ^ " ~ * ? :
NB: Values sent to "new()" are automatically escaped for you.
unescape( $value )
Unescapes values escaped in "escape()".
D
Debugging constant, default: off.
BUILDARGS
Moose method to handle input to "new()".
SEE ALSO
o WebService::Solr
o http://wiki.apache.org/solr/SolrQuerySyntax
AUTHORS
Brian Cassidy <bricas@cpan.org>
Jos Boumans <kane@cpan.org>
COPYRIGHT AND LICENSE
Copyright 2008-2012 National Adult Literacy Database
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.14.2 2012-05-24 WebService::Solr::Query(3pm)