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!

Input Return Key In A Sql script

user13322572Jul 21 2016 — edited Jul 21 2016

Hello,

I have a sql script which when run prompts me to input a value, if i don't input any value and press the enter/return key it will select the default value and will pull all the records. I am trying to incorporate this into a shell script where i don't want the script to prompt me for any value and should just accept the "return key" by default. Is there a way i can do this ?

Eg of what i'm trying to do.

"in_code" is the variable in the the execute.sql which accepts a value. I want this variable to select the "enter/return" key by default. The code i use below doesn't work.

#! /bin/bash

sqlplus -s xxx/xxx<<!

define in_code='echo -e "\n"'

@execute.sql

exit

!

Any help will be appreciated.

Thanks.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 18 2016
Added on Jul 21 2016
6 comments
921 views