delphi - Oracle OCI determine if field is NCLOB or CLOB -


i looking simple way determine if field in oracle nclob.

when perform attribute on field, 112 (sqlt_clob), regardless of whether or not field clob or nclob. here code snippet of talking about.

associated query: 'select data nclobtest2., data nclob in case.

            ... := 1 cmaxfields  begin   if oci.paramget( stmthandle, oci_htype_stmt, ferrhandle, @apdesc, ) <> oci_success     break; //at point apdesc refers field **data**.  while checkerror( oci.attrget( apdesc, oci_dtype_param, @apname, @anamesz, oci_attr_name, ferrhandle ) ) = oci_still_executing do;  //apname , anamesz, come 'data' , 8, respectively.  8 not 4, because it's unicode environment.  while checkerror( oci.attrget( apdesc, oci_dtype_param, @adbtype, nil, oci_attr_data_type, ferrhandle ) ) = oci_still_executing do;   dbtype := adbtype;  //here problem, adbtype sqlt_clob. 

is there no such thing sqlt_nclob? need know if field clob or nclob, can read n/clob later on. know can call lobcharsetform , lobcharsetid if have actual loblocator instance, require many steps.

thank you!

edit: here summary of steps take trying lobcharsetid when defining fields. similar code works find when binding parameters. maybe can tell me step(s) missing.

summary of coding steps:         checkerror( oci.handlealloc( envhandle, @fstmthandle, oci_htype_stmt, 0, nil ) );      //sse, allocating statement handle         checkerror( oci.stmtprepare( stmthandle, ferrhandle, pchar( serversql ), length( serversql )*sizeof(char), oci_ntv_syntax, oci_default ) );         while checkerror( oci.attrget( stmthandle, oci_htype_stmt, @fstmttype, nil, oci_attr_stmt_type, ferrhandle ) ) = oci_still_executing do;         //envhandle , stmthandle must allocated far.  fstmttype comes correctly oci_stmt_select (1).           := 32768;         oci.attrset( stmthandle, oci_htype_stmt, @i, 0, oci_attr_prefetch_memory, ferrhandle );         acode := oci.stmtexecute( fsvchandle, stmthandle, ferrhandle, nrows, noffs, nil, nil, oci_default );         oci.paramget( stmthandle, oci_htype_stmt, ferrhandle, @apdesc, ) <> oci_success         //apdesc contains ociparam         checkerror (oci.descriptoralloc (toracle8connection(asqlparam.owner.owner.connection).envhandle , @loblocator, oci_dtype_lob, 0, nil));         acode := oci.definebypos( stmthandle, @ocidefine( fbind ), ferrhandle, pos, @aloblocator, maxint, sqlt_chr, nil, nil, nil, oci_dynamic_fetch );           checkerror(oci.loblocatorisinit(connection.envhandle, ferrhandle, aloblocator, @islobinitialized));  //returns false... uh oh!         checkerror(oci.lobcharsetid(connection.envhandle, ferrhandle, aloblocator, @lobchar_code));   //crash... oci_invalid_handle   

the last 2 lines problematic ones. have poll loblocator's charset. please note loblocator's charset not same define handle's charset. define handle's charset oci_utf16id, while clob's charset might oci_we8mswin1252. same holds sqlcs value, doesn't have match.


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -