Toad World® Forums

Cannot execute highlighted query from within edit window

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:

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

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

Thanks,

Michael

Ok, great.

Would be nice to see this solved!

Thanks for your efforts,
Abe

in latest beta 13.0.0.25 it works for me:

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

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

Hm...I cannot reproduce that...

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
;

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

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.

      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