Sponsored Content
Top Forums Shell Programming and Scripting issues with sql inside if statement Post 302714571 by gary_w on Friday 12th of October 2012 10:04:48 AM
Old 10-12-2012
Please see my amended post above.
This User Gave Thanks to gary_w For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sql inside a script

Hi, In a KSH script i have to run a sybase query and get the count into a unix variable. How can i do that? Your help is much appriciated. Thanks, sateesh (4 Replies)
Discussion started by: kotasateesh
4 Replies

2. Shell Programming and Scripting

How to call an sql script inside a while statement in KSH

Hi all, I'm trying to run an sql inside a loop which looks like this #!bin/ksh while IFS=, read var1 var2 do sqlplus -s ${USERNAME}/${PASSWORD}@${ORACLE_SID} << EOF insert into ${TABLE} ( appt_date ) values ( '${var1 }' ); ... (6 Replies)
Discussion started by: ryukishin_17
6 Replies

3. Shell Programming and Scripting

how to pass a variable to an update sql statement inside a loop

hi all, i am experiencing an error which i think an incorrect syntax for the where clause passing a variable was given. under is my code. sqlplus -s ${USERNAME}/${PASSWORD}@${SID} << END1 >> $LOGFILE whenever sqlerror exit set serveroutput on size 1000000 declare l_rc ... (0 Replies)
Discussion started by: ryukishin_17
0 Replies

4. Shell Programming and Scripting

if inside while statement (PLZ HELP)

hey guys i need some help here i am trying to do a bash shell script to get a parent PID and then search for all childs and kill them all without killing the parent, my problem is in the loop it seems that i dont know how to make a if statment inside a while statment it does not give me what i... (5 Replies)
Discussion started by: q8devilish
5 Replies

5. Shell Programming and Scripting

Read from user inside a while statement

Hi there I want to ask to a user something about each line of a file. This is my code: #cat test.txt first line second line third line #cat test.sh #!/bin/ksh read_write () { echo "Do you want to print the line (YES/NO)?\n" read TEST case ${TEST} in YES) return 0;; ... (3 Replies)
Discussion started by: tirkha
3 Replies

6. Shell Programming and Scripting

Bash Script Issues (If statement for file copying)

Writing a bash script for use with Geektool, pulls the battery info, and shuffles images around so that an Image geeklet can display the correct expression as the desktop background. (Eventually I intend to make it more intricate, based on more variables, and add more expressions) I'm extremely... (1 Reply)
Discussion started by: The_Ardly374
1 Replies

7. Shell Programming and Scripting

Multiple conditions inside my if statement

Hello, I am using shell scripting and I am recieving odd results from my if statement if I want it to enter the loop only if L1 is equal to zero and one of the other criteria are filled, however it is entering at other times as well. What can i do to fix this? i tried seperating it... (6 Replies)
Discussion started by: ryddner
6 Replies

8. Shell Programming and Scripting

Use sqlplus statement inside case sentence

Hello, I have a problem. I want to launch a different sql queries for different shell parameter values, something like this. #/bin/bash case $1 in "A") sqlplus -s user/pass << SQL query A; SQL "B") sqlplus -s user/pass << SQL2 ... (3 Replies)
Discussion started by: Vares
3 Replies

9. Shell Programming and Scripting

Multiple conditions inside if statement

I was trying to write multiple conditions inside the if statement but its not working. export VAR_NM=abc.txt export CURR_DT=20131011 export PREV_DT=20131012 if && then echo "Yes" else echo "NO" fi It should return Yes but returning NO always.Appreciate any help. (3 Replies)
Discussion started by: dr46014
3 Replies

10. Shell Programming and Scripting

Command in inside awk statement

Hello can you please help me with below script which is meant to delete clients from multiple netbackup policies I want to run a command insdie awk statement apparelnlty this script is not working for me for i in $( cat clients_list) do bppllist -byclient $i | awk... (6 Replies)
Discussion started by: Sara_84
6 Replies
PDO.ERRORINFO(3)							 1							  PDO.ERRORINFO(3)

PDO
::errorInfo - Fetch extended error information associated with the last operation on the database handle SYNOPSIS
public array PDO::errorInfo (void ) DESCRIPTION
RETURN VALUES
PDO.errorInfo(3) returns an array of error information about the last operation performed by this database handle. The array consists of the following fields: +--------+---------------------------------------------------+ |Element | | | | | | | Information | | | | +--------+---------------------------------------------------+ | 0 | | | | | | | SQLSTATE error code (a five characters alphanu- | | | meric identifier defined in the ANSI SQL stan- | | | dard). | | | | | 1 | | | | | | | Driver-specific error code. | | | | | 2 | | | | | | | Driver-specific error message. | | | | +--------+---------------------------------------------------+ Note If the SQLSTATE error code is not set or there is no driver-specific error, the elements following element 0 will be set to NULL. PDO.errorInfo(3) only retrieves error information for operations performed directly on the database handle. If you create a PDOStatement object through PDO.prepare(3) or PDO.query(3) and invoke an error on the statement handle, PDO.errorInfo(3) will not reflect the error from the statement handle. You must call PDOStatement.errorInfo(3) to return the error information for an operation performed on a particular statement handle. EXAMPLES
Example #1 Displaying errorInfo() fields for a PDO_ODBC connection to a DB2 database <?php /* Provoke an error -- bogus SQL syntax */ $stmt = $dbh->prepare('bogus sql'); if (!$stmt) { echo " PDO::errorInfo(): "; print_r($dbh->errorInfo()); } ?> The above example will output: PDO::errorInfo(): Array ( [0] => HY000 [1] => 1 [2] => near "bogus": syntax error ) SEE ALSO
PDO.errorCode(3), PDOStatement.errorCode(3), PDOStatement.errorInfo(3). PHP Documentation Group PDO.ERRORINFO(3)
All times are GMT -4. The time now is 04:52 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy