# Cannot execute highlighted query from within edit window

**URL:** <https://forums.toadworld.com/t/cannot-execute-highlighted-query-from-within-edit-window/40439>\
**Category:** Toad for Oracle - Beta\
**Created:** [January 9, 2018, 1:48am UTC](https://forums.toadworld.com/t/cannot-execute-highlighted-query-from-within-edit-window/40439 "2018-01-09T01:48:00Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![kornelis.abe](https://avatars.discourse-cdn.com/v4/letter/k/59ef9b/32.png) [@kornelis.abe](https://forums.toadworld.com/u/kornelis.abe)\
**Post date:** [January 9, 2018, 1:48am UTC](https://forums.toadworld.com/t/cannot-execute-highlighted-query-from-within-edit-window/40439/1 "2018-01-09T01:48:00Z")

</div>

All,

This relates to Beta 13.0.026 of Toad for Oracle.

Within my edit window I have a package body.  
I highlight a query and hit F9 to test it. I get an error message: ORA-00903: invalid table name

Since the error message is ostensibly inapplicable, I spooled to screen.  
Here's what happened:

 ![20180109 missing from clause.png](https://global.discourse-cdn.com/quest/original/2X/0/0fc519d9ec67e93578eb0723cef7dfa3a04acff4.png)

So it looks like somewhere the selected statement gets mangled or truncated.

I can work around it by copying the code to an additional editor tab,  
but it would be nice to see this fixed...

# Kind regards, Abe Kornelis

---

<div class="post-metadata">

**Author:** ![mstaszew](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/mstaszew/32/23_2.png) [@mstaszew](https://forums.toadworld.com/u/mstaszew)\
**Post date:** [January 9, 2018, 1:22pm UTC](https://forums.toadworld.com/t/cannot-execute-highlighted-query-from-within-edit-window/40439/2 "2018-01-09T13:22:13Z")

</div>

It took me a bit, but I can reproduce. It doesn’t play well with ANSI join syntax. I’ll log.

Thanks,

Michael

---

<div class="post-metadata">

**Author:** ![kornelis.abe](https://avatars.discourse-cdn.com/v4/letter/k/59ef9b/32.png) [@kornelis.abe](https://forums.toadworld.com/u/kornelis.abe)\
**Post date:** [January 9, 2018, 11:24pm UTC](https://forums.toadworld.com/t/cannot-execute-highlighted-query-from-within-edit-window/40439/3 "2018-01-09T23:24:38Z")

</div>

Ok, great.

Would be nice to see this solved!

# Thanks for your efforts, Abe

---

<div class="post-metadata">

**Author:** ![damir.vadas\_250](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/damir.vadas_250/32/37_2.png) [@damir.vadas\_250](https://forums.toadworld.com/u/damir.vadas_250)\
**Post date:** [January 10, 2018, 2:54am UTC](https://forums.toadworld.com/t/cannot-execute-highlighted-query-from-within-edit-window/40439/4 "2018-01-10T02:54:31Z")

</div>

in latest beta 13.0.0.25 it works for me:

 ![10.01.png](https://global.discourse-cdn.com/quest/original/2X/1/185cd03eaf27080ded3fb22dd2419fefdad2aec0.png)

---

<div class="post-metadata">

**Author:** ![damir.vadas\_250](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/damir.vadas_250/32/37_2.png) [@damir.vadas\_250](https://forums.toadworld.com/u/damir.vadas_250)\
**Post date:** [January 10, 2018, 2:57am UTC](https://forums.toadworld.com/t/cannot-execute-highlighted-query-from-within-edit-window/40439/5 "2018-01-10T02:57:27Z")

</div>

in latest beta 13.0.0.25 it works for me even with binds:

 ![10.01.png](https://global.discourse-cdn.com/quest/original/2X/1/185cd03eaf27080ded3fb22dd2419fefdad2aec0.png)

---

<div class="post-metadata">

**Author:** ![kornelis.abe](https://avatars.discourse-cdn.com/v4/letter/k/59ef9b/32.png) [@kornelis.abe](https://forums.toadworld.com/u/kornelis.abe)\
**Post date:** [January 10, 2018, 5:09am UTC](https://forums.toadworld.com/t/cannot-execute-highlighted-query-from-within-edit-window/40439/6 "2018-01-10T05:09:09Z")

</div>

Damir,

the problem only surfaced in Beta 13.0.0.26.

Just like you, I never encountered the problem in 13.0.0.25.

# Best regards, Abe

---

<div class="post-metadata">

**Author:** ![damir.vadas\_250](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/damir.vadas_250/32/37_2.png) [@damir.vadas\_250](https://forums.toadworld.com/u/damir.vadas_250)\
**Post date:** [January 10, 2018, 5:15am UTC](https://forums.toadworld.com/t/cannot-execute-highlighted-query-from-within-edit-window/40439/7 "2018-01-10T05:15:59Z")

</div>

Hm...I cannot reproduce that...

 ![5488.10.01.png](https://global.discourse-cdn.com/quest/original/2X/4/4006becf54c21cff400794c7bafb625887ad3205.png)

Could you run the same query on your side:

SELECT column\_name  
FROM ( SELECT \*  
FROM (SELECT b.column\_name, position  
FROM all\_cons\_columns b JOIN all\_constraints a ON (b.owner = a.owner AND a.constraint\_name = b.constraint\_name)  
WHERE 1 = 1 AND a.constraint\_type = 'P' AND a.OWNER = :cp\_owner AND a.table\_name = :cp\_table)  
ORDER BY position)  
UNION  
SELECT column\_name  
FROM ( SELECT column\_name  
FROM all\_tab\_columns  
WHERE owner = :cp\_owner AND table\_name = :cp\_table  
ORDER BY COLUMN\_id)  
WHERE ROWNUM \<= cc\_nr\_cols  
;

---

<div class="post-metadata">

**Author:** ![kornelis.abe](https://avatars.discourse-cdn.com/v4/letter/k/59ef9b/32.png) [@kornelis.abe](https://forums.toadworld.com/u/kornelis.abe)\
**Post date:** [January 10, 2018, 5:21am UTC](https://forums.toadworld.com/t/cannot-execute-highlighted-query-from-within-edit-window/40439/8 "2018-01-10T05:21:46Z")

</div>

Damir,

that works without problem. So I went back and tried a highlighted query in one of my packages.  
Same issue repeats.

I’m kinda baffled…

# Abe

---

<div class="post-metadata">

**Author:** ![mstaszew](https://sea1.discourse-cdn.com/quest/user_avatar/forums.toadworld.com/mstaszew/32/23_2.png) [@mstaszew](https://forums.toadworld.com/u/mstaszew)\
**Post date:** [January 10, 2018, 6:14am UTC](https://forums.toadworld.com/t/cannot-execute-highlighted-query-from-within-edit-window/40439/9 "2018-01-10T06:14:26Z")

</div>

It depends on the statement. I was able to reproduce it with the following SQL using ANSI join syntax. Other SQL using ANSI join work OK, some work… sort of… but incorrectly flag field names as binds, etc. There’s something very off here and I can reproduce it in 12.12 as well.

```auto
      BEGIN
SELECT uo.object_name,
uo.object_type,
us.line,
us.text
FROM user_objects uo JOIN user_source us ON uo.object_name = us.name
WHERE uo.created < SYSDATE
ORDER BY object_name, us.line;
END;

```

Michael
