Oracle doc is not wrong. Nested table was used to also refer to kind of cursors.
SQLT_NCO is not meant to be used for binding host variable.
It it only used in type descriptors to indicate that an UDT is a Collection.
To bind a host variable that must receive a SQL collection (varray, nested table), use SQLT_NTY.
Have a look at the OCILIB source code for more information related to binding collections.
So the Nested table I quoted in the doc is not actually used to mean a table type below?
create type t_resultsetdata as object (
i int, d decimal, c varchar(10)
create type t_nested_resultsetdata as table of t_resultsetdata;
create function Blah return t_nested_resultsetdata is . . .
For this you are saying to use SQL_NTY and not SQL_NCO. Can you tell where this usage is documented, because ocidfn.h says
#define SQLT_NTY 108 /* named object type */ #define SQLT_NCO 122 /* named collection type (varray or nested table) */
Another question - Because of the original document I said I followed, I thought I could treat cursor and nested table similarly in the calling application, i.e. I could repeatedly do a fetch on the OCIStmt* which will be bound for nested table. Now from what you say I understand I can't really bind a OCIStmt* for nested table but have an object type. That means it will get all the data of that collection in one go, right? LIke I said, lack of examples is making this tough. I don't want to look into OCI source code, as that will be too much.