Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Gettting a SQLExtendedFetch Error?

Posted on 1999-07-31
Medium Priority
Last Modified: 2008-02-01
I'm getting the following erro: S1106
[Sybase][ODBC Driver] An invalid fFetch Type value was specified.
in the SQLExtendedFetch() return value means:

S1106      Fetch type out of range      The value specified for the argument fFetchType was not equal to:

Here is what my code is doing:

char sBuff[800];
char sSSN[10];
wsprintf( sBuff,
             "SELECT empl_ssn FROM employee WHERE empl_company = '%s' AND \
             empl_qtr = %ld AND empl_work_state = 'CT' OR empl_work_state = 'GU'",
             "873500", 199901 );
m_DBase->createHandle( &hScroll );
m_DBase->sql( hScroll, sBuff );
m_DBase->bindString( hScroll, 1, sSSN, 10 );
m_DBase->fetchEx( hScroll, SQL_FETCH_FIRST, nRecordCount );

which is a thin wrapper class.  
so createHandle is SQLAllocStmt()
sql is SQLExecDirect()
bindString just binds is SQLBindCol()

Here is the code for the fetchEx:
retCode = SQLExtendedFetch(hStmt, SQL_FETCH_FIRST, NULL, NULL, NULL);

Can any help explain what this error means and how it is caused and how to fix it.


Question by:eric07
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment

Accepted Solution

ajith_29 earned 150 total points
ID: 1098935
hi eric,
Please do remove the where condition and run your sql statement
and  I have pasted the part I think is giving you the error.
empl_work_state = 'GU'",
  "873500", 199901
The last where clause is a problem I think please remove the where clause and then put one by one the where clause and then you will know the error.I am sure your where clause is producing that error.

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Are you an Exchange administrator employed with an organization? And, have you encountered a corrupt Exchange database due to which you are not able to open its EDB file. This article will explain all the steps to repair corrupt Exchange database.
What we learned in Webroot's webinar on multi-vector protection.
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question