13.04 and 13.0.6 - SQL files open as command file

maguirb

Member
Hi

I hope someone can help me.
Perhaps it's a an option/preference I haven't found yet that I can disable.

Some of my SQL files (I haven't yet found a common reason) open in PL/SQL developer as command files (the yellow file icon). Other SQL files open as the expected orange file icon.

I had 13.0.4 and it was happening there. Then I upgraded to 13.0.6 and still happens there.

How do I get all the SQL files to truly open as SQL files?
I'm guessing the software is checking something within the file and deciding to treat the file as a command file.

Thanks for any advice or assistance!
 
If you open a file through File > Open > SQL Script (or Command File) then the window type is explicitly chosen.

If you open a file through File > Reopen, it will be opened in the same window type in which it was previously opened.

If you open a file directly from the Windows Explorer (drag & drop or double-click) or from PL/SQL Developers File Browser, then the window type is determined by the File extension preferences (Preferences > Files / Extensions).
 
Thanks for the reply and the info

But that's not completely what I'm seeing in 13.0.4 and 13.0.6 in windows 7

For your examples of #1 and #2, yes that all is fine. I can get the expected results that way.

I can narrow down the issue now to how files open via windows explorer in windows 7.

I have my sql files with sql extension and the command files have the pdc extension. But some sql files are opening as command files.

Now here's what I have done with an example .sql that has this command file problem - I open it via the various methods below. I close it after each step.

1. via double-click in windows explorer - opens as command file

2. via plsql reopen - opens as command file (as expected based on what you said in your #2)

3. via plsql open as sql - this same file now opens as sql file (as expected based on what you said in your #1)

4. via plsql reopen - opens as sql file (as expected based on what you said in your #2)

5. via double-click in windows explorer - opens as command file again - how?!?

6. via plsql reopen - opens as command file (as expected based on what you said in your #2)

So based on all this - do I look at it is a weird pl/sql issue?
Or some kind of weird windows 7 issue in windows file types?

There was a recent upgrade to 13 from 12 in the last couple months so maybe something is messed up there in registry/config/windows file types?

I have screenshots of the above but don't want to put them on a public web page to post here (which looks to be the only way to show an image). I could email them to you Marco if you wish?
 
Did some more experimenting with the file extensions. Very weird results. Definitely looks to be a bug of some kind in my particular setup if nobody else gets this issue.

I totally removed the sql extension in pl/sql developer and registered file types.
Opened with double-click and picked pl/sql developer. The SQL file opened as a PL/SQL Block. Not what I wanted so I deleted that extension mapping.

Then I changed the default .SQL file extension in pl/sql developer to sql2 and put sql3 in the "others" part of SQL file types and registered file types.

I renamed the sql file that was opening from windows explorer as a command file to sql2 extension. It still opened as a command file.

I then renamed this sql2 file to the sql3 extension. It now opens as an sql file! Woo!

So I then removed sql2 and sql3 and left .SQL file extension blank and put sql under the .SQL others field and registered file types.

I changed the extension on the sql3 file back to sql and the file now opens via windows explorer into pl/sql developer as an SQL file!

Ugh! Painful and time-consuming process to figure out but it works.
 
5. via double-click in windows explorer - opens as command file again - how?!?

When opening a file from the Windows Explorer, PL/SQL Developer will determine the window type from the file extension. This seems consistent.
 
5. is not consistent if it opens an SQL file as a command file. That's the whole problem.

A command file is pdc and an sql file is sql.
I'm never opening command files in my examples. All those examples I gave were opening SQL files.

That's the issue I was describing. SQL files opening as command files.
 
Can you clarify #1 and #5?

1. via double-click in windows explorer - opens as command file

...

5. via double-click in windows explorer - opens as command file again - how?!?

Are both results incorrect?
 
Hi

Yes - both results of 1 and 5 are incorrect as it is an SQL file I am trying to open (with .sql extension).

1. is the bug I've found with SQL files opening as command files. The 1-6 show the whole gamut of it not working, then working, and then again not working with #5.

It looks to be something with the double-click. And it's not every SQL file. That's part of why this is weird. Anyways I have a workaround as I stated so if this is something you can't duplicate and nobody else is reporting then mark it as some weird issue you can't reproduce and don't worry about it anymore.

I'm fine with my workaround. Everything is now working as I expect.
 
Last edited:
Back
Top