Thread: Retrieving affected tables

Retrieving affected tables

From
Hannes Dorbath
Date:
What is best way to retrieve all affected tables of an select statement?
(Besides parsing the raw SQL).

Thanks.


--
Regards,
Hannes Dorbath

Re: Retrieving affected tables

From
Richard Huxton
Date:
Hannes Dorbath wrote:
> What is best way to retrieve all affected tables of an select statement?
> (Besides parsing the raw SQL).

 From where? As a client-application function? As a user-callable
function in the server? From within the parse/execute code?

--
   Richard Huxton
   Archonet Ltd

Re: Retrieving affected tables

From
Hannes Dorbath
Date:
On 06.02.2007 14:19, Richard Huxton wrote:
>> What is best way to retrieve all affected tables of an select
>> statement? (Besides parsing the raw SQL).
>
>  From where? As a client-application function? As a user-callable
> function in the server? From within the parse/execute code?

 From a client application.

--
Regards,
Hannes Dorbath

Re: Retrieving affected tables

From
Richard Huxton
Date:
Hannes Dorbath wrote:
> On 06.02.2007 14:19, Richard Huxton wrote:
>>> What is best way to retrieve all affected tables of an select
>>> statement? (Besides parsing the raw SQL).
>>
>>  From where? As a client-application function? As a user-callable
>> function in the server? From within the parse/execute code?
>
>  From a client application.

Parsing the sql is the only way I can think of.

You could feed it through EXPLAIN I suppose, but there's no way to dump
the query-plan as a data-structure to the client. You can log a verbose
query-plan, but that's not going to help you.

--
   Richard Huxton
   Archonet Ltd

Re: Retrieving affected tables

From
Hannes Dorbath
Date:
On 06.02.2007 15:00, Richard Huxton wrote:
> Hannes Dorbath wrote:
>> On 06.02.2007 14:19, Richard Huxton wrote:
>>>> What is best way to retrieve all affected tables of an select
>>>> statement? (Besides parsing the raw SQL).
>>>
>>>  From where? As a client-application function? As a user-callable
>>> function in the server? From within the parse/execute code?
>>
>>  From a client application.
>
> Parsing the sql is the only way I can think of.
>
> You could feed it through EXPLAIN I suppose, but there's no way to dump
> the query-plan as a data-structure to the client. You can log a verbose
> query-plan, but that's not going to help you.

EXPLAIN VERBOSE gives me :resorigtbl. I think that is what I was after.


--
Regards,
Hannes Dorbath