Menu

Removed OCI_FreeResultset from public

2008-03-03
2012-09-26
  • Nobody/Anonymous

    How can I release Resultset ?

     
    • Vincent Rogier

      Vincent Rogier - 2008-03-03

      A resultset is freed when the statement is prepared again or when the statement is freed.

       
    • Nobody/Anonymous

      Thanks for reply.
      But I have another question.
      for example

      int code=0;
      OCI_Resultset rs;
      OCI_Statement
      st = OCI_CreateStatement(cn);
      OCI_Prepare(st, MT("select * from test where code = :code");
      OCI_BindInt(st, MT(":code"), &code);

      while(1) {
      OCI_Execute(st);
      rs = OCI_GetResultset(st);
      code++;
      }

      I think there is no way to release resultset

       
      • Vincent Rogier

        Vincent Rogier - 2008-03-04

        As I told you, resultset are automatically destroyed...

        I added some comments to your code :

        int code=0;
        OCI_Resultset rs;
        OCI_Statement
        st = OCI_CreateStatement(cn);
        OCI_Prepare(st, MT("select * from test where code = :code");
        OCI_BindInt(st, MT(":code"), &code);

        while(1)
        {
        / this call automatically frees previous rs /
        OCI_Execute(st);
        rs = OCI_GetResultset(st);
        code++;
        }

        / this call automatically frees last rs /
        OCI_FreeStatement(st);

        Vincent.