Hi,
I'm trying to create a group to capture the query part of CREATE VIEW sql statement, an example is:
CREATE VIEW schema.view AS SELECT 1 col1 FROM dual;
For the application I am working on it is sufficient to capture the text of the SELECT query without checking it is valid etc. So I started with a grammar like this:
{Id Ch Standard} = {Alphanumeric} + [_#$]
{Id Ch Extended} = {All Printable} - ['"']
Id = ({Letter}{Id Ch Standard}* | '"'{Id Ch Extended}+'"')
Query Start = 'AS SELECT'
Query End = ';'
Query Block @= { Nesting = All, Advance = Character }
"Start Symbol" = <Grammar>
<Grammar> ::= <Root>
<Root> ::= <CreateView>
<ObjectName> ::= Id '.' Id
| Id
<CreateView> ::= CREATE VIEW <ObjectName> Query
All seems to work but it requires AS SELECT to be on the same line, a new line between AS and SELECT breaks it. How do I create a group like this where the
whitespace is not important? I believe I have to include the 'AS' keyword because otherwise the Query block would clash with the syntax for GRANTS, ie GRANT SELECT ON schema.table TO user;
Thanks for your help,
Neil