UL 拡張:SQL SELECT 文を実行し、ULResultSet として結果セットを返します。
Visual Basic Public Function ExecuteResultSet() As ULResultSet
C# public ULResultSet ExecuteResultSet();
ULResultSet オブジェクトとして返される結果セット。
この文は、必要に応じて ULCommand.CommandText と ULCommand.Parameters が指定された、現在の ULCommand オブジェクトです。ULResultSet オブジェクトは、位置付け更新や削除の実行対象となる編集可能な結果を表します。編集可能な結果セットには、ULCommand.ExecuteTable() または ULDataAdapter を使用します。
ULCommand.CommandType が System.Data.CommandType.TableDirect である場合、ExecuteReader は ULCommand.ExecuteTable() を実行し、ULResultSet としての ULTable ダウンキャストを返します。
ULCommand.ExecuteResultSet は、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(); |
Copyright © 2009, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.1 |