Sponsored Content
Full Discussion: sql error code trapping
Top Forums Shell Programming and Scripting sql error code trapping Post 10938 by xiamin on Sunday 25th of November 2001 11:52:45 PM
Old 11-26-2001
Hello

When i try to excute the script i get the following

sqlplus -s scott/tiger
XX EOF |grep [O]RA | uniq|cut -f1 -d : select Mail creF

my oracle database is up and running .i connect as scott tiger

it is obvious here to me that i am unanle to capture the error code into variable x am i right ?

regards
Hrishy

Last edited by xiamin; 11-26-2001 at 01:03 AM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

ftp error trapping

Hi I'm hoping I could get some help on the following. I'm writing a script which will in turn create an ftp script then excecute it. eg echo "user $user $pass" > $script echo "cd $remote_dir" >> $script echo "bi" >> $script echo "mput $file" >> $script echo "bye" >> $script ftp -n -i $ip... (1 Reply)
Discussion started by: Bab00shka
1 Replies

2. UNIX for Dummies Questions & Answers

ftp error trapping

I have written a UNIX script that will automatically ftp a file to a server. The problem is when I missed enter information w/in the .txt file that contains the userid/password and what file to transfer, I had no way of capturing the failuer of the file transfer. I verified w/in the script that the... (1 Reply)
Discussion started by: dhawkjrscripter
1 Replies

3. Shell Programming and Scripting

Error Trapping

Hi, Can anybody tell me how to error trap an empty line. If i am asked for a password and I hit enter without entering any text, how do i display an error? Thanks Kev (6 Replies)
Discussion started by: kev112
6 Replies

4. Shell Programming and Scripting

rcp error trapping in rsh

I am writing a program which is something like below: rsh host1 "rcp file dest:directory" I am running this script from a machine host2. host1 has rlogin configuration for host2. but, dest machine has no rlogin configuration for host1 and fails on remote calls. Could anyone tell me how... (2 Replies)
Discussion started by: vvejendla
2 Replies

5. Shell Programming and Scripting

trapping error for a grep in for a loop

