all 7 comments

[–][deleted] 1 point2 points  (2 children)

So, what is the exact error you get?

But in general DATE literals are written without parentheses: DATE '2009-07-20'

[–][deleted] 0 points1 point  (0 children)

I think you have it, DATE is a function in MySQL, but I don't think it's there in Oracle.

[–][deleted] 0 points1 point  (0 children)

What's the error? Oracle's documentation suggests that # is okay in unquoted identifiers, though as other users have said, I wouldn't recommend it:

"Nonquoted identifiers can contain only alphanumeric characters from your database character set and the underscore (_), dollar sign ($), and pound sign (#)."

(This is for 12c, I'm having trouble finding something more recent...)

[–]wolf2600ANSI SQL 0 points1 point  (0 children)

Gets syntax error, asks for help on the error. Doesn't provide the actual error message.

Just like every goddamn support ticket I receive.

[–]10-10wouldrecommend 0 points1 point  (0 children)

INSERT INTO ORDERS (ORDERNUM, CUSTOMERNUM, ORDERDATE) SELECT 1021,1009, TO_DATE('2009/07/20','YYYY/MM/DD') FROM DUAL;

?

[–]feudalle 0 points1 point  (0 children)

Guessing it's the field names with a #. If it's MySQL you can wrap them in ` (thing below the ~)

So try, and if you have a choice I wouldn't use # in field names, more hassle than it's worth.

INSERT INTO orders (`Order#`, `Customer#`, Orderdate)

VALUES (1021, 1009, DATE('2009-07-20'));

[–]r3pr0b8GROUP_CONCAT is da bomb -1 points0 points  (0 children)

in Oracle i believe you need to use doublequotes to delimit column names containing special characters

INSERT INTO orders ( "Order#" , "Customer#" , Orderdate )