Oct 192016
 

I’m using node.js on Windows. Not ideal, I know. Installing node modules globally means something else than you might expect. Globally means “not in the project folder”. It does not mean “for all users on this computer”, like you’re used to when installing applications.

Node itself is installed in the “Program Files” folder by default. To enable a Windows-like “global” install, try using:

npm config set prefix "%ProgramFiles%\nodejs"

That way the “–global” directive will install the module in the node folder itself, making it available globally in the node way of thinking and in the Windows way of thinking.

Of course, if you didn’t install node.js in the default folder, just replace the “%ProgramFiles%\nodejs” with yours.

If for some reason you want things back to what it was, remove the prefix by issuing the following command:

npm config rm prefix

Oct 102016
 

My colleague needed to use a function in the database in a query, but found that the function was not defined/reachable in his schema. So the solution is to ask for the function to be granted to you, or to create the function in your schema, or…

…use the new WITH enhancement available from Oracle 12c.

Here is a very simple example, that squares a number and returns it. The function is used in the query. How nice :-p

with
  function s(x in integer) return integer is
  begin
    return x*x;
  end;
  
  q as (select 1 n from dual union all select 2 from dual)
  
  select q.n,s(q.n) from q
/