Difference between revisions of "CLEARRESULTSET()"

From Lianjapedia
Jump to: navigation, search
m (1 revision: SQL)
 
Line 1: Line 1:
 
==Purpose==
 
==Purpose==
 
Function to clear the marker from an SQL cursor previously marked as a resultset
 
Function to clear the marker from an SQL cursor previously marked as a resultset
 
  
 
==Syntax==
 
==Syntax==
 
CLEARRESULTSET()
 
CLEARRESULTSET()
 
  
 
==See Also==
 
==See Also==
Line 14: Line 12:
  
 
CLEARRESULTSET() will return the workarea number of the SQL cursor from which the marker was cleared, or 0 (zero) if no SQL cursor was marked as a resultset.
 
CLEARRESULTSET() will return the workarea number of the SQL cursor from which the marker was cleared, or 0 (zero) if no SQL cursor was marked as a resultset.
 
  
 
==Example==
 
==Example==
Line 32: Line 29:
 
close databases
 
close databases
 
</code>
 
</code>
 
+
 
+
==Products==
+
Recital Server, Recital
+
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Functions]]
 
[[Category:Functions]]
 
[[Category:SQL]]
 
[[Category:SQL]]

Latest revision as of 07:45, 7 December 2012

Purpose

Function to clear the marker from an SQL cursor previously marked as a resultset

Syntax

CLEARRESULTSET()

See Also

GETRESULTSET(), SELECT, SETRESULTSET()

Description

The CLEARRESULTSET() function clears the marker from an SQL cursor previously marked as a resultset by the SETRESULTSET() function. The SETRESULTSET() function is particularly used in returning a resultset from a stored procedure in SQL client/server applications.

CLEARRESULTSET() will return the workarea number of the SQL cursor from which the marker was cleared, or 0 (zero) if no SQL cursor was marked as a resultset.

Example

function GetExampleCursor
  lparameters lcAccountNo
  select * from example where account_no = lcAccountNo into cursor curExample
return setresultset("curExample")
 
open database southwind
GetExampleCursor("00050")
select * from curexample
? "Cleared resultset marker in work area #" + ltrim(str(clearresultset()))
? iif(getresultset() > 0,"Resultset available in work area #" + ltrim(str(getresultset())),;
       "No resultsets available")
?
close databases