Difference between revisions of "SQLCODE"
From Recital Documentation Wiki
		
		
		
| Yvonnemilne  (Talk | contribs) | Yvonnemilne  (Talk | contribs)  | ||
| (4 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 | ||
| Line 19: | Line 12: | ||
| ==Description== | ==Description== | ||
| − | + | SQLCODE will return a number indicating the result of the last SQL statement.  SQLCODE return values: | |
| − | + | ||
| − | + | ||
| − | + | ||
| − | SQLCODE return values: | + | |
| Line 32: | Line 21: | ||
| |0||The SQL statement completed successfully | |0||The SQL statement completed successfully | ||
| |- | |- | ||
| − | |+100||No rows were found or the end of the set reached | + | |<nowiki>+100</nowiki>||No rows were found or the end of the set reached | 
| |- | |- | ||
| |<0||An error occurred | |<0||An error occurred | ||
| Line 41: | Line 30: | ||
| ==Example== | ==Example== | ||
| <code lang="recital"> | <code lang="recital"> | ||
| − | / | + | set gateway to "rec@server1:user1/pass1-southind" | 
| − | + | SELECT * FROM example WHERE state = "MA" | |
| − | + | ? sqlcode | |
| − | SELECT  | + |          0 | 
| − | FROM  | + | |
| − | WHERE  | + | |
| − | + | ||
| − | + | ||
| − | + | ||
| − | + | ||
| </code> | </code> | ||
| ==Products== | ==Products== | ||
| − | Recital  | + | Recital, Recital Server | 
| [[Category:Documentation]] | [[Category:Documentation]] | ||
| [[Category:SQL]] | [[Category:SQL]] | ||
| [[Category:Pseudo Columns]] | [[Category:Pseudo Columns]] | ||
Latest revision as of 15:03, 5 July 2011
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
set gateway to "rec@server1:user1/pass1-southind" SELECT * FROM example WHERE state = "MA" ? sqlcode 0
Products
Recital, Recital Server
