tschf / atom-build-oracle Goto Github PK
View Code? Open in Web Editor NEWOracle compilation plugin for atom-build
License: MIT License
Oracle compilation plugin for atom-build
License: MIT License
sed: 1: "/Users/giffy/.atom/pack ...": extra characters at the end of g command
Script took longer than expected
cat: /Users/giffy/.atom/packages/build-oracle/tmp/spooledCompilation.txt: No such file or directory
Setting: using sqlcl
Atom: 1.14.3 x64
Electron: 1.3.13
OS: Microsoft Windows 7 Enterprise
Thrown From: build-oracle package 1.5.2
Uncaught TypeError: Cannot read property 'path' of null
At ~\.atom\packages\build-oracle\lib\make.js:104
TypeError: Cannot read property 'path' of null
at doMatch (/packages/build-oracle/lib/make.js:104:83)
at /packages/build/lib/error-matcher.js:74:52
at Array.forEach (native)
at ErrorMatcher._parse (/packages/build/lib/error-matcher.js:73:38)
at ErrorMatcher.set (/packages/build/lib/error-matcher.js:131:10)
at /packages/build/lib/build.js:189:27)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at ChildProcess.cp.emit (/packages/build/node_modules/cross-spawn/lib/enoent.js:40:29)
at maybeClose (internal/child_process.js:877:16)
at Socket.<anonymous> (internal/child_process.js:334:11)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at Pipe._handle.close [as _onclose] (net.js:493:12)
-0:55.7.0 core:copy (input.hidden-input)
-0:55.3.0 application:new-file (input.hidden-input)
-0:54.7.0 core:paste (input.hidden-input)
-0:44.7.0 grammar-selector:show (input.hidden-input)
-0:42.5.0 core:confirm (input.hidden-input)
-0:41.3.0 build:select-active-target (input.hidden-input)
-0:00.9.0 build:toggle-panel (atom-workspace.workspace.scrollbars-visible-always.theme-one-dark-syntax.theme-one-dark-ui)
angularjs 0.4.0
atom-beautify 0.29.17
atom-bootstrap3 1.2.12
auto-indent 0.5.0
autoclose-html 0.23.0
autocomplete-abl 0.1.2
autocomplete-oracle 0.4.0
build 0.67.0
build-cmd 0.5.0
build-oracle 1.5.2
busy 0.7.0
ex-mode 0.13.1
highlight-selected 0.12.0
language-abap 1.1.0
language-abl 0.10.1
language-batchfile 0.5.2
language-oracle 1.6.2
linter 1.11.23
linter-bootlint 1.0.4
linter-javac 1.9.4
linter-jshint 3.0.2
linter-jsonlint 1.3.0
linter-pylint 1.2.2
minimap 4.26.8
minimap-linter 1.6.0
open-recent 5.0.0
scroll-sync 0.1.5
sort-lines 0.14.0
split-diff 1.2.0
tab-title 0.3.3
vim-mode-plus 0.82.3
vim-mode-plus-ex-mode 0.8.1
word-jumper 0.3.0
xml-formatter 0.10.0
I think it should default to having define set to off
set define off
May be an issue upstream
When a view source has errors, it gives:
Warning: View created with compilation errors.
This should result an error in the output
Would be nice if there were an option to use an existing tnsnames.ora file
This fails
/*+ materialize */
hintfrom
and join
create or replace force view vincent as
with something as (
select /*+ materialize */ 1 id
from dual
)
select 1 id
from dual d
join something s
on 1 = 1;
This works
/*+ materialize */
hintfrom
and join
create or replace force view vincent as
with something as (
select 1 id
from dual
)
select 1 id
from dual d
join something s
on 1 = 1;
This works
/*+ materialize */
hintfrom
and join
create or replace force view vincent as
with something as (
select /*+ materialize */ 1 id
from dual
)
select 1 id
from dual d
join something s
on 1 = 1;
Somehow the combination of the hint and the empty line fails the compilation.
Couldn't find it in the command pallet either.
Currently being developed on Linux, which should largely work for OS X.
Will need to cater for windows (no /bin/bash unless on cygwin)
SQLcl: Release 4.2.0 Production on Fri Mar 31 10:20:17 2017
<removed>
Compiling script: /home/trent/Projects/PureMigration/test.sql
Package FOO compiled
Package FOO dropped.
SP2-0564: Object "SCHEMA.FOO" is INVALID, it may not be described.
<removed>
dyld: Library not loaded: /ade/b/2649109290/oracle/sqlplus/lib/libsqlplus.dylib
Referenced from: /oracle/instantclient_11_2/sqlplus
Reason: image not found
sed: 1: "/Users/giffy/.atom/pack ...": extra characters at the end of g command
Script took longer than expected
This may be the solution: https://blog.caseylucas.com/2013/03/03/oracle-sqlplus-and-instant-client-on-mac-osx-without-dyld_library_path/
If I change sqlPath, the old value is still getting sent to the script
SqlPlus called with: sqlplus $4/$5@$1:$2/$3 @$6 $7
Will be more readable if the numbered args are named
Installed build-oracle and atom-build.
I think issue is with atom-build
The Error is "No eligible build target"
Please help me out.
Scenario: 3 build targets, dev, test, prod.
Most of the time, the workflow will be primarily building against dev, once everything is perfected, run against test and finally prod.
When using keyboard bindings to build (ctrl+alt+b), it may not be immediately apparent you are still active on the prod target.
I think it would be handy if after a build, it immediately reset to the default build target. If this is possible with the build provider, this could/should be a configuration in the settings.
Its specific to *nix enivironments
My structure looks like:
The release contains release.sql
which calls something in the packages folder:
prompt PACKAGES
@..\packages\vd_util.pks
@..\packages\vd_util.pkb
Result is:
SP2-0310: unable to open file "..\packages\vd_util.pks"
SP2-0310: unable to open file "..\packages\vd_util.pkb"
So it appears that any script atom-build-oracle
runs is treated like it's on the root folder, so we can't use relative paths.
Test case: the following code works (as if release.sql is in the root folder).
prompt PACKAGES
@packages\vd_util.pks
@packages\vd_util.pkb
Hello, i Need help in setup this package to Oracle-Xe, but i am new working with database, that some options like needed i can not successfully fill with the correct params.
eg.
sqlcl:
MY_USER DB NOW
-------------------- -------------------- -----------------------------------
HR XE 26/NOV/15 12:45:43.093359000 PM +11
:00
sqlplus:
MY_USER DB NOW
-------------------- -------------------- -----------------------------------
HR XE 26-NOV-15 12.47.35.705682 PM +11:00
Errors don't seem to be cleared between connections:
trent@birroth:~$ sql /nolog
SQLcl: Release 4.2.0.15.296.0549 RC on Sun Nov 29 12:21:42 2015
Copyright (c) 1982, 2015, Oracle. All rights reserved.
SQL> conn hr/[email protected]/xe
Connected
SQL> create or replace package foo
2 as
3 l_nn NUMBER := 22;comment will force an error
4 end foo;
5 /
Package FOO compiled
Errors: check compiler log
SQL> sho err
Errors for PACKAGE HR.FOO:
LINE/COL ERROR
-------- ------------------------------------------------------------------------------
3/32 PLS-00103: Encountered the symbol "FORCE" when expecting one of the following:
:= . ( @ % ; not null range default character
SQL> disconnect
Disconnected from Oracle Database 11g Express Edition Release 11.2.0.2.0 - 64bit Production
SQL> conn hr/[email protected]/xe
Connected
SQL> sho err
Errors for PACKAGE HR.FOO:
LINE/COL ERROR
-------- ------------------------------------------------------------------------------
3/32 PLS-00103: Encountered the symbol "FORCE" when expecting one of the following:
:= . ( @ % ; not null range default character
SQL>
Getting the following error when installing this package in a new environment.
C:\Users\trent\.atom\packages\build-oracle\node_modules\atom-package-deps\lib\view.js:18 Uncaught (in promise) TypeError: this.notificationView.querySelector is not a function
at new View (C:\Users\trent\.atom\packages\build-oracle\node_modules\atom-package-deps\lib\view.js:18:43)
at C:\Users\trent\.atom\packages\build-oracle\node_modules\atom-package-deps\lib\helpers.js:10:18
at next (<anonymous>)
at step (C:\Users\trent\.atom\packages\build-oracle\node_modules\atom-package-deps\lib\helpers.js:45:273)
at C:\Users\trent\.atom\packages\build-oracle\node_modules\atom-package-deps\lib\helpers.js:45:443
at C:\Users\trent\.atom\packages\build-oracle\node_modules\atom-package-deps\lib\helpers.js:45:99
at installDependencies (C:\Users\trent\.atom\packages\build-oracle\node_modules\atom-package-deps\lib\helpers.js:34:16)
at Object.<anonymous> (C:\Users\trent\.atom\packages\build-oracle\node_modules\atom-package-deps\lib\index.js:23:46)
at next (<anonymous>)
at step (C:\Users\trent\.atom\packages\build-oracle\node_modules\atom-package-deps\lib\index.js:34:273)
The original post I got this idea from - http://wphilltech.com/sublime-text-for-oracle-apex-developers/ - mentioned about some variables that need to be set - which seem specific to OS X.
# set PATHXX /bin:/sbin:/usr/bin:/usr/sbin:/Volumes/Daten/Users/oracle/instantclient
# set SQLPATH /Applications/instantclient_10_2
# set DYLD_LIBRARY_PATH /Applications/instantclient_10_2
# set TNS_ADMIN /Applications/instantclient_10_2/network/admin
Find a way to test and document this stuff
Idea for an upcoming version: supporting multiple connection strings. If multiple connection strings are available, user would have to choose which one to use.
.atom-build-oracle.json example:
[
{
"targetName" : "hr: dev",
"connectString" : "hr/hr@XE1"
},
{
"targetName" : "hr: test",
"connectString" : "hr/hr@XE2"
}
]
Thoughts?
Suppose I have two blocks in the script I'm compiling, and the first block throws an error - I'm inclined to think the script shouldn't continue running.
Consider the following:
begin
dbms_output.put_line('Running block one');
raise_application_error(-20000, 'Error');
end;
/
begin
dbms_output.put_line('Should this be reached? Initial thoughts, no');
end;
/
Will output,
Compiling script: /home/trent/Projects/PureMigration/test.sql
Running block one
begin
*
ERROR at line 1:
ORA-20000: Error
ORA-06512: at line 3
Should this be reached? Initial thoughts, no
PL/SQL procedure successfully completed.
No errors.
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
By adding whenever sqlerror exit
, we can avoid ever reaching that second block of code - which I feel makes the most sense.
Compiling script: /home/trent/Projects/PureMigration/test.sql
Running block one
begin
*
ERROR at line 1:
ORA-20000: Error
ORA-06512: at line 3
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
So, it should install the build
package when installing.
Cannot read property 'toString' of undefined
TypeError: Cannot read property 'toString' of undefined
at OracleBuildConfig.settings (/home/trent/.atom/packages/build-oracle/lib/make.js:52:46)
at /home/trent/.atom/packages/build/lib/target-manager.js:75:30
May be related to #23.
I have made a modification to https://github.com/tschf/atom-build-oracle/blob/master/lib/make.js#L58
so it compiles on Windows. It is now:
"", // pkgDir
Now I am able to run both sqlplus and sqlcl, nice!
But it appears like the build runs endlessly:
Unless a do a Build: Stop
manually. Weird because the result set is returned pretty quickly.
Example 1:
view.sql:
CREATE OR REPLACE VIEW "HR"."V_VIEW_SAMPLE" as
select
dbms_random.string('U', 12) str
from dual;
Output:
Database connection information
MY_USER DB NOW
-------------------- --------------- ----------------------------------------
HR XE 31-AUG-16 06.33.31.955862 PM -04:00
Compiling script: /home/trent/Projects/build-oracle/samples/view3.sql
SP2-0734: unknown command beginning "dbms_rando..." - rest of line ignored.
SP2-0042: unknown command "from dual" - rest of line ignored.
Example 2
tbl.sql:
create table x(
n number
);
Output:
Database connection information
MY_USER DB NOW
-------------------- --------------- ----------------------------------------
HR XE 31-AUG-16 06.35.38.309446 PM -04:00
Compiling script: /home/trent/Projects/build-oracle/samples/tbl1.sql
SP2-0042: unknown command "n number" - rest of line ignored.
SP2-0042: unknown command ")" - rest of line ignored.
Both are resolved by removing blank lines.
Specifically for SQL*Plus.
My path in .bashrc
has: export PATH=$PATH:$GOPATH/bin:/opt/sqlcl/bin
When I run the code in Atom:
cp = require('child_process')
cp.exec "echo $PATH > /tmp/pathFromAtom.txt"
This file does not contain those last 2 entries.
I am trying to use sqlplus to connect to my Oracle database. When running SQLPlus from command line it works. I created the .atom-build-oracle.JSON file with the settings per your instructions. I also have "build" package installed. When I try to execute a query by pushing F9, I get the error "No configuration to build this project exist". Do I need to add something else in my .atom-build-oracle.JSON file? Any help would be appreciated. Thanks!
...should be stored in session, but not permanent in a config file.
Could be a security problem to store the password in a plaintext JSON file
SP2-0735: unknown SET option beginning "serveroupu..."
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.