Handling SQL prompt through Perl expect module


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Handling SQL prompt through Perl expect module
# 1  
Old 12-17-2010
Handling SQL prompt through Perl expect module

Hi All,

I have a doubt whether expect module in perl will work in SQL prompt or its applicable only for shell prompt ?

Thanks,
Arun V
# 2  
Old 12-17-2010
Expect will work with any prompt you throw at it, as long as you can properly define it. But for SQL operations I'd rather suggest using DBI instead.
This User Gave Thanks to pludi For This Post:
# 3  
Old 12-17-2010
Thanks Pludi
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Expect script not expecting the password prompt

I have a script that does an SSH into a remote node. It should expect the prompt and send the password. #!/usr/bin/expect set user ; set pass ; spawn ssh $user@E-Internal expect { -re "RSA key fingerprint" {send "yes\r"} timeout... (1 Reply)
Discussion started by: Junaid Subhani
1 Replies

2. Shell Programming and Scripting

Expect prompt extending to next line

Hi guys, I am trying to install a software which is a shell script. I am using expect to do the silent installation. There is a strange line during the installation of the software like this below. The prompt goes to the next line. ENTER AN ABSOLUTE PATH, OR PRESS <ENTER> TO ACCEPT THE... (0 Replies)
Discussion started by: kapkap
0 Replies

3. Shell Programming and Scripting

Expect doesn't recognize a password prompt

Hi. Here is beginning of my script #!/usr/local/bin/expect -- set timeout 15 spawn /usr/local/account.sh -n modify expect "Password:" {send "mypassword\r"} But due to some terminal control sequences (or something else, dunno exactly) my password prompt is looking like this: and expect... (3 Replies)
Discussion started by: urello
3 Replies

4. Shell Programming and Scripting

Expect Script Error Handling

Good Day Everyone, I was hoping to get a little insight into an expect script that I've written. Basically we have this expect script to perform an sftp upload, key authentication is not an option, and sftp is the only method supported by our vendor, thus the need for this. I want to be... (3 Replies)
Discussion started by: thaller
3 Replies

5. Shell Programming and Scripting

calling perl subroutine from perl expect module

All, Is it possible to call a subroutine from the perl expect module after logging to a system that is within the same program. My situation is I need to run a logic inside a machine that I'm logging in using the expect module, the logic is also available in the same expect program. Thanks,... (5 Replies)
Discussion started by: arun_maffy
5 Replies

6. Shell Programming and Scripting

shell scripting using expect module

Hi, I have got the success in running script using expect module.It is connecting to the remote host but not able to change the password.Please let me know how I can finish this task.Thanks in Advance!! OUTPUT: Server1 $ passwd Changing password for dbaguest Old password: + read line Main... (0 Replies)
Discussion started by: manish_1678
0 Replies

7. Shell Programming and Scripting

Expect, save to file and remove before prompt

I have an Expect script which works very well. It logs into my remote routers and runs some commands and then to the next until finished. I need two things, first I need to save the output to a file from where the log_user 1 begins. expect << EOF set timeout 15 #set var "exit " match_max... (1 Reply)
Discussion started by: numele
1 Replies

8. Shell Programming and Scripting

Expect Script square bracket dollar prompt

Hi Thanks for this amazing forum first, I've been searching answers in it for problems that I've encountered at work. The only problem I haven't been able to find a fix for, is a ever waiting for prompt problem in Expect when encounter a $ prompt. I usually set the timeout to -1 cause the... (2 Replies)
Discussion started by: Ikaro0
2 Replies

9. Shell Programming and Scripting

Remover Banner and SQL prompt from isql

Hi, I am using isql and putting the output in a file in a shell script in Linux. However in my output i am getting the banner and a SQL prompt(at the start and the end of query output) +---------------------------------------+ | Connected! | | ... (6 Replies)
Discussion started by: lifzgud
6 Replies

10. Shell Programming and Scripting

handling Multiline SQL outputs

Hi, I'm using KSH and calling a SQL statement inside my script which returns more than 1 record. Result=`sqlplus -s $DB_USER/$DB_PWD@$DB_STRING <<END set echo off set head off spool junk.txt select Name from abc where job = 'Manager'; spool off exit; END` echo $Result The above... (5 Replies)
Discussion started by: decci_7
5 Replies
Login or Register to Ask a Question