Showing posts with label words. Show all posts
Showing posts with label words. Show all posts

Thursday, February 16, 2012

Change query (ODBC driver), change query result

Hello
Situation: Application->ODBC->MSSQL2K
I need to change some queries (replace) between ODBC and MSSQL on the fly,
or, in the other words transparently to application modify some query before
they executed by SQL server.
Another Q.
There is the query: SELECT COUNT(A) FROM B WHERE B.A='C'
(and there are a lot other select, insert etc. queries to table B)
I need to do something on server side (triggers/views etc.) to change result
of this query (but I can't change query itself)
(for example - it should always return 5)
Help me with this problems
AndyYou can't make SQL Server lie to you on purpose. SQL Server will return the
result from the query, nothing you can do about that. Either catch the
result in the client and handle it, or pass some other query to SQL Server.
You could write an ODS application, which is essentially a SQL Server
gateway, so your client would connect to your "pseudo-SQL Server" and it
will pass the queries to the real SQL Server. You can now intercept the
queries. I'm not sure MS carried over the ODS possibilities to SQL2K, and
this is also not light-weight programming to write an ODS gateway.
Tibor Karaszi, SQL Server MVP
Archive at:
http://groups.google.com/groups?oi=...ublic.sqlserver
"Andy" <andycpp@.i.com.ua> wrote in message
news:OlMB7tU7DHA.1592@.TK2MSFTNGP10.phx.gbl...
> Hello
> Situation: Application->ODBC->MSSQL2K
> I need to change some queries (replace) between ODBC and MSSQL on the fly,
> or, in the other words transparently to application modify some query
before
> they executed by SQL server.
> Another Q.
> There is the query: SELECT COUNT(A) FROM B WHERE B.A='C'
> (and there are a lot other select, insert etc. queries to table B)
> I need to do something on server side (triggers/views etc.) to change
result
> of this query (but I can't change query itself)
> (for example - it should always return 5)
> Help me with this problems
> Andy
>|||Is there some kind of ODBC Proxy?
Can I redefine COUNT function?
I don't need to _modify_ SQL Server _answer_, I should redefine/replace etc.
query or reroute it...
I'll look for ODS, tnx
Andy
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:e9Z$GLV7DHA.2064@.TK2MSFTNGP11.phx.gbl...
> You can't make SQL Server lie to you on purpose. SQL Server will return
the
> result from the query, nothing you can do about that. Either catch the
> result in the client and handle it, or pass some other query to SQL
Server.
> You could write an ODS application, which is essentially a SQL Server
> gateway, so your client would connect to your "pseudo-SQL Server" and it
> will pass the queries to the real SQL Server. You can now intercept the
> queries. I'm not sure MS carried over the ODS possibilities to SQL2K, and
> this is also not light-weight programming to write an ODS gateway.
> --
> Tibor Karaszi, SQL Server MVP
> Archive at:
>
http://groups.google.com/groups?oi=...ublic.sqlserver
>
> "Andy" <andycpp@.i.com.ua> wrote in message
> news:OlMB7tU7DHA.1592@.TK2MSFTNGP10.phx.gbl...
fly,
> before
> result
>|||> Is there some kind of ODBC Proxy?
Not that I know of. You might want to check the ODBC newsgroups.

> Can I redefine COUNT function?
No.

> I'll look for ODS, tnx
Just don't hold your breath. As I said, I think MS removed this ability in
SQL2K. And, it is probably a lot of hard (C++) work to write an ODS gateway.
I'm sorry, but I don't think you'll find any viable solutions to this...
Tibor Karaszi, SQL Server MVP
Archive at:
http://groups.google.com/groups?oi=...ublic.sqlserver
"Andy" <andycpp@.i.com.ua> wrote in message
news:%23p3tmxW7DHA.2044@.TK2MSFTNGP10.phx.gbl...
> Is there some kind of ODBC Proxy?
> Can I redefine COUNT function?
> I don't need to _modify_ SQL Server _answer_, I should redefine/replace
etc.
> query or reroute it...
> I'll look for ODS, tnx
> Andy
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote
in
> message news:e9Z$GLV7DHA.2064@.TK2MSFTNGP11.phx.gbl...
> the
> Server.
and
>
http://groups.google.com/groups?oi=...ublic.sqlserver
> fly,
>|||Yep, with ODS - no solution... Obsolete.
But "you'll find any viable solutions to this" not a solution.
Taks is defined, and I heve to find correct answer...
please, try to help me
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:%237mDR8W7DHA.2524@.TK2MSFTNGP11.phx.gbl...
> Not that I know of. You might want to check the ODBC newsgroups.
>
> No.
>
> Just don't hold your breath. As I said, I think MS removed this ability in
> SQL2K. And, it is probably a lot of hard (C++) work to write an ODS
gateway.
> I'm sorry, but I don't think you'll find any viable solutions to this...
> --
> Tibor Karaszi, SQL Server MVP
> Archive at:
>
http://groups.google.com/groups?oi=...ublic.sqlserver
>
> "Andy" <andycpp@.i.com.ua> wrote in message
> news:%23p3tmxW7DHA.2044@.TK2MSFTNGP10.phx.gbl...
> etc.
> in
return
it
the
> and
>
http://groups.google.com/groups?oi=...ublic.sqlserver
the
query
change
>