Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to read contents of local file and store in the table in shell script

dd_ramJun 17 2016 — edited Jun 18 2016

Hi,

We use GIT bash, so it let us write shell scripts on our windows machine and execute them as in Linux.

We got a requirement where we need to read the file from GIT directory on our local machine and insert its contents into oracle table.

We wrote a shell script which reads the contents of the file and assign them to a shell variable and then opens Sqlplus session and pass the shell variable as an argument like:

sqlplus $Connect_string @sql_file.sql $shell_variable

It works great as long as the length of the content is < 2500 chars. But the file would have > 2500 chars. Is there anyway to achieve it?

Thanks,

DD.

This post has been answered by Barbara Boehmer on Jun 17 2016
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 16 2016
Added on Jun 17 2016
25 comments
5,962 views