Sponsored Content
Top Forums UNIX for Dummies Questions & Answers To pass multiple arguments from file in to an sql query Post 302691339 by frappa on Friday 24th of August 2012 09:23:37 AM
Old 08-24-2012
Hi,
if the SQL dialect is Oracle SQL*Plus, a possible solution is in the last post to the following orafaq thread:
OraFAQ Forum: Unix » Passing String Arguments to SQL*Plus from a Unix Shell

Alternatively, you could think about building the .sql script on the fly every run, by using shell commands to create the SQL command string and echoing it into the .sql file.

See ya
fra
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Pass multiple variables to SQL script

I am trying to close of multiple users in an Oracle database. Each users has records in multiple tables what I need to do is use a script that call each SQL seperately passing either CLI arguments or gathered arguments from the users during run time. ## Accept variable(s) from the command line... (1 Reply)
Discussion started by: jagannatha
1 Replies

2. Programming

Single sql query to spool to multiple files

Is there anyway to spool my select statement into spool files of max 10000 records each? eg I have a select statement that will return 45000 records. A normal spool command will output the 45000 into just one spool file. How can I make sqlplus do this? 00001 - 10000 records --- spool... (3 Replies)
Discussion started by: Leion
3 Replies

3. Shell Programming and Scripting

How to use sql data file in unix csv file as input to an sql query from shell

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

4. Shell Programming and Scripting

How do we pass multiple arguments into awk

How do we pass multiple arguments into awk : name=john age=12 now i have to pass both age and name into awk.. how to do it? like : awk -v var=... (4 Replies)
Discussion started by: abhinav192
4 Replies

5. Shell Programming and Scripting

How to pass arguments to SQL file passed in shell script?

Hi, I am using SYBASE database. in my script i am connecting to DB via using isql. isql -U${S_USER} -S${S_SERV} -D${S_DB} -P${S_PWD} -b0 -w3000 -h0 -s"|" -i${MYDIR}/ABC.sql -oXYZ.txt << FINSQL i am taking a ABC.sql file to use the queries written in it and storing the output in... (3 Replies)
Discussion started by: dazdseg
3 Replies

6. Programming

JDBC code to pass the SQL query as parameter and execute?

Below i have the sample code. i need to pass the entire query from file or as parameter and read the results and write into a output file. here the number of columns are unknown. some times it may be 2,3 or entire columns from the table. read all the column results and write into a comma... (0 Replies)
Discussion started by: laknar
0 Replies

7. Shell Programming and Scripting

Help required in passing multiple arguments from a shell script to a pl/sql block

Hi, hope everyone are fine. Please find my issue below, and I request your help in the same In a configuration file, i have a variable defined as below TEST = 'One','Two','Three' I am trying to pass this variable in to a sql script which is define in a pl/sql block as follows, In the... (1 Reply)
Discussion started by: ramakanth_burra
1 Replies

8. Shell Programming and Scripting

How to pass string into sql query?

Hi Gurus, I have a request which needs to pass string into sql. dummy code as below: sqlplus -s user/password@instance << EOF >>output.txt set echo off head off feed off pagesize 0 trimspool on linesize 1000 colsep , select emp_no, emp_name from emp where emp_no in ('a', 'b', 'c'); exit;... (4 Replies)
Discussion started by: ken6503
4 Replies

9. Shell Programming and Scripting

Need script to pass all sql file names in a directory to DB query

Hi All, In this path /home/all_files we have follwing files and direcotries proc_edf_sot.sql proc_ssc_sot.sql func_dfg_sot.sql sot unic cmr sdc under sot directory we have other directories sql pas ref under sql directory we have sql_sot sql_mat (6 Replies)
Discussion started by: ROCK_PLSQL
6 Replies

10. Shell Programming and Scripting

How to pass arguments based on input file?

This script is running some exe file we are passing three argumnet below custome key word Want to update script based on input files every time it will take argument from input file below is the input files should take this input put it into the script. k.ksh cd /u/kali/temp ... (8 Replies)
Discussion started by: Kalia
8 Replies
Parse::Dia::SQL(3pm)					User Contributed Perl Documentation				      Parse::Dia::SQL(3pm)

