9. Understanding .NET Data Provider Connectivity : How Database Procedures Are Called : Row Producing Procedures
 
Share this page                  
Row Producing Procedures
The result-set from Ingres row-producing database procedures can be read by the .NET Data Provider like any other result set.
If the database procedure was defined as:
create procedure myrowproc
   result row(char(32)) as
      declare tabname char(32);
begin
   for select table_name into :tabname from iitables
   do
      return row(:tabname);
   endfor;
end;
The application code fragment to read the result set might be:
IngresCommand cmd = new IngresCommand(
   "myrowproc", conn);
cmd.CommandType = CommandType.StoredProcedure;
IDataReader reader = cmd.ExecuteReader();
 
while (reader.Read())
{
   Console.Write(reader.GetString(0));
}
 
Console.WriteLine();
reader.Close();