Search Results

Search: Posts Made By: shrutihardas
12,997
Posted By shrutihardas
Thanks this helped.
Thanks this helped.
6,802
Posted By shrutihardas
multiple conditions in 'if clause'
Hi,

When i use the below code snippet in my shell script OFC_10.sh:

if [ "$sync_cmpl" = "Y" && "$sync_glbl" = "Y" ]
then
echo "Success"
exit 2
elif [ "$sync_cmpl" = "Y" && ...
12,997
Posted By shrutihardas
Hi All, A quick question - How does the...
Hi All,
A quick question -

How does the sed command actually works? I fail to understand its functionality.
For ex -

value= ' no rows selected'
val=$(echo $value |sed 's/ no/no/g' )
echo...
5,945
Posted By shrutihardas
I am sorry - There is a typo in the queries i...
I am sorry - There is a typo in the queries i pasted - Please ignore the keyword 'max' before to_char.

Thanks,
Shruti
5,945
Posted By shrutihardas
Nested SQL queries within Shell script
Hi,

Would someone know if I can fire nested sql queries in a shell script? Basically what I am trying to do is as follows:

my_sql=$(sqlplus -s /nolog<<EOF|sed -e "s/Connected. *//g"
connect...
12,997
Posted By shrutihardas
Thanks all for your valuable suggestions. I was...
Thanks all for your valuable suggestions. I was able to remove the leading spaces by using the following code provided by curleb -

val=$(echo $value |sed 's/ no/no/g' )

Thanks once again!
12,997
Posted By shrutihardas
@curleb - Thanks a ton! The command provided by...
@curleb - Thanks a ton! The command provided by you above worked like a charm.

I have a question though - How do I know if i have to enclose my command in $(...)? The way commands are to be used -...
12,997
Posted By shrutihardas
@tukuyomi - when i try the code provided by...
@tukuyomi - when i try the code provided by you...as follows -


value=" no rows selected"
val=$(echo "$value" | sed 's/^\ *//g')
echo output="$val"

I get the response as follows:

output=...
12,997
Posted By shrutihardas
@curleb - I have stored my string with leading...
@curleb - I have stored my string with leading spaces in a variable and when i try to use the command provided by you above...it returns a blank....i mean it does not return an output at all -

...
12,997
Posted By shrutihardas
Remove spaces in the beginning of a string
Hi,

I am trying to remove spaces from the beginning of a string (which i am using in my shell script). For ex - my string looks like this -

" no rows selected"

and i want the string to look...
118,915
Posted By shrutihardas
Thanks a lot curleb! This code provided by...
Thanks a lot curleb!

This code provided by you worked perfectly fine!

In the meanwhile i also tried another approach to truncate the string returned by sql by using the following:
...
118,915
Posted By shrutihardas
This is the final script which I am using now ...
This is the final script which I am using now

my_sql=$(sqlplus -s /nolog <<EOF
connect...
118,915
Posted By shrutihardas
I am sorry - The code provided by curleb actually...
I am sorry - The code provided by curleb actually works like a charm!

@curleb - Thanks a lot for your help!!

The code Does return a value for $my_sql variable. Now the only problem I am left...
118,915
Posted By shrutihardas
@curleb - Thanks a lot for your help!! The code...
@curleb - Thanks a lot for your help!! The code provided by you

my_sql=$(sqlplus -s /nolog <<EOF
connect...
118,915
Posted By shrutihardas
I am sorry I did not explain it clearly before: ...
I am sorry I did not explain it clearly before:

Yes, I was able to connect to the database from the Unix prompt and also I was able to run the following query successfully on the prompt. Please...
118,915
Posted By shrutihardas
@durden_tyler - I am able to establish a DB...
@durden_tyler - I am able to establish a DB connection now. Using the following command from Unix prompt:

sqlplus...
118,915
Posted By shrutihardas
1) echo $ORACLE_SID returns the following: ...
1) echo $ORACLE_SID returns the following:

bash: PHYGD1: command not found

where PHYGD1 is the correct SID.

2) tnsping to VOMSD1 returns OK

3) telnet to the server says 'Connected'
...
118,915
Posted By shrutihardas
Hi All, Thanks for your responses! As...
Hi All,

Thanks for your responses!

As per the suggestions below i thought of taking 1 step at a time by doing the following:

1. Checked all environment variables are set in my .bash_profile...
12,506
Posted By shrutihardas
Connecting to Oracle DB using sqlplus
Hi,

I am very new to shell scripting and trying to write a simple shell script in which i am trying to achieve the following:

1. Connect to oracle database hosted on a different server
2. fire...
118,915
Posted By shrutihardas
Connecting to Oracle DB using sqlplus
Hi,

I am very new to shell scripting and trying to write a simple shell script in which i am trying to achieve the following:

1. Connect to oracle database hosted on a different server
2. fire...
Showing results 1 to 20 of 20

 
All times are GMT -4. The time now is 02:52 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy