Re: I am getting "Function Sequence Error" When I try to do SQLDescribeParam() using my native ODBC

Aniruddha Kulkarni <[email protected]>
Newsgroups gmane.comp.db.unixodbc.devel
Message-ID <ACDD8E6D3D0D8145A5C8185D9ACFB4FB481F25BE@HJ-MBX1.persistent.co.in>
Thanks a lot Martin for your reply. I will try to change the method calling sequence and see it is still failing.

Thanks
~Aniruddha

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Martin J. Evans
Sent: Thursday, November 08, 2012 6:56 PM
To: [email protected]
Subject: Re: [unixODBC-dev] I am getting "Function Sequence Error" When I try to do SQLDescribeParam() using my native ODBC

On 08/11/12 12:24, Aniruddha Kulkarni wrote:
> Hi,
>
> I am stuck with some issue here. I am trying to do certain operations 
> on back-end using my native ODBC driver however when I call
> SQLDescribeParam() through my application it gives me an error as - 
> SQLDescribeParam -> Rc = SQL_ERROR, Msg = [unixODBC][Driver 
> Manager]Function sequence error

The driver manager issued the function sequence error as can be seen by "[unixODBC][Driver Manager]". If the driver reported the issue, it would be named in [] at the right.
  
> Here is the scenario which encountered this problem:
>
> 1>Connect to backend using SQLConnect()
>
> 2>Prepare an insert query having geometry as col type using
> SQLPrepare()
>
> 3>Set the statement attributes using SQLSetStmtAttr()

This is usually where you call SQLDescribeParam i.e., you need to describe the parameters before binding them.
  
> 4>Bind the parameters with the data type using SQLBindParameter()
>
> 5>Then execute the parameterized query using - SQLExecute()
>
> 6>Call SQLNumParams() on statement

Why would you want the number of parameters after execution. You normally do this before executing.
  
> 7>Then in a loop, call SQLDescribeParam() with the appropriate
> function arguments.

No idea why your ODBC application is doing this - why?
  
> With this sequence of functions I am getting the mentioned error. My 
> doubt is on unixODBC driver manager I have been using, because if I 
> try to run the application without DM then it works as expected. So I 
> believe there is some error that is caught by driver manager and error 
> is thrown.

It is caught by the driver manager.

> Can anybody please shed some light on the probable cause of the error?
>
> Thanks
>
> ~Aniruddha

I haven't got the ODBC book to hand but I'd guess it is a state transition that ODBC does not support. Currently, from what you've given us I can't see why you'd want to call SQLDescribeParam where are are.

Martin
--
Martin J. Evans
Easysoft Limited
http://www.easysoft.com
_______________________________________________
unixODBC-dev mailing list
[email protected]
http://mailman.unixodbc.org/mailman/listinfo/unixodbc-dev

DISCLAIMER
==========
This e-mail may contain privileged and confidential information which is the property of Persistent Systems Ltd. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Persistent Systems Ltd. does not accept any liability for virus infected mails.
_______________________________________________
unixODBC-dev mailing list
[email protected]
http://mailman.unixodbc.org/mailman/listinfo/unixodbc-dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.