Menu

Know if "OCI_ExecuteStmt" have got any data

2013-10-03
2013-10-04
  • Josemi Antelo

    Josemi Antelo - 2013-10-03

    Hello,

    Is there any way to know if an "OCI_ExecuteStmt (..,..)" have got any data without or before use "OCI_FetchNext"?

    Many thanks in advance
    Josemi

     
  • Vincent Rogier

    Vincent Rogier - 2013-10-03

    Hi,

    No, there is no way.

    You could have 2 options :
    - perform first a "select count * from (my query)" and then execute the query if count>0
    - Use scrollable cursors, do OCI_FetchLast() and retrieve row count with OCI_GetRowCount()

    But these 2 options are performance killers....

    Thus, no way to find out....

    Regards,

    Vincent

     

    Last edit: Vincent Rogier 2013-10-03
  • Anonymous

    Anonymous - 2013-10-04

    Many thanks for your rapid answer
    Yours sincerely

     
  • Josemi Antelo

    Josemi Antelo - 2013-10-04

    Hello, again

    I tried OCI_FetchLast + OCI_GetRowCount() and don't Works, always return me 0. But if I use the combination OCI_FetchLast + OCI_GetRowCount(), yes, it returns correctly the number of rows, but ... I lose a row, that I may recover with OCI_FetchPrev ... too many instructions

    Thank you
    Josemi