SQL Server >> UPDATEBLOB error - Function sequence error

by S2V2aW5SMQ » Thu, 06 May 2010 00:56:01 GMT

OS: Windows XP. DBMS: SQL Server 2008. Development tool: PowerBuilder
10.5.

I am attempting to save a digital photo image to a table ( datatype of
column is varbinary(max) ) with an UPDATEBLOB statement via embedded SQL;
however, I'm getting the following error - SQLSTATE = S1010 [Microsoft][ODBC
Driver Manager] Function sequence error. (SQLCODE = -1 and SQLDBCODE = 999).
Does anyone have any suggestions to help solve this problem?

In addition, the connection to SQL Server 2008 is via ODBC. The DBPARM =
"Connectstring='Driver=SQL Server Native Client
10.0;Trusted_Connection=yes;App=xxx;Server=yyy;Database=zzz',DelimitIdentifier='Yes',DisableBind=1".
(BTW, the same UPDATEBLOB statement works fine with a Sybase ASA database).


Similar Threads

1. Function Sequence Error

2. ODBC Driver Function Sequence Error

Sorry for cross-posting this message, but I'm desperate 
for help.

I'm executing a stored procedure using 
OdbcCommand.ExecuteScalar() method and got an ODBC SQL 
Server Driver "Function Sequence Error". Below are the two 
sps (one generates the ODBC driver error, the other one 
doesn't). Has anyone ever had a similar problem?

-- ODBC Function sequence error when executing this sp
-- On the ODBC trace file, error 50001 was returned first, 
then an ODBC "Function Sequence Error" was returned.

CREATE PROC sp_Test
	@TestInput	int
,	@TestOutput	int	OUT
AS

DECLARE @error 	int

RAISERROR 50001 'Test'
SELECT @error = @@ERROR

RETURN @error
GO





-- NO ODBC Function sequence error when executing this sp
-- The correct error passed back properly (50001)
CREATE PROC sp_Test
	@TestInput	int
,	@TestOutput	int	OUT
AS
	RAISERROR 50001 'Test'
GO



.


3. Function sequence error with bcp call from a stored procedure - SQL Server

4. ODBC Driver Function Sequence Error

Sorry for cross-posting this message, but I'm desperate 
for help.

I'm executing a stored procedure using 
OdbcCommand.ExecuteScalar() method and got an ODBC SQL 
Server Driver "Function Sequence Error". Below are the two 
sps (one generates the ODBC driver error, the other one 
doesn't). Has anyone ever had a similar problem?

-- ODBC Function sequence error when executing this sp
-- On the ODBC trace file, error 50001 was returned first, 
then an ODBC "Function Sequence Error" was returned.

CREATE PROC sp_Test
	@TestInput	int
,	@TestOutput	int	OUT
AS

DECLARE @error 	int

RAISERROR 50001 'Test'
SELECT @error = @@ERROR

RETURN @error
GO





-- NO ODBC Function sequence error when executing this sp
-- The correct error passed back properly (50001)
CREATE PROC sp_Test
	@TestInput	int
,	@TestOutput	int	OUT
AS
	RAISERROR 50001 'Test'
GO



.


5. SQL State=HY010 "Function Sequence error" - SQL Server

6. Function Sequence error?

I have a strange problem. Sometimes I get a "ERROR [HY010] [Microsoft][ODBC 
SQL Server Driver]Function sequence error" in my code (see code included 
below).

How can the below code cause a Function Sequence error?

Olav

  public static System.Decimal LogActivity(int userId, string ipAddress, 
Activity activity, string activityParameter, bool success, string errorText)
  {
   DateTime logTime = DateTime.Now;

   OdbcConnection myConnection = new OdbcConnection(m_connectionString);

   string strCommand =
    "INSERT INTO LogActivity " +
    "     (LogTime, UserId, IPAddress, ActivityId, ActivityParameter, 
Success, ErrorText) " +
    "VALUES     (?, ?, ?, ?, ?, ?, ?); SELECT @@IDENTITY";

   OdbcCommand myCommand = new OdbcCommand(strCommand, myConnection);
   myCommand.Parameters.Add("LogTime", OdbcType.DateTime).Value = logTime;
   myCommand.Parameters.Add("UserId", OdbcType.Int).Value = userId;
   myCommand.Parameters.Add("IpAddress", OdbcType.VarChar).Value = 
ipAddress;
   myCommand.Parameters.Add("Activity", OdbcType.Int).Value = activity;
   myCommand.Parameters.Add("ActivityParameter", OdbcType.VarChar).Value = 
activityParameter;
   myCommand.Parameters.Add("Success", OdbcType.Int).Value = success;
   myCommand.Parameters.Add("ErrorText", OdbcType.VarChar).Value = 
errorText;

   myConnection.Open();
   Object obj = myCommand.ExecuteScalar();        // Sometimes I get an 
exception on this statement

   System.Decimal logId = System.Convert.ToDecimal(obj);

            myConnection.Close();
            myCommand.Dispose();

   return logId;
  }



7. Function sequence error when attempting to write about 32K to varBinary(max) - SQL Server

8. ODBC Function Sequence Error, unexpected EOF encountered in BCP