dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: OCI bindings for CLOB data type

  1. #1
    Join Date
    Jan 2008
    Posts
    4

    OCI bindings for CLOB data type

    When I try to use OCI bind for the CLOB data type, my code is dumping core with some signal 10 bus error - Invalid address alignment, then I have tried using SLT_CHR for the same. by using this I am no more getting a core dump.. but the code is giving me a return status of -1 at OCIStmtExecute() and then its failing to update in the database... with an error as number/type of arguments mismatch with the PL SQL call.

    Do I need to use something like OCIclobLocator for binding CLOB data type .. have seen about this in the web.. but failing to get a sample snippet to implement the same.

    Seek you help in this regard... anyone who has previously implemented or have any idea please respond...

    Please let me know if my question is not clear..

    thanks
    Lavanya

  2. #2
    Join Date
    Jun 2002
    Location
    Letchworth, UK
    Posts
    1,019

    Re: OCI bindings for CLOB data type

    If you don't get any suitable responses, it might be worth trying the database forum http://www.codeguru.com/forum/forumdisplay.php?f=51
    Succinct is verbose for terse

  3. #3
    Join Date
    Jan 2008
    Posts
    2

    Re: OCI bindings for CLOB data type

    Perhaps you can get ideas from code:
    http://nemesisrd.cvs.sourceforge.net...b/internal.db/

    And the small program example:
    http://nemesisrd.cvs.sourceforge.net....1&view=markup

  4. #4
    Join Date
    Jan 2008
    Posts
    4

    Re: OCI bindings for CLOB data type

    I am unable to open the links provided by you, please help !!!

  5. #5
    Join Date
    Jan 2008
    Posts
    4

    Re: OCI bindings for CLOB data type

    This is how my code looks like ::

    declarations ....

    . . .
    OCIstatus = OCIDescriptorAlloc((OCIEnv *)pREIPEnvhp,
    (dvoid **)&pLoblocator1,
    (ub4)OCI_DTYPE_LOB,(size_t)0,(dvoid **)0);


    . . .
    OCIstatus = OCILobWrite((OCISvcCtx *)pREIPSvchp,
    (OCIError *)pREIPErrhp,
    (OCILobLocator *)pLoblocator1,
    (ub4 *) &pBufferLen1,
    (ub4)offset,(dvoid *)gEventRefCSV,
    (ub4)pBufferLen1,
    (ub1)OCI_ONE_PIECE,(dvoid *)0,
    (sb4 (*)(dvoid *,dvoid *,ub4 *,ub1 *) )0,
    (ub2)0,(ub1)SQLCS_IMPLICIT);

    . . .

    OCIstatus = OCIBindByName(pREIPstmt,
    &pREIPhndl4,
    pREIPErrhp,
    (text*)":event_ref",
    (sb4) strlen((char *) ":event_ref"),
    (dvoid*) pLoblocator1,
    (sb4) (sizeof(char*) * strlen(gEventRefCSV)),
    SQLT_CLOB,
    (dvoid *)0,
    (ub2 *)0,
    (ub2 *)0,
    (ub4) 1,
    (ub4*) 0,
    (ub4) OCI_DEFAULT );


    OCIstatus = OCIStmtExecute(pREIPSvchp,
    pREIPstmt,
    pREIPErrhp,
    (ub4)1,
    (ub4)0,
    (OCISnapshot*) NULL,
    (OCISnapshot*) NULL,
    (ub4) OCI_DEFAULT );


    OCIstatus = OCIHandleFree( pREIPstmt,
    OCI_HTYPE_STMT );

    ans its erroring out with OCI_INVALID_HANDLE
    m not sure if I made any mistake while binding..
    please suggest a better approach

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)