Comment (?) causing AutoSelect statement to fail

Martins

Member²
Error: ORA-00900: invalid SQL statement AutoSelect statement Comment

Code (Used to be longer but I deleted everything that didn't make the error disappear):
/*
*/
SELECT 1 FROM dual;
--
SELECT 1 FROM dual;


I have the cursor in the 2nd SQL statement and use F8 to execute it.

I have the option "AutoSelect statement" checked and it looks like it selects more than just the SQL statement but also the comment before but not entirely (just one of the dashes).
See in the picture:
7gIchPQ.png


The thing is - it happens only sometimes - more than once per day. I reopen the file and keep working with it like nothing happened - no errors.

I just switched from 11.0.6.1776 to 12.0.3.1821. On 11 it happened not very often - once per week. But on 12 it is too often to tolerate.
 
Last edited:
Yes, unfortunately I haven't got a solid test scenario.

Usually the files I work with are about 300 - 1000 lines with several comments, SQLs and anonymous plsql blocks.
 
I have also the same problem. A lot of times (but i cannot reproduce it) it seems like the autoselect is shifted one character to the right.

For example, a couple of minutes ago I had these statements:

COMMIT;

SELECT period, COUNT(1)
from livload.udm_mob_liuos a
GROUP BY period;

I put the cursor over the word count and the statement that was executed (and highlighted) was

ELECT period, COUNT(1)
from livload.udm_mob_liuos a
GROUP BY period;

The highlighted text was extended to the first character of the empty row, exactly below of the statement.

I'll upload a screenshot as soon as this happens again, for sure several times a day. If I save the file and re-open it, the problem disappears, as well as if I copy the whole stuff to a new SQL Window

Aris
 
Last edited:
Yes, today I had the same problem even when there was no "--" cooment before my SQL. It just took the statement without the first character " S". Just like Arky said.
 
Just a hint: Maybe it is somehow related to window type switching. I'm using "Change Window to" > Program Window, Command Window, SQL window.
Not exactly with the file I'm having problems, but with other opened files.
 
The blue hot tracking sometimes gets off by a few characters and has been this way for several versions. It happens in the program window also and selecting functions is off by a bit. Saving, closing and reopening fixes it. It happens infrequently for me and I have never been able to reliably reproduce it. It kind of seems to happen towards the end of the day for me when there's lots of edits and changes to different windows, but I haven't noticed a pattern of what causes it.
 
I get the same error; Once on auto select fails to highlight the SELECT except the first character "S" it keeps failing to matter which select it happens on. My work around is I have to manually highlight the statement. Or quit PL-SQL Dev and start it over. sometimes just closing the SQL Window and re-opening might fix it until it happens again. It is very annoying and it has been happening since I have been using version 12.

It happen today several times.
 
I got it to fail. Then I re-open the file and could not get it to fail, after a few tries. These are the queries I had: It failed when I added the SQL that prompts starting with line 37. Line 1 would start with the dash line. You just have to keep randomly execute SELECTS until it fails.

-----------------------------------------------------------------------------------------------------------------
--Get Sys_context
SELECT '"usr="' || USER || '" osusr="' || sys_context('USERENV', 'OS_USER') || '" mach="' ||
sys_context('USERENV', 'HOST') || '" ip="' || sys_context('USERENV', 'IP_ADDRESS') || '" mod="' ||
sys_context('USERENV', 'MODULE') || '" act="' || sys_context('USERENV', 'ACTION') || '" id="' ||
sys_context('USERENV', 'CLIENT_IDENTIFIER') || '" info="' || sys_context('USERENV', 'CLIENT_INFO')
FROM dual;

--Get Session ID
SELECT USERENV('SESSIONID') FROM dual;

-----------------------------------------------------------------------------------------------------------------
--Get Sesssions Count by OSUSER
SELECT t.osuser,
COUNT(*)
FROM v$session t
GROUP BY t.osuser
ORDER BY 2 DESC;

-----------------------------------------------------------------------------------------------------------------
--Get Sesssions Count by Program
SELECT t.program,
COUNT(*)
FROM v$session t
GROUP BY t.program
ORDER BY 2 DESC;

-----------------------------------------------------------------------------------------------------------------
--Get Sesssions Count by Machine
SELECT t.machine,
COUNT(*)
FROM v$session t
GROUP BY t.machine
ORDER BY 2 DESC;

--Get by Username
SELECT t.sid,
t.serial#,
t.audsid,
t.user#,
t.username,
t.status,
t.server,
t.schemaname,
t.osuser,
t.process,
t.machine,
t.port,
t.terminal,
t.program,
t.type,
t.module,
t.action,
t.client_info,
t.logon_time
FROM v$session t
WHERE username = UPPER('&pUserName')
ORDER BY t.logon_time;

-----------------------------------------------------------------------------------------------------------------
--Get Sesssions
SELECT t.saddr,
t.sid,
t.serial#,
t.audsid,
t.paddr,
t.user#,
t.username,
t.command,
t.ownerid,
t.taddr,
t.lockwait,
t.status,
t.server,
t.schema#,
t.schemaname,
t.osuser,
t.process,
t.machine,
t.port,
t.terminal,
t.program,
t.type,
t.sql_address,
t.sql_hash_value,
t.sql_id,
t.sql_child_number,
t.sql_exec_start,
t.sql_exec_id,
t.prev_sql_addr,
t.prev_hash_value,
t.prev_sql_id,
t.prev_child_number,
t.prev_exec_start,
t.prev_exec_id,
t.plsql_entry_object_id,
t.plsql_entry_subprogram_id,
t.plsql_object_id,
t.plsql_subprogram_id,
t.module,
t.module_hash,
t.action,
t.action_hash,
t.client_info,
t.fixed_table_sequence,
t.row_wait_obj#,
t.row_wait_file#,
t.row_wait_block#,
t.row_wait_row#,
t.top_level_call#,
t.logon_time,
t.last_call_et,
t.pdml_enabled,
t.failover_type,
t.failover_method,
t.failed_over,
t.resource_consumer_group,
t.pdml_status,
t.pddl_status,
t.pq_status,
t.current_queue_duration,
t.client_identifier,
t.blocking_session_status,
t.blocking_instance,
t.blocking_session,
t.final_blocking_session_status,
t.final_blocking_instance,
t.final_blocking_session,
t.seq#,
t.event#,
t.event,
t.p1text,
t.p1,
t.p1raw,
t.p2text,
t.p2,
t.p2raw,
t.p3text,
t.p3,
t.p3raw,
t.wait_class_id,
t.wait_class#,
t.wait_class,
t.wait_time,
t.seconds_in_wait,
t.state,
t.wait_time_micro,
t.time_remaining_micro,
t.time_since_last_wait_micro,
t.service_name,
t.sql_trace,
t.sql_trace_waits,
t.sql_trace_binds,
t.sql_trace_plan_stats,
t.session_edition_id,
t.creator_addr,
t.creator_serial#,
t.ecid,
t.sql_translation_profile_id,
t.pga_tunable_mem,
t.con_id,
t.external_name
FROM v$session t
ORDER BY t.logon_time;
 
Back
Top