Difference between revisions of "SQLCODE"

From Lianjapedia
Jump to: navigation, search
 
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
==Purpose==
 
==Purpose==
 
Return a number indicating the result of the last SQL statement
 
Return a number indicating the result of the last SQL statement
 
  
 
==Syntax==
 
==Syntax==
 
SQLCODE
 
SQLCODE
 
  
 
==See Also==
 
==See Also==
 
[[PSEUDO COLUMNS]], [[SQL INSERT|INSERT]], [[SQL SELECT|SELECT]], [[SQL UPDATE|UPDATE]]
 
[[PSEUDO COLUMNS]], [[SQL INSERT|INSERT]], [[SQL SELECT|SELECT]], [[SQL UPDATE|UPDATE]]
 
  
 
==Description==
 
==Description==
 
SQLCODE will return a number indicating the result of the last SQL statement.  SQLCODE return values:
 
SQLCODE will return a number indicating the result of the last SQL statement.  SQLCODE return values:
  
 
+
{| class="wikitable" width="100%"
 
+
{| class="wikitable"
+
 
!SQLCODE||Description
 
!SQLCODE||Description
 
|-
 
|-
Line 26: Line 21:
 
|-
 
|-
 
|}
 
|}
 
  
 
==Example==
 
==Example==
 
<code lang="recital">
 
<code lang="recital">
set gateway to "rec@server1:user1/pass1-southind"
 
 
SELECT * FROM example WHERE state = "MA"
 
SELECT * FROM example WHERE state = "MA"
 
? sqlcode
 
? sqlcode
Line 36: Line 29:
 
</code>
 
</code>
  
 
==Products==
 
Recital, Recital Server
 
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:SQL]]
 
[[Category:SQL]]
[[Category:Pseudo Columns]]
 

Latest revision as of 09:53, 4 February 2013

Purpose

Return a number indicating the result of the last SQL statement

Syntax

SQLCODE

See Also

PSEUDO COLUMNS, INSERT, SELECT, UPDATE

Description

SQLCODE will return a number indicating the result of the last SQL statement. SQLCODE return values:

SQLCODE Description
0 The SQL statement completed successfully
+100 No rows were found or the end of the set reached
<0 An error occurred

Example

SELECT * FROM example WHERE state = "MA"
? sqlcode
         0