Solved TD-25077: Provide a new SQL API such as SqlGetLastStatementEx( hSql ) that would allow to get the Last Statement issued

Discussion forum about all things SqlBase.
Uwe van der Horst
Site Admin
Site Admin
Germany
Posts: 490
Joined: 05 Mar 2017, 14:21
Location: Wetter (Ruhr), Germany

TD-25077: Provide a new SQL API such as SqlGetLastStatementEx( hSql ) that would allow to get the Last Statement issued

Post by Uwe van der Horst » 19 Feb 2020, 10:19

On a current occasion I was looking to find out the last statement that caused an sql error. I found SqlGetLastStatement(), but the statement returned is for any cursor and not for a specific cursor. I found this very old forum thread in old SQLBase forum:

SqlGetLastStatement.PNG

I am surprised that to this day there is no solution :?:
You do not have the required permissions to view the files attached to this post.
Best regards,
Uwe van der Horst
Advo-web GmbH

Igor Ivanovic
Site Admin
Site Admin
Croatia
Posts: 1365
Joined: 05 Mar 2017, 12:37
Location: Zagreb, Croatia

Re: TD-25077: Provide a new SQL API such as SqlGetLastStatementEx( hSql ) that would allow to get the Last Statement issued

Post by Igor Ivanovic » 19 Feb 2020, 13:36

Uwe van der Horst wrote:
19 Feb 2020, 10:19
I am surprised that to this day there is no solution :?:
Well don't be, that was in 2007, when enhancement requests weren't even been discussed, and not to mention bug reports were hidden or just dropped...
A lot of things has changed to better these days.

Maybe we could add this to a new enhancement request?
Should I or should you?
Igor Ivanovic
Image

Uwe van der Horst
Site Admin
Site Admin
Germany
Posts: 490
Joined: 05 Mar 2017, 14:21
Location: Wetter (Ruhr), Germany

Re: TD-25077: Provide a new SQL API such as SqlGetLastStatementEx( hSql ) that would allow to get the Last Statement issued

Post by Uwe van der Horst » 19 Feb 2020, 13:41

I just did that :D
Best regards,
Uwe van der Horst
Advo-web GmbH

Igor Ivanovic
Site Admin
Site Admin
Croatia
Posts: 1365
Joined: 05 Mar 2017, 12:37
Location: Zagreb, Croatia

Re: TD-25077: Provide a new SQL API such as SqlGetLastStatementEx( hSql ) that would allow to get the Last Statement issued

Post by Igor Ivanovic » 19 Feb 2020, 13:46

You're a bloody fast on the trigger! :lol:
Igor Ivanovic
Image

Uwe van der Horst
Site Admin
Site Admin
Germany
Posts: 490
Joined: 05 Mar 2017, 14:21
Location: Wetter (Ruhr), Germany

Re: TD-25077: Provide a new SQL API such as SqlGetLastStatementEx( hSql ) that would allow to get the Last Statement issued

Post by Uwe van der Horst » 20 Feb 2020, 14:39

TD-25077: Provide a new SQL API such as SqlGetLastStatementEx( hSql ) that would allow to get the Last Statement issued from a SQL Handle :)
Best regards,
Uwe van der Horst
Advo-web GmbH

Uwe van der Horst
Site Admin
Site Admin
Germany
Posts: 490
Joined: 05 Mar 2017, 14:21
Location: Wetter (Ruhr), Germany

Re: TD-25077: Provide a new SQL API such as SqlGetLastStatementEx( hSql ) that would allow to get the Last Statement issued

Post by Uwe van der Horst » 21 Feb 2020, 14:46

Problem solved. I was not aware of SqlGetCommandText() :oops:

Answer from support:
SqlGetCommandText() returns the SQL command last prepared on the specified SQL handle.
SqlGetLastStatement() returns the last SQL statement passed to a SQL function for any SQL handle.
The support contract is really worth every cent.
Best regards,
Uwe van der Horst
Advo-web GmbH

Igor Ivanovic
Site Admin
Site Admin
Croatia
Posts: 1365
Joined: 05 Mar 2017, 12:37
Location: Zagreb, Croatia

Re: TD-25077: Provide a new SQL API such as SqlGetLastStatementEx( hSql ) that would allow to get the Last Statement issued

Post by Igor Ivanovic » 23 Feb 2020, 07:12

Uwe van der Horst wrote:
21 Feb 2020, 14:46
Problem solved. I was not aware of SqlGetCommandText() :oops:
The support contract is really worth every cent.
Wow, me neither! :oops:
Yeah, the support is really on the next level regarding what it was.
They are even answering simple questions, although it takes longer time to get the answer, but worth every cent...
Igor Ivanovic
Image

Return to “General Discussion”

Who is online

Users browsing this forum: [Ccbot] and 0 guests