Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8620087
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T06:29:52+00:00 2026-06-12T06:29:52+00:00

I am trying to insert o blob in a database. I have succeed to

  • 0

I am trying to insert o blob in a database. I have succeed to enter data i two columns.

I am having problem whit SQLParamData .It returns an error when it should return SQL_NEED_DATA(i will post code)

When i run SQLGetDiagRec it returns S1010 with error text Function sequence error .
I search this error on the internet and i learned that it could be related to a parameter from SQLBindParameter .

// Bind the parameter marker.
    retCode = retcode = SQLBindParameter(hstmt,  // hstmt
         1,                     // ipar
         SQL_PARAM_INPUT,            // fParamType
         SQL_C_BINARY,               // fCType
         SQL_LONGVARBINARY,           // FSqlType
         lbytes,                  // cbColDef
         0,                     // ibScale
         &pParmID,       // rgbValue
         0,                     // cbValueMax
         &cbTextSize);            // pcbValue

    SqlError(hstmt,SQL_HANDLE_STMT,_T("WriteBlob"), _T("CTLSqlConnection"), _T("SQLBindParameter"));
    if(retCode != SQL_SUCCESS)
    {
        delete pData;

        if(!EndTransaction(FALSE))
            return ERR_ENDTRANSACTION_FAILED;
        else
            return -3;
    }

    //SQLExec
    retcode = retCode = SQLExecDirect(hstmt,(SQLTCHAR*)szSqlStat, SQL_NTS);

        SQLRETURN ret;
        SQLCHAR* SQLState;
        SQLINTEGER NativeError;
        SQLSMALLINT errmsglen;
        SQLCHAR errmsg[255];
        SQLCHAR errstate[50];



    retCode = SQLParamData(hstmt, &pParmID);

SQLGetDiagRec(SQL_HANDLE_STMT, hstmt, 1, (SQLCHAR*)errstate, &NativeError, (SQLCHAR*)errmsg, sizeof(errmsg), &errmsglen);
    if(retCode == SQL_NEED_DATA)
    {
        // Put final batch.
        SQLPutData(hstmt, pData, lbytes); 
    }
    else
    {
        delete pData;

If this part of the code is not relevant enough i will post more.

Hope you can help me .Thanks .

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T06:29:53+00:00Added an answer on June 12, 2026 at 6:29 am

    Your logic looks wrong here. It is when SQLExecute (SQLExecDirect) returns SQL_NEED_DATA you call SQLParamData and it tells you will parameter you need to supply data for with SQLPutData. If you call SQLParamData when SQLExecute did not return SQL_NEED_DATA I can well imagine it is a function sequence error. I could probably dig you out an example from somewhere if you still need it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to insert binary data into a blob using SQLite3's shell, which means
I'm trying to insert an HTML blob into our sql-server2005 database. I've been using
I'm trying to insert a file in a blob field in a Firebird database
Im trying to insert data to my database, and it gives me an error
I'm new to Obj-C, and I have a little problem here. I'm trying insert
Hi I am trying insert data into the database using prepared statement but I
while trying to insert data i am getting this error 07-29 18:15:19.909: E/sqlite(863): android.database.sqlite.SQLiteException:
im trying to insert data into a particular row in the database, but i
I am trying to insert some XML data into a blob column using utl_raw.cas_to_raw.
Trying to insert 315K Gif files into an Oracle 10g database. Everytime I get

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.