![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to handle multiple rows in a file | ksmbabu | Shell Programming and Scripting | 2 | 05-14-2008 09:44 PM |
| flexible sed command needed to handle multiple input types | SiftinDotCom | Shell Programming and Scripting | 2 | 03-19-2008 12:39 PM |
| Handle Configuration File with same name of Parameter in multiple Sections | potro | Shell Programming and Scripting | 7 | 03-05-2008 07:36 AM |
| a bit tricky to change it multiple rows in one row and ... | netbanker | Shell Programming and Scripting | 2 | 12-31-2007 09:48 PM |
| Output Multiple Field from dataBase file | Dennz | UNIX for Dummies Questions & Answers | 3 | 09-01-2003 09:41 AM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Hi All,
I have problem with database validations, actually my requirement is, my code will generate some seqno;s, which i have to check in database, whether the generated seqno;s are present in database or not, if the generated seqno;s are present in the database means, i need to generate new seqno;s skipping the found seqno;s in database, for this i have written code Code:
p_no_seqno=5
tempa=1
p_seqno=232123210123
while [ $tempa -le $p_no_seqno ]
do
p_seqno=`expr $p_seqno + 1`
if [ $tempa -lt $p_no_barcode ]; then
d_seqno="${d_seqno}${p_seqno}",""
else
d_seqno="${d_seqno}${p_seqno}"
fi
tempa=`expr $tempa + 1`
done
barc=`sqlplus -s scott/tiger << EOF
WHENEVER SQLERROR EXIT 1
SET FEEDBACK OFF VERIFY OFF HEAD OFF ECHO OFF
SET SERVEROUTPUT OFF TIMING OFF
SET PAGES 0
select seq_no from temp where seq_no in ($d_seqno);
exit
EOF`
echo $barc
If only one seqno or no seqno found in database means, No errors are displaying and the scripting is running fine If more than one seqno found in database means, It is showing the following error seq_no.ksh[56]: test: 0403-004 Specify a parameter with this command I tried store the values in a text file, but i am unable to retrieve the stored values by using the following code Code:
echo $barc > testing.txt 121313123123 123123123123 2342342342342 How to split the seqno;s and assign them to a array or variable Thanks in Advance |
| Forum Sponsor | ||
|
|
|
|||
|
Quote:
Quote:
Code:
index=0 for str in $barc do arr[$index]=$str (( index=index+1 )) done |
|
|||
|
Quote:
Code:
if [ $tempa -lt $p_no_barcode ]; then
d_seqno="${d_seqno}${p_seqno}",""
Does the variable p_no_barcode has a value or is it null ? |
|||
| Google UNIX.COM |
| Thread Tools | |
| Display Modes | |
|
|