Sponsored Content
Top Forums Shell Programming and Scripting Multiple Query Results to Variables Post 302733429 by flowervz on Tuesday 20th of November 2012 01:17:13 PM
Old 11-20-2012
Thank you very much for your reply. Can you tell me if there is a way to do this dynamically without creating a new object such as a file?
 

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
roqet(1)						      General Commands Manual							  roqet(1)

NAME
roqet - Rasqal RDF query utility SYNOPSIS
roqet [OPTIONS] <query-URI> [base-URI] roqet [OPTIONS]-e query-string [base-URI] roqet [OPTIONS]-p sparql-protocol-service-URI [-e query-string ] [base-URI] DESCRIPTION
The roqet utility allows querying of RDF content using the Rasqal RDF query library, printing the results in variable bindings, RDF graph or boolean format. The query is read from query-URI and the optional base-URI is used as the base URI of the query if present. MAIN OPTIONS
roqet uses the usual GNU command line syntax, with long options starting with two dashes (`-') if supported by the getopt_long function. Otherwise only the short options are available. -e, --exec QUERY Execute the query in the argument QUERY instead of reading the query from a URI (when -e / --exec is not given). -i, --input LANGUAGE Set the input query LANGUAGE to one of the supported languages which includes 'sparql' (SPARQL Query Language for RDF, default), 'sparql11' and 'laqrs'. The full list of supported languages and subsets is given in the help summary with the -h / --help option. -p, --protocol SERVICE-URI Call the SPARQL HTTP protocol SERVICE-URI to execute the query instead of executing it inside the Rasqal query engine locally. -r, --results FORMAT Set the query results format. For variable bindings, the values of FORMAT vary upon what Rasqal supports but include 'simple' for a simple text format (default), 'xml' for the SPARQL Query Results XML format, 'rdfxml' and 'turtle' for RDF syntax formats, and 'json' for a JSON version of the results. For RDF graph results, the values of FORMAT are 'ntriples' (N-Triples, default), 'rdfxml-abbrev' (RDF/XML Abbreviated), 'rdfxml' (RDF/XML), 'turtle' (Turtle), 'json' (RDF/JSON resource centric), 'json-triples' (RDF/JSON triples) or 'rss-1.0' (RSS 1.0, also an RDF/XML syntax). The exact list of formats depends on what libraptor2(3) was built with but is given correct in the usage message with -h. OTHER OPTIONS
-c, --count Only count the triples and produce no other output. -d, --dump-query FORMAT Print the parsed query out in a given FORMAT one of 'none' (default), 'debug', 'structure' or 'sparql' -D, --data URI Add RDF data source URI (not a named graph). If no data sources are given, the query itself must point to the data such as via SPARQL FROM uri statements. -E, --ignore-errors Do not print error messages and do not exit with a non-0 status. -f, --feature NAME(=VALUE) Set query feature NAME to the VALUE or integer 1 if omitted. The known features can be shown with -f help or --feature help. -F, --format NAME Set the data source format name for subsequent data graphs called with -D / --data or -G / --named. The default if this is not specified is for the query engine to guess. The name is a Raptor parser name. -G, --named URI Add RDF data source URI (named graph) -h, --help Show a summary of the options. -n, --dryrun Prepare the query but do not execute it. -q, --quiet No extra information messages. -s, --source URI Add RDF data source URI (named graph) URI by adding it to the list of query data source URIs. FORMAT to 'simple' (default) or 'xml' (an experimental XML format) -v, --version Print the rasqal library version and exit. -W, --warnings LEVEL Set the warning LEVEL in the range 0 (do not warn about anything) to 100 (show every warning). The Rasqal default is in the middle (50). EXAMPLES
roqet sparql-query-file.rq Run a SPARQL query contained in the local file sparql-query-file.rq. The data used would be described in FROM statements in the query file. roqet -q -i sparql http://example.org/sparql-query.rq Run a SPARQL query that is in the web at URI http://example.org/sparql-query.rq without an extra messages (quiet, -q). roqet -q query-file.rq http://example.org/base/ Run an query (default languge SPARQL) from a local file query-file.rq but using base URI http://example.org/base/ to resolve any relative URIs. roqet -q -i sparql -r xml http://example.org/sparql-query.rq Run a SPARQL query that is in the web at URI http://example.org/sparql-query.rq and format the results in the SPARQL Query Results XML for- mat with no extra messages. roqet -i sparql -e 'SELECT * WHERE { ?s ?p ?o }' -D stuff.rdf Run a SPARQL query given on the command line against data in the file stuff.rdf. The type of the file will be guessed and likely is of format RDF/XML. CONFORMING TO
SPARQL Query Language for RDF, Eric Prud'hommeaux and Andy Seaborne (eds), W3C Recommendation, 15 January 2008. http://www.w3.org/TR/2008/REC-rdf-sparql-query-20080115/ <http://www.w3.org/TR/2008/REC-rdf-sparql-query-20080115/> SPARQL Query Results XML Format, Jeen Broekstra and Dave Beckett (eds), W3C Recommendation, 15 January 2008. http://www.w3.org/TR/2008/REC-rdf-sparql-XMLres-20080115/ <http://www.w3.org/TR/2008/REC-rdf-sparql-XMLres-20080115/> SEE ALSO
librasqal(3),libraptor(3) CHANGES
AUTHOR
Dave Beckett - http://www.dajobe.org/ <http://www.dajobe.org/> 2011-06-11 roqet(1)
All times are GMT -4. The time now is 06:30 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy