×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Problem with isc_dsql_execute2

Problem with isc_dsql_execute2

Problem with isc_dsql_execute2

(OP)
Hello to all,

i get the following error message from interbase

CODE

attempt to fetch past the last record in a record stream

when I execute the following code:

CODE

int fetch_stat = 0;
if (isc_dsql_execute2(m_connStatus, &m_transaction, &m_statement, dialect, in_sqlda, out_sqlda)) {
//if (isc_dsql_execute2(m_connStatus, &m_transaction, &m_statement, dialect, in_sqlda, NULL)) {
    cout << endl;
    isc_print_status(m_connStatus);
    long *pVector;
    char msg[1024];
    string err_message = "";
    pVector = m_connStatus;
    isc_interprete(msg, &pVector);
    err_message = msg;
    msg[0] = '-';
                
    while(isc_interprete(msg + 1, &pVector))
        err_message += msg;
    cerr << err_message << endl;
}

int fetch_stat = 0;
while ((fetch_stat = isc_dsql_fetch(m_connStatus, &m_statement, 1, out_sqlda)) == 0) {
    for (i = 0; i < out_sqlda->sqld; i++) {
        process_column(&out_sqlda->sqlvar[i]);
    }
}

if (fetch_stat != 100L) { // isc_dsql_fetch returns 100 if no more rows remain to be retrieved
    isc_print_status(m_connStatus);
    long *pVector;
    char msg[1024];
    string err_message = "";
    pVector = m_connStatus;
    isc_interprete(msg, &pVector);
    err_message = msg;
    msg[0] = '-';
                
    while(isc_interprete(msg + 1, &pVector))
        err_message += msg;
    cerr << err_message << endl;
}
The SQL Statement I've executed was as follows:

CODE

SELECT col1, col2, col3, FROM my_table WHERE id>=? AND id <?

Can anybody help to find a solution? I'll have only the fetch columns.

Much thanks and best Regards
NoRulez

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close