dynamobi/dynamobi — Issue #365: [FRG-404] Extended character literals
Author: dynamobi-build
Created: 2011-12-30 03:11:07+00:00
State: closed
Labels: DDL Parser, FRG

[reporter="jhyde", created="Tue, 29 Jun 2010 02:08:29 -0500 (GMT-05:00)"]
Allow extended character literals -- that is, literals consisting of more than one quoted section -- in DDL, and allow such literals even if not separated by line breaks. In particular, allow such literals in the OPTIONS clause of tables and columns.

> Julian Hyde wrote:

> In certain syntactic contexts, we support extended string literals, viz:

>

> SELECT 'abc'

> 'def' AS myString

> FROM emp

>

> Note that there is no '||' between the strings. And per the SQL

> standard, this syntax is only allowed if there is a line break or

> comments between the string fragments.

>

> But nevertheless, it is useful in building long strings.

>

> In other contexts, such as DDL, we don't support extended string

> literals. I would like to support them in the OPTIONS clause, e.g.

>

> CREATE TABLE foo (

> x int primary key options (

> baz 'abc'

> 'def'))

JVS:

Yes, please go ahead and fix this one. The standard actually says it

should work, so it's not even an extension:

::=

CREATE SERVER

[ TYPE ] [ VERSION ]

FOREIGN DATA WRAPPER [ ]

::= OPTIONS
paren>

::= [ {

}... ]

::=
[
]

::=

> Julian Hyde:

> [Further], I notice that in SQL:2008, the separator between string fragments can be

> any sequence of whitespace or comments; newlines are not required.

>

> SQL:2008, chapter 2, 5.3 :

>

> ::=

> [ ]

>

[ ... ]

> [ {

[ ... ]

}... ]

>

> ::=

> { | }...

>

> ::=

>

> |

>

>

::=

>

>

> So,

>

> SELECT 'abc' 'def' AS myString

> FROM emp

>

> would be valid.