Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on FORMAT FILE #22

Open
Treverr opened this issue Oct 15, 2020 · 7 comments
Open

Error on FORMAT FILE #22

Treverr opened this issue Oct 15, 2020 · 7 comments

Comments

@Treverr
Copy link

Treverr commented Oct 15, 2020

I have everything in stalled, but for some reason when I try to format anything it gives me this error:

Error On FORMAT FILE
/Users/treverchambersewing/.vscode/extensions/mp.vscode-oracle-format-0.1.5/format_temp.sql /Users/treverchambersewing/.vscode/extensions/mp.vscode-oracle-format-0.1.5/format_temp.sql

I checked and it looks like its there, and formatted. Permissions look okay, too.

Any ideas? I'm running macOS.

@mickeypearce
Copy link
Owner

mickeypearce commented Oct 20, 2020

Hi @Treverr .
So the temp file content is formatted (format_temp.sql) but your original file is not?
Can you try saving your original file before formatting maybe ?

@Treverr
Copy link
Author

Treverr commented Oct 20, 2020

Hello,

Yes my original file is saved. I diff'ed the two files (original and format_temp.sql) and they appear to be the same.

This isn't working on my PL/SQLs but is working with standard SQLs. Is that to be expected? This seems to be happening on all PL/SQL files that are kinda complex.

Thank you!

@mickeypearce
Copy link
Owner

Could be a syntax issue. Take a look at #19 (comment)
I am not sure but maybe / at the end of file causes format error for example..

@Treverr
Copy link
Author

Treverr commented Oct 22, 2020

Hi,

I am having the same issue with a very simple SQL:

-- need to delete from the db
DELETE FROM xxx WHERE xxx = xxx;

Gives me the same formatting error as before (sorry I had to mask my company stuff)

@mickeypearce
Copy link
Owner

Take a look at "Output" panel of VS Code in the oracle-format tab you should see original input and output of sqlcl command. Maybe you will find some useful info there... It could be that sqlcl version is having some problems.

@Treverr
Copy link
Author

Treverr commented Oct 23, 2020

Here is what I see there:

"/Users/treverchambersewing/Downloads/sqlcl/bin/sql" /nolog @"/Users/treverchambersewing/.vscode/extensions/mp.vscode-oracle-format-0.1.5/format.sql"

SQLcl: Release 20.2 Production on Fri Oct 23 13:28:30 2020

Copyright (c) 1982, 2020, Oracle.  All rights reserved.



SQL> format file "/Users/treverchambersewing/.vscode/extensions/mp.vscode-oracle-format-0.1.5/format_temp.sql" "/Users/treverchambersewing/.vscode/extensions/mp.vscode-oracle-format-0.1.5/format_temp.sql"
Error On FORMAT FILE /Users/treverchambersewing/.vscode/extensions/mp.vscode-oracle-format-0.1.5/format_temp.sql /Users/treverchambersewing/.vscode/extensions/mp.vscode-oracle-format-0.1.5/format_temp.sql 
FORMAT
---------

FORMAT BUFFER - formats the script in the SQLcl Buffer
FORMAT RULES <filename> - Loads SQLDeveloper Formatter rules file to formatter.
FORMAT FILE <input_file> <output_file> 

Format used is default or for SQLcl can be chosen by setting an environmental variable
pointing to a SQLDeveloper export (.xml) of formatter options.
The variable is called SQLFORMATPATH
In SQLDeveloper the format options are the default chosen in the preferences.
SQL> exit

@mickeypearce
Copy link
Owner

No idea unfortunately. You could manually run sqlcl from the terminal to see if there is any difference and try new version of sqlcl (20.3) that was released recently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants