Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
How to connect oracle from unix script? I am updating one column of table emp from unix script. for example: table is emp. I am updating table for the column salary where emp_id is PK. How could i do this? Any help guys? Thanks in advance
You need to take care of the environment variables like export ORACLE_HOME and PATH etc. properly. And then invoke SQLPLUS.
ORACLE_HOME
PATH
SQLPLUS
For example,
#!/bin/ksh sqlplus -s /nolog << EOF CONNECT user/password@service_name update table set column = ....; EXIT; EOF
Add a comment
Download sqlplus and follow this tutorial.
A sample script would something look like so
CONNECT user/password(@servicename if using a pluggable database) ALTER TABLE Emp PRIMARY KEY (emp_id)/*Or whatever updates you want here*/ EXIT;
Required, but never shown
By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.