simple-ddl-parser icon indicating copy to clipboard operation
simple-ddl-parser copied to clipboard

Support "& symbol"

Open kimjj81 opened this issue 3 years ago • 3 comments

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

I have sql for initialize db and tables with tablespaces and functions. & symbol can be used in function - bit and operator and with "tablespace" keyword in Vertica - like "CREATE TABLE ... TABLESPACE &DATASPACE"

Describe the solution you'd like A clear and concise description of what you want to happen.

I think there are 2 options.

  1. Accept & symbol
  2. option parameter - ignore then continue to process

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

Thank you for your work.

kimjj81 avatar Jun 09 '22 02:06 kimjj81

Hi @kimjj81, thanks for reporting the issue! can you provide some more details: in what DB allowed & in sql ddl? Can you just send link to the documentation. It will be really helpful. And to DATASPACE - where is it used? In what db. Thank you!

xnuinside avatar Jun 09 '22 05:06 xnuinside

Hi @xnuinside I have a legacy sql file to initialize DB - Vertica ( https://vertica.com/ ) In that file & used as below

DEFINE TS=&1
CREATE TABLE (.....) TABLESPACE &TS;


CREATE OR REPLACE FUNCTION ... $BODY$
DECLARE
SOME_EVENT RECORD;
EX VARCHAR(3);
BEGIN
......
IF OPTIONS&64 <> 0 THEN ........

Unfortunately, I don't know much about vertica, and I didn't find documents of 'TABLESPACE'.

Thanks for you reply.

kimjj81 avatar Jun 09 '22 06:06 kimjj81

@kimjj81 got it, thank you, I will work on it

xnuinside avatar Jun 09 '22 08:06 xnuinside

@kimjj81 this issue was fixed in version 0.28.0. I tested on sample:

DEFINE TS=&1
CREATE TABLE table( `id` INT NOT NULL) TABLESPACE &TS;

it produces normal output.

If will be needed anything else - feel free to open new issue.

And sorry that its takes so much time :)

xnuinside avatar Oct 31 '22 16:10 xnuinside