Tuesday, April 3, 2018

ORA-01795: maximum number of expressions in a list is 1000

ORA-01795: maximum number of expressions in a list is 1000
01795. 00000 -  "maximum number of expressions in a list is 1000"
*Cause:    Number of expressions in the query exceeded than 1000.
           Note that unused column/expressions are also counted
           Maximum number of expressions that are allowed is 1000.
*Action:   Reduce the number of expressions in the list and resubmit.
Error at Line: 1,002 Column: 1

This is one of the differences between SQL server (management studio) and Oracle (Oracle SQL developer). It is especially problematic when I have a list of values in where statement. Use SQL server whenever possible.

Friday, March 9, 2018

github user set localy for the project

Often git user that I use on my machine is related with the company that I am working for. Sometimes I need to access my personal repositories to get some useful code, snipped or component that I can use. Sometimes during this process I modify something in that component and I want to push it to github as me and not as a different git user. Important part is to set local git preferences for the project; following commands are useful:

git config -llist all the config for git
git config -l --locallist config that is specific for given project
git config -l --globallist global configuration

Edit local config, set github username and email address to the one that is used in github.
git config -e --local

Set following fields:
 email = foobar@gmail.com 
 name = FirstName LastName 

Not being able to login to npm -- npm adduser not working

In various organisations it is common to code in environment that requires you to connect to a organisation specific repository or to use a specific user. Sometimes you want to push your package to a global npm (https://registry.npmjs.org/) repository and the process doesn't work. What I enjoy doing is to setup a local .npmrc file inside a project structure. Inside it I specify the registry configuration like:

registry = "https://registry.npmjs.org/"

adduser command runs in a scope of a registry. Often when you try to use it it tells you that your username doesn't exist, or user was incorrect because you were verifying against a server that is specified by registry parameter. Without running adduser command often your environment will pickup user credentials that are specified by your systeadmins and are related to a registry that is specific for the organization. That's why when you run following command w/o running ever adduser it often displays username:

If you run adduser command in a directory that has registry set to a different location your result will be different:

It is worth noticing that adduser command doesn't add any lines to local .npmrc file. File will only contain registry entry.