Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: syntax problem??

Re: syntax problem??

From: Graham Miller <lgmiller_at_elmrd.u-net.com>
Date: Mon, 20 Apr 1998 06:43:47 GMT
Message-ID: <353cebf3.1519335@news.u-net.com>


Martin Meadows <mmeadows_at_indy.net> wrote (in <353AA075.4DE6_at_indy.net>)...

| Hi.
|
| I'm trying to execute an insert command from some cobol source and
| I'm having no luck at all.
|
| The source looks like this:
|
| EXEC SQL
| INSERT INTO PAYROLL_TRANSACTION_DETAIL
| (ptd_emp_#, ptd_date, ptd_acct, ptd_log_date, ptd_log_user,
| ptd_pco_#)
| VALUES (111,'19-apr-98','111','19-apr-98','Meadows',111)
| END-EXEC.
|
| After I execute the above statement I check the sqlca structure to see
| if it
| worked. SQLCODE comes back with a value less than 0 & here's what's in
| SQLERRMC:
|
| ORA-00917: missing comma
|
| So what's it trying to tell me??? Looks to me like all the commas are
| there.
|
| Thanks in advance for any advice & assistance you can provide.
|
| Martin Meadows

Hello,
  Just some guesses on my part.

  1. The '#' symbols may be confusing the parser. I would enclose those column names in speech marks ( " ). However, the name must be entered *exactly* as it seen in the sqlplus describe command. i.e. in upper case.
  2. It is good practice to always use the 'to_date' function with a format mask when inserting date literals into an Oracle database. This is because the default date format is decided by the NLS_DATE_FORMAT parameter and if it changed then your code will stop working.

graham Received on Mon Apr 20 1998 - 01:43:47 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US