Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

db2_stmt_error(3) [php man page]

DB2_STMT_ERROR(3)							 1							 DB2_STMT_ERROR(3)

db2_stmt_error - Returns a string containing the SQLSTATE returned by an SQL statement

SYNOPSIS
string db2_stmt_error ([resource $stmt]) DESCRIPTION
Returns a string containing the SQLSTATE value returned by an SQL statement. If you do not pass a statement resource as an argument to db2_stmt_error(3), the driver returns the SQLSTATE value associated with the last attempt to return a statement resource, for example, from db2_prepare(3) or db2_exec(3). To learn what the SQLSTATE value means, you can issue the following command at a DB2 Command Line Processor prompt: db2 '? $sqlstate- value'. You can also call db2_stmt_errormsg(3) to retrieve an explicit error message and the associated SQLCODE value. PARAMETERS
o $stmt - A valid statement resource. RETURN VALUES
Returns a string containing an SQLSTATE value. SEE ALSO
db2_conn_error(3), db2_conn_errormsg(3), db2_stmt_errormsg(3). PHP Documentation Group DB2_STMT_ERROR(3)

Check Out this Related Man Page

INGRES_ERRSQLSTATE(3)							 1						     INGRES_ERRSQLSTATE(3)

ingres_errsqlstate - Get the last SQLSTATE error code generated

SYNOPSIS
string ingres_errsqlstate ([resource $link]) DESCRIPTION
Returns a string containing the last SQLSTATE, or NULL if no error has occurred. If a $link resource is passed to ingres_errsqlstate(3), it returns the last error recorded for the link. If no link is passed, then ingres_errsqlstate(3) returns the last error reported using the default link. The function, ingres_errsqlstate(3), should always be called after executing any database query. Calling another function before ingres_errsqlstate(3) is called will reset or change any error message from the last Ingres function call. PARAMETERS
o $link - The connection link identifier RETURN VALUES
Returns a string containing the last SQLSTATE, or NULL if no error has occurred. EXAMPLES
Example #1 Get the last SQLSTATE error code generated <?php $link = ingres_connect($database, $user, $password); $result = ingres_query($link, "select * from table"); $error_sqlstate = ingres_errsqlstate($link); if (!is_null($error_sqlstate)) { echo "An error occurred - " . $error_sqlstate; } ?> SEE ALSO
ingres_errno(3), ingres_error(3), ingres_next_error(3). PHP Documentation Group INGRES_ERRSQLSTATE(3)
Man Page

15 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Do statement

Hi, I am trying with do ...done loop command, but i am getting error.. can u give me an example so that i can be clear of the thing,, and while statement also.. (7 Replies)
Discussion started by: vasikaran
7 Replies

2. Shell Programming and Scripting

Use of GOTO statement in scripts

Hey Guys.. I just want to know how to use Goto statement in shell scripts. I know the basic use of statement. Goto Label The above statement will search for some label which must be defined in the script itself as: label: I tried these combinations but I didn't work out for me and I'm... (7 Replies)
Discussion started by: vikasduhan
7 Replies

3. UNIX for Dummies Questions & Answers

find and replace

I have statement like this column_id.columnname=="value" in unix i want to modify above statement to variable1=="value" that means i have to replace the string before "==" by string "variable1" second catch is, in statement instead of "==" you can have any arithmatic comarision... (7 Replies)
Discussion started by: mahabunta
7 Replies

4. Shell Programming and Scripting

wildcards with if statement?

Hello i am trying to use the wildcards with the if statement but it is displaying the error like this one if * | ** | * ] Any body can help me to for using the wild card option in the if case but i have used this code and working well with the case statement to enter the name without the... (14 Replies)
Discussion started by: murtaza
14 Replies

5. Linux

error in if statement

Hi , I am getting an error when I run the script for checking word "view" in a file . I am using if statement. like this if then VW_VAR=` cat $TN.${ecmdate}.sql1 | grep -i view | awk '{print $3}' | cut -d '.' -f2 ` echo " VW_$VW_VAR " sed -e... (16 Replies)
Discussion started by: capri_drm
16 Replies

