Home » Developer & Programmer » Forms » Trouble with :system.last_query
icon8.gif  Trouble with :system.last_query [message #186678] Wed, 09 August 2006 00:42 Go to next message
cewlout
Messages: 4
Registered: August 2006
Junior Member
Hello all,

first of all you are my last hope to fix this I'm going slightly mad :-/

I develop applications using Forms 6i. I have a Form which fields are populated by a simple view. If I restrict the query (put something in a field) and execute the query to display data, the :system.last_query sometimes contains the correct value and sometimes it looks like Forms put in some kind of bind variables, I give you an example:

:system.last_query = select a,b,c,d from v_test where a = 'TEST'

TEST is my restriction, I put TEST in a field on Forms and run the query then -> means everything is okay and I can use it.

But the other case is:

:system.last_query = select a,b,c,d from v_test where a = :1

I did nothing else than above but now the last_query does not show 'TEST' in the where-clause but :1

Also if you restrict more it could also look like this:

:system.last_query = select a,b,c,d from v_test where a = :1 and b = :2 and c = :3 (...)

It replaces what I have put in with these strange bind-variables(?)

How can I get around this or is there a possibility to get the real content of :1, :2 etc.. to replace them? What is this :1 :2 ?

I'm going mad.. Help me Smile)))

Re: Trouble with :system.last_query [message #186697 is a reply to message #186678] Wed, 09 August 2006 02:26 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Okay, what is the problem?

What do you want to do?

David
Re: Trouble with :system.last_query [message #186744 is a reply to message #186697] Wed, 09 August 2006 05:37 Go to previous messageGo to next message
cewlout
Messages: 4
Registered: August 2006
Junior Member
My problem is that I take the content of the :system.last_query and run it again for generating an excel-export. So I need the "true" query, not the query which have "placeholders" in the where-clause:

I need:

select a,b,c from x where a='TEST' (the true last_query)

and not:

select a,b,c from x where a = :1

:1 is kind of a placeholder which I do not expect. I want the true value of :1.

So either someone is able to tell me why oracle replaces true values with :1, :2, :3 in the where-clause in :system.last_query or maybe there is a function which I can pass :1 as a parameter and the get true value back.

The general question is: why is the :system.last_query unusable and does not show the real last query as it pretends to do in the docs?

Re: Trouble with :system.last_query [message #186894 is a reply to message #186744] Thu, 10 August 2006 01:20 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Do you get the same result, that is, ':1', ':2', etc, if you do the "l_var := :system.last_query" in the Pre-Select trigger?

David
Re: Trouble with :system.last_query [message #187026 is a reply to message #186894] Thu, 10 August 2006 10:00 Go to previous messageGo to next message
cewlout
Messages: 4
Registered: August 2006
Junior Member
Simply answered: yes. Sad
Re: Trouble with :system.last_query [message #187105 is a reply to message #187026] Thu, 10 August 2006 21:40 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Have a look at http://www.orafaq.com/forum/t/54698/0/

Can you use the 'default_where' to get back the unsubstituted query and use the ':system.last_query' to get everything that exists in front of the 'where'?

David
Re: Trouble with :system.last_query [message #187310 is a reply to message #187105] Fri, 11 August 2006 15:48 Go to previous messageGo to next message
cewlout
Messages: 4
Registered: August 2006
Junior Member
Doesn't work.. I already tried this. Anyway.. seems a Forms bug or something. Too bad. Forms 6i sucks anyway.

Re: Trouble with :system.last_query [message #187436 is a reply to message #187310] Mon, 14 August 2006 00:57 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Go to metalink and have a look at Note:37990.1

David
Previous Topic: Getting the item type
Next Topic: index by table
Goto Forum:
  


Current Time: Fri Sep 20 11:30:41 CDT 2024