06-05-2012
First create sql script using vi editor and the create shell script call you sql script in shell script if you want you can schedule in crontab (where you can schedule)
Some hints...
PHP Code:
$test.sql
set serveroutput on size 1000000 format wrap
set feedback off
set verify off
set echo off sqlprompt ""
set long 2000000000
set linesize 32767
set longchunksize 32767
set pagesize 0
set timing off
set trimout on
set trimspool on
set heading off
set termout on
----------Sql query....
Shell script:-
PHP Code:
$cat test.sh
CDATE=`date +%d%m%Y`
export CDATE
echo $CDATE
. /home/oracle/.bash_profile
sqlplus username/password @test.sql >> test$CDATE.txt
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
sample code as following:
test_sql(){
#test#echo test_sql
str=`$ORACLE_BIN/sqlplus -s $user/$passwd <<EOM
set verify off
set heading off
set feedback off
#--------start pl/sql
{
DECLARE
CURSOR pah_cs IS
select id from table
where letter = 'abcd';... (6 Replies)
Discussion started by: YoYo
6 Replies
2. Shell Programming and Scripting
who can show me how to call pl/sql function or precudure in unix script..
cheers, (6 Replies)
Discussion started by: YoYo
6 Replies
3. UNIX for Dummies Questions & Answers
I like to call a shell script from pl/sql proceduere and i have to use the shell script return value in that procedure. i am using oracle 9i and cygwin.
can any one suggest me how can i do this (0 Replies)
Discussion started by: rajesh.P
0 Replies
4. Shell Programming and Scripting
I would like to call the shell script from pl/sql and i need to uses the value returned by the shell script in pl/sql procedure.
can any one suggest me how can i do that? (3 Replies)
Discussion started by: rajesh.P
3 Replies
5. Shell Programming and Scripting
Hi All,
Am having a shell script JDE_REPORT_GEN.sh which intern calls a sql script JDE_CHANGED_DATA.sql. the problem here is when i run this script from the $prompt it is running fine and giving out the spool file required.
if i schedule the same shell in cronjob am not getting the spool... (3 Replies)
Discussion started by: azum
3 Replies
6. Shell Programming and Scripting
Hello,
I am doing a shell script which contain a pl/sql loop to search for 3 values, i would like to call another shell script inside this sql loop each time it find the values. so how can i call shell script from pl/sql using its variables, any idea?
Here is idea about the code:
my... (1 Reply)
Discussion started by: rosalinda
1 Replies
7. Shell Programming and Scripting
Hi Experts,
I want to call script_name.ksh as many time as id in customer table and also pass it as a parameter to script.
someting Like below.
for i in select id from customer
do
./script_name.ksh $i &
done
I have figured out how to have ID from customer but now how to call... (3 Replies)
Discussion started by: Opamps123
3 Replies
8. UNIX for Advanced & Expert Users
Hi i am not able to connect sqlplus
my script is as follows
$ORACLE_HOME/bin/sqlplus << ! > /tmp/extract/DM.txt
and output is
SQL*Plus: Release 11.1.0.7.0 - Production on Wed Jan 18 02:53:54 2012
Copyright (c) 1982, 2008, Oracle. All rights reserved.
Enter user-name: t175481... (1 Reply)
Discussion started by: tushar_spatil
1 Replies
9. Shell Programming and Scripting
HI Experts,
I am pretty new to scripting and i need to create a perl or shell script which should fetch a file from local directory and insert the data into a table using sql loader. This will be later added to chron job to run daily and fetch all files and load them into
the table.
Also i... (1 Reply)
Discussion started by: sam1234
1 Replies
10. Shell Programming and Scripting
hi ,
the below script contains sql query and after executed it sends the output of the query (output.txt) to an email body with conditional subject line based on the output of all_counts_match.txt.
i want to make this script generic so that it can accept the sql file as parameter and can... (5 Replies)
Discussion started by: itzkashi
5 Replies
LEARN ABOUT DEBIAN
cvm-sql
cvm-sql(7) Miscellaneous Information Manual cvm-sql(7)
NAME
cvm-sql - CVM SQL Framework
QUERY SUBSTITUTION
$VAR and ${VAR} are replaced with the quoted value of the environment variable named VAR. Use the second form when VAR contains anything
other than alpha-numeric or underscore (_) characters. Do not include quotes in the query. The variables account and domain contain the
account and domain names given by the CVM client. $$ is replaced with a single dollar sign.
QUERY RESULTS
The query must produce the following fields exactly in order. All required fields must not be null or empty.
1. Password, encrypted with crypt(3) (required)
2. Actual account name (required)
3. User ID (integer) (required)
4. Group ID (integer) (required)
5. Directory (required)
6. Real name (optional)
7. Login shell (optional)
8. Group name (optional)
9. Domain name (optional)
10. System account name (optional)
11. System account directory (optional)
12. Mailbox path (optional)
DEFAULT QUERY
SELECT password, username, userid, groupid, directory, realname, shell, groupname, domain, sys_username, sys_directory FROM accounts WHERE
username=$account AND domain=$domain
SEE ALSO
cvm-mysql(8), cvm-pgsql(8), cvm-pwfile(8), cvm-qmail(8), cvm-unix(8), cvm-vmailmgr(8), cvm-benchclient(8), cvm-checkpassword(8), cvm-test-
client(8)
http://untroubled.org/cvm/cvm.html
cvm-sql(7)