NAME
Parse::Dia::SQL - Convert Dia class diagrams into SQL. SYNOPSIS
use Parse::Dia::SQL; my $dia = Parse::Dia::SQL->new( file => 't/data/TestERD.dia', db => 'db2' ); print $dia->get_sql(); # or command-line version perl parsediasql --file t/data/TestERD.dia --db db2 DESCRIPTION
Dia is a diagram creation program for Linux, Unix and Windows released under the GNU General Public License. Parse::Dia::SQL converts Dia class diagrams into SQL. Parse::Dia::SQL is the parser that interprets the .dia file(s) into an internal datastructure. Parse::Dia::SQL::Output (or one of its sub classes) can take the datastructure and generate the SQL statements it represents. MODELLING HOWTO
See <http://tedia2sql.tigris.org/usingtedia2sql.html> Modelling differences from tedia2sql o Index options are supported. Text is taken from the comments field of the operation, i.e. the index. A database specific default value is used if the comments field is left blank. Consult the Output sub class' constructor. o Type mapping is supported. A type mapping is a user-defined column name replacement. Unlike tedia2sql the type mapping is non- recursive. Consult "t/data/typemap.dia" for an example. o Preliminary support for Dia's database shapes is added. o Table comments are used as table postfix options. This means per-table options (e.g. partitioning options) are supported on a per- database level. o backticks notation is supported for MySQL-InnoDB. DIA VERSIONS
Parse::Dia::SQL has been tested with Dia versions 0.93 - 0.97. Parse::Dia::SQL uses the XML "version" tag information in the .dia input file to determine how each XML construct is formatted. Future versions of Dia may change the internal format, and XML "version" tag is used to detect such changes. DATABASE SUPPORT
The following databases are supported: DB2 Informix Ingres Oracle Postgres Sas SQLite3 Sybase MySQL InnoDB MySQL MyISAM Adding support for additional databases means to create a subclass of Parse::Dia::SQL::Output. Patches are welcome. AUTHOR
Parse::Dia::SQL is based on tedia2sql by Tim Ellis and others. See the AUTHORS file for details. Modified by Andreas Faafeng, "<aff at cpan.org>" for release on CPAN. BUGS
Please report any bugs or feature requests to "bug-parse-dia-sql at rt.cpan.org", or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Parse-Dia-SQL <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Parse-Dia-SQL>. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. SUPPORT
You can find documentation for this module with the perldoc command. perldoc Parse::Dia::SQL You can also look for information at: o Project home Documentation and public source code repository: <http://tedia2sql.tigris.org/> o RT: CPAN's request tracker http://rt.cpan.org/NoAuth/Bugs.html?Dist=Parse-Dia-SQL <http://rt.cpan.org/NoAuth/Bugs.html?Dist=Parse-Dia-SQL> o AnnoCPAN: Annotated CPAN documentation http://annocpan.org/dist/Parse-Dia-SQL <http://annocpan.org/dist/Parse-Dia-SQL> o CPAN Ratings http://cpanratings.perl.org/d/Parse-Dia-SQL <http://cpanratings.perl.org/d/Parse-Dia-SQL> o Search CPAN http://search.cpan.org/dist/Parse-Dia-SQL <http://search.cpan.org/dist/Parse-Dia-SQL> SEE ALSO
o <http://tedia2sql.tigris.org/> o <http://live.gnome.org/Dia> ACKNOWLEDGEMENTS
See the AUTHORS file. LICENSE
This program is released under the GNU General Public License. TERMINOLOGY
By database we mean relational database managment system (RDBMS). METHODS
new() The constructor. Mandatory arguments: file - The .dia file to parse db - The target database type Dies if target database is unknown or unsupported. get_sql() Return sql for given db. Calls underlying methods that performs parsing and sql generation. perl v5.14.2 2012-02-01 Parse::Dia::SQL(3pm)
All times are GMT -4. The time now is 04:59 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy