If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > How to pass a DB ORACLE value to a variable of OS(unix)

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-16-05, 09:52
ducasio ducasio is offline
Registered User
 
Join Date: Aug 2004
Location: Rome, Italy
Posts: 81
How to pass a DB ORACLE value to a variable of OS(unix)

Hi guys,
I have a problem. Actually I must receive the value of a variable(UNIX) from a table. How can I do it? More simply:
I have the table which has the value 200403 in default DB of the system. How can I pass this value to a local variable in unix script?

Thanks in advance,
ducasio
Reply With Quote
  #2 (permalink)  
Old 02-16-05, 10:46
gomes009 gomes009 is offline
Registered User
 
Join Date: Feb 2004
Posts: 37
Code:

VAR=`$ORACLE_HOME/bin/sqlplus -s un/pwd@db <<EOF
whenever sqlerror exit 1
set escape off
set head off
set verify off
select to_char(SYSDATE,'YYYY-MM-DD') from dual;
EOF
`

Last edited by gomes009; 02-16-05 at 10:52.
Reply With Quote
  #3 (permalink)  
Old 02-16-05, 11:17
ducasio ducasio is offline
Registered User
 
Join Date: Aug 2004
Location: Rome, Italy
Posts: 81
great, it works,
thanks a lot.

ducasio
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On