Re: Retrieving multiple rows into a Pro*C program
Date: Tue, 1 Nov 1994 22:37:17 GMT
Message-ID: <CyM1I6.4Lr_at_wtc35a.DaytonOH.NCR.COM>
>In article <CyLxtI.3Lo_at_wtc35a.DaytonOH.NCR.COM> Dana Schoonover writes:
>What is the best way for a Pro*C program to retrieve an entire row(s) from a
>table with a large number of columns(36)?
Some RDBMS pre-compilers (Ingres and Teradata for example) allow this sort of embedded select:
EXEC SQL SELECT *
INTO :single_host_variable_that_is_a_structure_you_defined
FROM table;
I think the best way, as dreary as it seems, is:
EXEC SQL SELECT col2, col2, ... col36
INTO :host1, :host2, ... :host36
FROM table;
If you want to bring back multiple rows, each of the host variables can be declared as arrays.
>We've considered using a stored procedure, but haven't found the correct
>host-variable datatype to use as a parameter to receive a cursor%ROWTYPE.
I would claim that you haven't found the correct host-variable datatype because there isn't one. Received on Tue Nov 01 1994 - 23:37:17 CET