Re: Calling a store procedure

Nick Gorham <[email protected]>
Newsgroups gmane.comp.db.unixodbc.devel
Message-ID <[email protected]>
On 23/02/12 12:14, Jaime Stuardo wrote:
> Hello and thanks for answering...
>
> SQLExecDirect returns 100. By looking at the header files, that code means
> SQL_NO_DATA according to this:
>
> #if (ODBCVER>= 0x0300)
> #define SQL_NO_DATA              100
> #endif
>
> Since I am using ODBC version 3, I am getting this code which is not an
> error actually, but a result condition. The stored procedure does only an
> UPDATE and currently it is not updating nothing.
>
> I think that "#define SQL_SUCCEEDED(rc) (((rc)&(~1))==0)" macro should be
> updated to include SQL_NO_DATA as a succeeded condition. That is why the
> diagnostics does not return any message.

I see what you are saying, but if that change was made in unixODBC it 
would diverge from the Microsoft implementation, compatibility with that 
is one of unixODBC goals.

I can also see situations where SQL_NO_DATA could be considered a error 
condition, depending on the use in question.
> By the way, I used tsql and isql command with the stored procedure and it
> worked, so I discarded problem with FreeTDS.
>
> What do you think?

Not sure what you mean?

I would think that changing your code to be

      if (!SQL_SUCCEEDED(ret)&&  ret != SQL__NO_DATA ) {


Would give you want you want and work across platforms as well.


-- 
Nick

_______________________________________________
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.