6. Shell Programming and Scripting

if statement

I am having problem writing the following script, this is more like a boolean case where i need to check for existance of a string in a file and if it exist i have to do certain things. If ( such string exist in a file) sed 's/car/bus/g' file else do something else. (7 Replies)
Discussion started by: ROOZ
7 Replies

7. Shell Programming and Scripting

Sed if statement (totally stuck) apache

I have a irritating problem with a "if"-statement or what you should call it, in sed. I would love some help here since I am very, very stuck. I have this statement that I want to do: if line contains a: do this if none of the lines contained a: do this The problem with this... (8 Replies)
Discussion started by: hjalle
8 Replies

8. Shell Programming and Scripting

IF statement failure

Hi Guys, i have a variable which hold a string value of "in" when i try to compare this value against another value the if statement is not working. $a=in if then echo "Not a Walid match" else echo "Walid Match" fi Thank You. (9 Replies)
Discussion started by: nitinrp1
9 Replies

9. Shell Programming and Scripting

Pass a DDL statement to a KSH script

I need to pass a DDL statement into a ksh script & parse the statement. What is the best way to pass a DDL statement into a KSH script. ---------- Post updated at 09:28 AM ---------- Previous update was at 07:35 AM ---------- if the name of the script is test.ksh test.ksh "ALTER TABLE... (12 Replies)
Discussion started by: gayathree
12 Replies

10. Shell Programming and Scripting

Dates not comparing correct even the same format

I have the date of the file passed into a variable also current date formatted same passed into a separate variable and compare the two with an if statement and statement always comes up false. Even though I verified the dates. Any help would be awesome. Filecrtdate=`ls -l $i | awk '{print... (19 Replies)
Discussion started by: coderanger
19 Replies

11. Shell Programming and Scripting

Multiple conditions in a CASE statement

is it possible to use multiple conditions in a CASE statement? And if so, what is the syntax? I'm trying to use one but can't seem to get it right. I want the statement to be CASE $vendor OR $alias condition 1) statements; condition 2) statements; etc. esac but I keep... (25 Replies)
Discussion started by: Straitsfan
25 Replies

12. Shell Programming and Scripting

if statement with '&&' gives error

Hi, I'm using the && operator in if statement: if ; then exp $UID/$PWD@$ORACLE_SID FILE=./DUMP/$TODAY$CONCAT_STR$USERNAME.dmp STATISTICS=NONE LOG=./LOG/$TODAY$CONCAT_STR$USERNAME.log elif ; then expdp $UID/$PWD@$ORACLE_SID DIRECTORY=./DUMP/ DUMPFILE=$TODAY$CONCAT_STR$USERNAME.dmp... (8 Replies)
Discussion started by: priya001
8 Replies

13. UNIX for Dummies Questions & Answers

What is the meaning of "-s" option in "if" statement?

Hi Guys, I'm sorry but I can't find answer for this, what is the meaning of -s option in "if" statement on unix scipting. Please see sample below: opath=/home/output for i in N1 N2 N3 N4 do echo $i if then grep $i $opath/N5_CRAI > $opath/N5_$i.crai chmod 777 $opath/N5_$i.crai ... (7 Replies)
Discussion started by: rymnd_12345
7 Replies

14. Shell Programming and Scripting

Dynamic case creation based on output list from a command

I am attempting to create a script that would allow me to list all the instances associated with a DB2 and then prompt the user to choose which one to issue the db2profile command against. I use the db2 command db2ilist to get a list of the instances for a particular server, but the number of... (7 Replies)
Discussion started by: slatoms
7 Replies

15. Shell Programming and Scripting

Extracting vaules from end of string

I'm trying to write a script which will calculate percentages from a printer. I have a command snmpwalk -v1 -c public 192.168.0.20 1.3.6.1.2.1.43.11.1.1.9.1.1 which returns (current ink level): iso.3.6.1.2.1.43.11.1.1.9.1.1 = INTEGER 235 then a similar command which returns similar output but... (7 Replies)
Discussion started by: leshy93
7 Replies