mdlDB_fetchRowByID

MicroStation v8i - Using mdlDB_opencursorwithid and when doing mdlDB_fetchRowByID

if you set the function to == QUERY_NOT_FINISHED, returns first row and attemps to close cursor and fails. If set to != QUERY_FINISHED, keeps looping through first fetched record and only the first. Knew of problem in V8 and tried setting the auto commit off before opening cursor with mdlDB_activeAutoCommitMode and turning back on after closing cursor but no luck

Parents
  • For all who care about or program database's order for Oracle cursors to work:

    mdlDB_activeAutoCommitMode(FALSE) - turn off auto commit

    mdlDB_openCursorWithID () - open cursor

    mdlDB_fetchRowByID ()  != QUERY_FINISHED - run thru records

    mdlDB_closeCursorByID () - close cursor  

    mdlDB_processSQL("COMMIT") - do a commit

    mdlDB_activeAutoCommitMode(TRUE) - turn on auto commit

Reply
  • For all who care about or program database's order for Oracle cursors to work:

    mdlDB_activeAutoCommitMode(FALSE) - turn off auto commit

    mdlDB_openCursorWithID () - open cursor

    mdlDB_fetchRowByID ()  != QUERY_FINISHED - run thru records

    mdlDB_closeCursorByID () - close cursor  

    mdlDB_processSQL("COMMIT") - do a commit

    mdlDB_activeAutoCommitMode(TRUE) - turn on auto commit

Children
  • Unknown said:
    For all who care ...

    Thanks for posting that useful bit of information.

    The V8 generation enables, or rather encourages, us to use Visual C++ effectively to write an MDL application whose implementation is delivered in a DLL. This also enables us to use Windows libraries, rather than mdlDB_xxx functions, to create and use a database connection.

     
    Regards, Jon Summers
    LA Solutions