Sponsored Content
Top Forums Shell Programming and Scripting Multiple Query Results to Variables Post 302733403 by flowervz on Tuesday 20th of November 2012 11:26:56 AM
Old 11-20-2012
Multiple Query Results to Variables

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 result of one value in a variable; however I am not sure if it is best to store multiple results in an array or to a variable and then parse the variable? Any guidance would be appreciative.
thanks
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Set shell variables from SQLPLUS query results

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)
Discussion started by: pranavagarwal
2 Replies

2. Shell Programming and Scripting

Oracle Query results to be stored in variables

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)
Discussion started by: ashokjaysiv
4 Replies

3. Shell Programming and Scripting

Oracle Query results to be stored in variables using unix

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)
Discussion started by: Nareshp
5 Replies

4. UNIX for Dummies Questions & Answers

how to - redirect query results to a variable

How can I send the results of a query to a unix variable. I basically want to run a query then do some logic on the results. Trying to redirect the result into a variable I define in the script. select count(*) as counter from table - nut to redirect the "count" returned from the query... (2 Replies)
Discussion started by: rstone
2 Replies

5. Shell Programming and Scripting

SQL/Plus in a coprocess example. Also saves query results into shell variables

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)
Discussion started by: gary_w
2 Replies

6. Shell Programming and Scripting

How to store results of multiple sql queries in shell variables in ksh?

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)
Discussion started by: gonchusirsa
6 Replies

7. Shell Programming and Scripting

How to Assign SQL Query Results to Variables in Linux?

Hi, I am new to linux... How to Assign SQL Query Results to Variables in Linux,i want ti generate it in param files, Can anyone please explain me. Ex: SQL> Select * from EMP; O/P: Emp_No Emp_Name 1 AAA 2 BBB 3 CCC and I want expected... (5 Replies)
Discussion started by: Sravana Kumar
5 Replies

8. Shell Programming and Scripting

Mailing query results in tabular format

Hi , I am purging two tables based on date. In my script I am taking the count of the tables purging them and then taking the after counts. I need to mail the before and after counts of the two tables in a mail in table format as mentioned in the result section. For Eg: ## Count of the... (14 Replies)
Discussion started by: CFA
14 Replies

9. Shell Programming and Scripting

Assigning multiple column's value from Oracle query to multiple variables in UNIX

Hi All, I need to read values of 10 columns from oracle query and assign the same to 10 unix variables. The query will return only one record(row). I tried to append all these columns using a delimiter(;) in the select query and assign the same to a single variable(V) in unix. I thought I... (3 Replies)
Discussion started by: hkrishnan91
3 Replies

10. Shell Programming and Scripting

Postgre Query results as Email HTML table

Hello, I'm trying to send email from Greenplum query results as HTML table with status Red/Green Select Server, Last_Date from Table; Results Server, Last_Date Prod, 2018-04-09 Final email Output in HTML format Server Status LastDate Prod GREEN(BOX) 2018-04-09 (if... (2 Replies)
Discussion started by: krux_rap
2 Replies
Plucene::Search::Query(3pm)				User Contributed Perl Documentation			       Plucene::Search::Query(3pm)

NAME
Plucene::Search::Query - base class for queries SYNOPSIS
my $s_query = Plucene::Search::Query::Subclass->new({ boost => $boost_factor}); my $scorer = $s_query->scorer($query, $searcher, $reader); DESCRIPTION
This is an abstract base class for queries. A query is a specification of the content an properties of the desired documents. Every search is done by matching a query against the document index and locating the ones that match the query. The simplest query specifies a single term (or word) that is to be matched against a single field (e.g. 'author') of each of the documents in the index. This kind of query matches any document that contains the term in the specified field. A more complex queries may contain nested queries with 'and', 'or', 'not' or 'phrase' relations. Queries may also contains specification of which document fields to match against the various parts of the query (.e.g. 'authors' and 'title') and hints that may effects the ranking of the matched documents ('boost' factor). METHODS
new my $s_query = Plucene::Search::Query::Subclass->new({ boost => $boost_factor}); boost Get / set this attribute scorer my $scorer = $s_query->scorer (Plucene::Search::Query $query, $searcher, $reader); prepare Does nothing sum_squared_weights / normalize / _scorer These must be defined in a subclass perl v5.12.4 2011-08-14 Plucene::Search::Query(3pm)
All times are GMT -4. The time now is 03:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy