UL Ext.: Executes a SQL SELECT statement and returns the result set as a ULResultSet.
Visual Basic Public Function ExecuteResultSet() As ULResultSet
C# public ULResultSet ExecuteResultSet();
The result set as a ULResultSet object.
The statement is the current ULCommand object, with the ULCommand.CommandText and any ULCommand.Parameters as required. The ULResultSet object is an editable result set on which you can perform positioned updates and deletes. For fully editable result sets, use ULCommand.ExecuteTable() or a ULDataAdapter.
If the ULCommand.CommandType is System.Data.CommandType.TableDirect, ExecuteReader performs an ULCommand.ExecuteTable() and returns a ULTable downcast as a ULResultSet.
ULCommand.ExecuteResultSet supports positioned updates and deletes with Dynamic SQL.
cmd.CommandText = "SELECT id, season, price FROM OurProducts"; ULResultSet rs = cmd.ExecuteResultSet(); while( rs.Read() ) { string season = rs.GetString( 1 ); double price = rs.GetDouble( 2 ); if( season.Equals( "summer" ) && price < 100.0 ) { rs.SetDouble( 2, price * .5 ); rs.Update(); } if( season.Equals( "discontinued" ) ) { rs.Delete(); } } rs.Close(); |
Discuss this page in DocCommentXchange. Send feedback about this page using email. |
Copyright © 2009, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.1 |