How can I trap and print "cannot find the pattern" when the grep is unable to find the specified pattern in the file using the for loop below ? Any help would be appreciated. bash3.4> cat test_file apple orange pineapple blackberry script: for x in `grep -n "mango" test_file... (4 Replies)
Discussion started by: jville
4 Replies

6. Shell Programming and Scripting

curl error trapping in ksh

I hope that I can trap curl errors, and have my shell script error out and quit if curl has any sort of problem. For example, I have the following command in my shell script: curl --trace -n -v --ftp-ssl ftp://xxx.xxx.xxx.xxx:2122 --user user:password -o /tmp/file.txt Works great, except... (2 Replies)
Discussion started by: prestonatwork
2 Replies

7. Shell Programming and Scripting

Trapping program return code

Hello I have a program (prog) that accepts a parameter in order to execute some internal loop grabbing memory in each iteration. I'm using top to monitor the memory usage and to produce an output. Thus I need the program's pid as a parameter to top. I capture pid using myPID=$!. I'm also... (5 Replies)
Discussion started by: pavlosgr
5 Replies

8. UNIX for Advanced & Expert Users

How to Make Sql Plus Exit with an Error Code

Dear all, How to make sqlplus command to exit with an apt error code in bash script, It always returns 0 for me. Thanks (9 Replies)
Discussion started by: vetrivendhan
9 Replies

9. Shell Programming and Scripting

Error Trapping

Hi, I have one shell script as below while read SegList do if test -s ${SourceFile_Path}/${Segment_List_Temp} then ls -r -1 ${FTP_Path}/${SegList}.DAT.${Datelist}.GZ|cut -d '.' -f2>>${SourceFile_Path}/${List_Temp} echo "IF above statment Fail I want to Create Emtpy File How to Trapp... (3 Replies)
Discussion started by: samadhanpatil
3 Replies

10. Shell Programming and Scripting

Trapping the error during copy

I have a requirement: During copy command for example: cp -rf <sourceDir> <destinationDir> this command may fails for many reasons like: 1. source or destination directory does not exist 2. destination directory does not have sufficient space 3. directories are not mounted ... Or may... (3 Replies)
Discussion started by: ambarginni
3 Replies
iodbctest(1)						       iODBC Driver Manager						      iodbctest(1)

NAME
iodbctest, iodbctestw - iODBC Demonstration programs SYNOPSIS
iodbctest ["DSN=xxxx[;UID=xxxx][;PWD=xxxx][;OPT=value]"] iodbctestw ["DSN=xxxx[;UID=xxxx][;PWD=xxxx][;OPT=value]"] DESCRIPTION
The iodbctest program and iodbtestw programs are simple ODBC sample programs, showing the strength of the ODBC API to connect to any ODBC enabled database, issue SQL commands and retrieve the query results. The iodbctest program uses the standard ODBC API calls to connect using any DSN, but retrieves all results in ASCII mode. The iodbctestw program uses the ODBC Unicode API calls to connect using any DSN, and retrieves all results in Unicode mode. OPTIONS
The iodbctest program uses the SQLDriverConnect function to make a connection using any available ODBC compliant driver. This allows the user to override any ODBC connect attribute in the DSN string. Connect strings should start with either a DSN=xxx or a DRIVER=xxxx attribute optionally followed by other DSN attributes separated by a semicolon e.g: DSN=ora9;UID=scott;PWD=tiger;DATABASE=ora9u Any attributes required for a proper connection that are not entered in the DSN connect string, must be present in the odbc.ini file. If the connect string is passed as an argument to the iodbctest program, the string should be quoted as most shells use the semicolon as their command separator. If the connect string is entered on the interactive prompt, no quotes should be used. After a successful connection has been established, the user is prompted for a SQL command to be send to the database. A SQL command cannot span multiple lines. If the SQL command returns one or more result sets, each result set is fetched using character buffers and displayed in a table. Additionally, the iodbctest program understands a few special commands: qualifiers Show a list of qualifiers using the SQLTables catalog call. owners Show a list of owners using the SQLTables catalog call. tables Show a list of tables using the SQLTables catalog call. types Show a list of tables types using the SQLTables catalog call. datatypes Show a list of data types using the SQLGetTypeInfo catalog call. reconnect Perform a disconnect/reconnect with the information saved during the first SQLDriverConnect. quit (or exit) Exit the program and return to the shell. EXAMPLES
Start the iodbctest program and get a list of DSNs before making a connection: $ iodbctest OpenLink ODBC Demonstration program This program shows an interactive SQL processor Enter ODBC connect string (? shows list): ? DSN | Driver ----------------------------------------------------------------- ora9 | OpenLink Generic ODBC Driver mysql | OpenLink Generic ODBC Driver mysqllite | OpenLink Lite for MySQL myodbc | MyODBC Driver pgsql | OpenLink Generic ODBC Driver tds | OpenLink Generic ODBC Driver Enter ODBC connect string (? shows list): DSN=ora9;PWD=tiger Driver: 05.20.0316 OpenLink Generic ODBC Driver (oplodbc.so) SQL> Connect to an Oracle 9 instance which has been previously setup in the odbc.ini file: $ iodbctest "DSN=ora9;UID=scott;PWD=tiger" iODBC Demonstration program This program shows an interactive SQL processor Driver: 05.20.0316 OpenLink Generic ODBC Driver (oplodbc.so) SQL>select * from emp ID |NAME -----------------+------------------------------------------- 1 |Record 1 2 |Record 2 2 |Record 3 result set 1 returned 3 rows. SQL> quit COPYRIGHT
Copyright (C) 1996-2009 by OpenLink Software AUTHOR
iODBC Administrator <iodbc@openlinksw.com> 3.52.7 3 August 2005 iodbctest(1)
All times are GMT -4. The time now is 01:32 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy