shell script & sqlplus "plzz help"


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting shell script & sqlplus "plzz help"
# 1  
Old 02-26-2008
shell script & sqlplus "plzz help"

hi friends,
i m tryin to load data from one set of table to other i have sql procedure al ready for it..!

i m going to load the procedure only if data in one of my table for example


table "landing " have 10 records each attribute of this table is

file_name status date are the 3 atributes


wht i want to do is if all 10 records have status "c"
then it shuld load some procedure...

or else if status is not "c" then load some other tables


please help me in this ...

thnxs in advance


the script i wrote till knw is


ProcessedStatus=`sqlplus -s "abcd"/"abcd" << END
set pagesize 0
set feedback off
set verify off
set heading off
set echo off

set serveroutput on
select count(*) from landing where program_status='C'and extract_date in (select distinct max(extract_date
) from pmd_audit_data_load_master);
exit;
END`

echo $ProcessedStatus
if [ $ProcessedStatus = 10 ] ;
then


exec SP_LND_APP;
exec SP_LND_APPLI;
exec SP_TEMP_ON;

END

fi
#echo"processing error procedures:"
#exec SP_LND_APPL_ERR;
#exec SP_LND_APPLI_ERR;
#END
#fi
#

i tryed this but didt work can u ppl please help me out
# 2  
Old 02-26-2008
I am not clear about your requirements but want to try:

based on some value of "ProcessedStatus" you want to execute some pl/sql procedure.

try this

Code:
if [ $ProcessedStatus = 10 ] ;
 then 
 `sqlplus -s abcd/abcd <<END
   begin
   your_procedure_1;
   end;
   exit;
   END`

 else
`sqlplus -s abcd/abcd <<END
   begin
   your_procedure_2;
   end;
   exit;
   END`
fi

# 3  
Old 02-27-2008
thnxs

this friend ..
this is wht i was trying to do is ther any alternate solution ..!

for doing this ..
any what u ppl thing is tht query gonna give the write o/p as wht i needed ;(
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

2. UNIX and Linux Applications

Problem on SQLplus command ""bash: sqlplus: command not found""

Hi all, i face an error related to my server ""it's running server"" when i use sqlplus command $ sqlplus bash: sqlplus: command not found the data base is up and running i just need to access the sqlplus to import the dump file as a daily backup. i already check the directory... (4 Replies)
Discussion started by: clerck
4 Replies

3. Shell Programming and Scripting

How to use 'expect' to pass UID & Password to a "for loop" in shell script?

Friends, Need someone's help in helping me with the below requirement for a script: > For a list of servers(over 100+), I need to login into each of them(cannot configure password-less ssh) & grab few configuration details < I know, this is possible through expect programming in a simple... (14 Replies)
Discussion started by: thisissouvik
14 Replies

4. AIX

How to use 'expect' to pass UID & Password to a "for loop" in shell script?

Friends, Need someone's help in helping me with the below requirement for a script: > For a list of servers(over 100+), I need to login into each of them(cannot configure password-less ssh) & grab few configuration details < I know, this is possible through expect programming in a simple... (2 Replies)
Discussion started by: thisissouvik
2 Replies

5. Web Development

How would I mod_rewrite "/~a1Pha" and "/=a1Pha" to "/paste/a1Pha.htm"? (internally & externally)

Basically I want to shorten URLs on my html pasting site (pasteht.ml), by using "/~a1Pha" instead of "/paste/a1Pha". The ID is 5 numbers and letters, both cases. For example: /~idnum serves /paste/idnum.htm /=idnum serves /paste/idnum.htm /paste/idnum redirects to /~idnum (to update any old... (0 Replies)
Discussion started by: phillips1012
0 Replies

6. Shell Programming and Scripting

finding the strings beween 2 characters "/" & "/" in .txt file

Hi all. I have a .txt file that I need to sort it My file is like: 1- 88 chain0 MASTER (FF-TE) FFFF 1962510 /TCK T FD2TQHVTT1 /jtagc/jtag_instreg/updateinstr_reg_1 dff1 (TI,SO) 2- ... (10 Replies)
Discussion started by: Behrouzx77
10 Replies

7. Red Hat

files having Script which works behind "who" & "w" commands

Dear All, plz print the path of files which have the script of "who" & "w" commands. thnx in advance. (6 Replies)
Discussion started by: saqlain.bashir
6 Replies

8. Programming

fork&pipe "interpretting" shell - problem

hello everybode.Got some sort of "problems" with this stuff; well this is a program int main() { int Pipe; int origStdin, origStdout; int childPID; origStdin = dup(0); origStdout = dup(1); pipe(Pipe); if( (childPID = fork()) < 0 ) { perror(... (2 Replies)
Discussion started by: IdleProc
2 Replies

9. AIX

"too big" and "not enough memory" errors in shell script

Hi, This is odd, however here goes. There are several shell scripts that run in our production environment AIX 595 LPAR m/c, which has sufficient memory 14GB (physical memory) and horsepower 5CPUs. However from time to time we get the following errors in these shell scripts. The time when these... (11 Replies)
Discussion started by: jerardfjay
11 Replies

10. Shell Programming and Scripting

How to include RETURN KEY with Background process "&" in Shell Script

Hello All, I am a newbie in Shell script programming, and maybe you can help me with my query. I need to write a shell script (mntServer.ksh) that will start a background process and also to be able to run another script. The mntServer.ksh script contains: #!/bin/ksh... (1 Reply)
Discussion started by: racbern
1 Replies
Login or Register to Ask a Question