This content has been marked as final. Show 3 replies
Your syntax is wrong - it goes:1 person found this helpful
You are putting the to_char in the wrong spot. You can't put it in the column list - it needs to go in the values list. And to enter data into a date column, you want to_date. You want to convert a character string into its date representation.
insert into <table>[(columnlist)] values([valuelist])
insert into table (co1, col2, col3) values('ABC', to_date(:someval, 'DD/MM/YYYY'), to_date(:otherval, 'DD/MM/YYYY'))
Thank you so much. While doing a assement test on my chapter, I realized that I was suppose to use the TO_DATE function.
But I do wanna ask, just out of curiosity, why did it say 'missing comma' instead of 'incorrect syntax'?
The parser is unfortunately not always 100% helpful. Most likely it saw the first ( in your to_char and was expecting a field to be in there. I'd have to run it to see which line it is pointing to be sure - either way, no functions in the column list are accepted.
Glad it helped!