08-30-2007
its an alternative but i am searching for a method which can pass the variable from shell script to the Sql's (have a lot of SQL's using the same variable 'current date' but doing different tasks and using a here document will make the script messy)
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi my UNIX Friends,
Im calling some SQL scripts through Unix Shell scripting.
How do I export the value of PL/SQL variable value into a Unix shell script variable?
Also could any one inform me about the 'search' and 'cut' utility of PL/SQL
(like 'grep' and 'cut' in Shell scripting).
... (10 Replies)
Discussion started by: ganapati
10 Replies
2. Shell Programming and Scripting
Hi,
How can I pass an argument to a pl/sql block through perl/unix shell scripting. (2 Replies)
Discussion started by: er_ashu
2 Replies
3. Shell Programming and Scripting
I have this piece code in a shl, I need to pass paramaters to a PL\SQL
PRECEDURE like $fseqno and faidy I know that the $fseqno works correctly but I am not sure aboyt the faidy
can I code it like that faidy ='0910' ?
Thank you
for i in 3526*.dat
do
# Capture just the file... (1 Reply)
Discussion started by: rechever
1 Replies
4. Shell Programming and Scripting
Hi Gurus,
i have one requirement in unix script, i have a file called abc.txt in that few lines are there with the empid, i need to read each line and pass to .sql script.
ex:
abc.txt
2345
2346
1243
1234
i need to pass these arguments to .sql script rom unix
ex:
select * from... (1 Reply)
Discussion started by: Devendar
1 Replies
5. UNIX for Advanced & Expert Users
Hi Everyone,
Can anyone help me how do i call hash variable in to sql query in perl. Please see the script below
i have defined two Hash %lc and %tab as below
$lc{'REFF'}='V_RES_CLASS';
$lc{'CALE'}='V_CAP_CLASS';
$lc{'XRPD'}='V_XFMR_CLASS';
$tab{'V_RES_CLASS'}='V_MFR_SERS';... (6 Replies)
Discussion started by: jam_prasanna
6 Replies
6. Shell Programming and Scripting
Hi Guys,
I am trying to pass a string variable from Unix shell script to sqlplus as a parameter.
I have tried using single quotes with the variable name but it does not work. Please help me with it.
I am using BASH.
My code:
Your help is much appreciated.
Thanks,
shil (2 Replies)
Discussion started by: infintenumbers
2 Replies
7. Shell Programming and Scripting
How to pass variable to sql file.
Im tryin in two ways,
Method 1:
my.sql
select * from table where col1 = '$1' and col2 = 'text';
Method 1execute: dbaccess database my.sql $var
Method2:
select * from table col1 in (`cat inputfile`) and col2 = 'text';
method... (2 Replies)
Discussion started by: Roozo
2 Replies
8. Shell Programming and Scripting
Hi Friend,
I have one file in which some number are mentioned and number of lines are vary every time
And i need to pass that number to my sql command from script.
Suppose i have file acc.txt
45456546456
45464564565
67854353454
67657612132
Number of records are vary every time.... (20 Replies)
Discussion started by: pallvi_mahajan
20 Replies
9. Shell Programming and Scripting
Hi All,
I want to run multiple sql queries and store the data in variable but i want to use sql command only once. Is there a way without running sql command twice and storing.Please advise.
Eg :
Select 'Query 1 output' from dual;
Select 'Query 2 output' from dual;
I want to... (3 Replies)
Discussion started by: Rokkesh
3 Replies
10. Shell Programming and Scripting
Hi all,
I have a a file which contains an oracle query. If this file is pushed into a shell script such as the below, it of course works fine.
#!/usr/bin/sh
su - oracle -c 'sqlplus -s / as sysdba <<EOF
@/home/cron/ORA/sql/T-ORA006-OracleSessions.sql
exit;
EOF
.
What i am after... (2 Replies)
Discussion started by: nms
2 Replies
LEARN ABOUT DEBIAN
alzabo::faq
Alzabo::FAQ(3pm) User Contributed Perl Documentation Alzabo::FAQ(3pm)
NAME
Alzabo::FAQ - Frequently Asked Questions
How can I generate the SQL to turn one schema into another?
Assuming you have schema objects representing these already created (through reverse engineering for example) and both schemas are for the
same RDBMS, you can simply do this:
my @sql = $schema1->rules->schema_diff( old => $schema1, new => $schema2 );
The @sql array will contain all the SQL statements necessary to transform the schema in $schema1 into the schema in $schema2.
If you want to sync a schema object to the current state of the RDBMS backend's schema, check out the "Alzabo::Create::Schema->sync_back-
end" method.
How can I make a local copy of the documentation as HTML?
Alzabo comes with a script called "make_html_docs.pl". It takes three arguments. The first is the source file directory root. The second
is the target directory. The last is the absolute URL path that this target directory represents. If you have perl 5.6.0 or greated
installed, it is recommended that you use it to run this script as the Pod::Html module included with more recent Perls does a much better
job of making HTML.
If you were in the root of the source directory you might run this as:
perl ./make_html_docs.pl ./lib /usr/local/apache/htdocs/Alzabo_docs /Alzabo_docs
The script will create an index.html file as well as turning the documentation into HTML.
How can I optimize memory usage under mod_perl?
You should simply preload the Alzabo::Runtime module (which loads all the other modules it needs).
In addition, if you are using Alzabo::MethodMaker, make sure it runs in the parent. This module can create a lot of methods on the fly and
each method eats up some memory.
Finally, you can preload one or more schema objects. The easiest way to do this is to simply pass its name to Alzabo::Runtime when you use
it, like this:
use Alzabo::Runtime qw( schema1 schema2 );
How can I get objects for tables linked via the Mason GUI?
For example, if I have a websites2categories table which maps a list of categories that a given web site should display -- and uses
website_id and category_id in a 1..n relationship -- what is the proper way to set that up in the GUI and then in my code?
In the GUI, you can simply create a relationship from websites to categories, and declare it n..n. Alzabo will automatically create a ta-
ble called websites_categories, and you're free to change the name to whatever you want.
Then if you use "Alzabo::MethodMaker", Alzabo will see that you have a table with 2 cols, both of which are part of the PK, and that it has
1..n relationships with 2 other tables, and it will create the appropriate methods.
You can see what methods are being created by setting the "ALZABO_DEBUG" environment variable to "METHODMAKER" before loading Alz-
abo::MethodMaker. It'll spit everything out to STDERR. There's also the generated documentation, which is available via the
"docs_as_pod()" schema method after MethodMaker does its thing.
AUTHOR
Dave Rolsky, <autarch@urth.org>
perl v5.8.8 2007-12-23 Alzabo::FAQ(3pm)