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

Can not parse concatenated columns #30

Open
malpacasville opened this issue Dec 22, 2016 · 1 comment
Open

Can not parse concatenated columns #30

malpacasville opened this issue Dec 22, 2016 · 1 comment

Comments

@malpacasville
Copy link

Hi,
Sql that involves concatenating a string to a column or two columns together can not be parsed.

e.g.
var sql = "select FIELD1 || FIELD2 from MYTABLE";
require('sql-parser').lexer.tokenize(sql);

results in:

Error: NOTHING CONSUMED: Stopped at - '|| FIELD2 from MYTABLE'
at new Lexer (C:\MyProject\node_modules\sql-parser\lib\lexer.js:21:17)

I use Firebird SQL, so I'm not sure if this is valid in other SQL dialects.

@bojanbizjak
Copy link

Same issue.

SELECT code, code || ' : ' || value1 || ' ' || value2 as value from sig_sif

results in:

Uncaught Error: NOTHING CONSUMED: Stopped at - '|| value1 || ' ' || value2 as'
at new Lexer (sql-parser.js:26)
at Object.exports.tokenize (sql-parser.js:243)
at Object.exports.parse (sql-parser.js:1232)

I use SQLite.

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