• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 854
  • Last Modified:

missing expresion

what is wrong with this statement
the fields of the table are:
pin_no varchar2(12)
amount number(10,3)
payment_type varchar2(20)
payment_date date
index_no varchar2(12)
c_card_no varchar2(20)
check_no number(20)
accou_no number(15)
exp_date date
bank varchar2(20)
operator varchar2(20)
code varchar2(20)

------------------------------------------------------------
insert into customer_credit values('WEB00001', 10,'PrePaid CC', to_date('10/15/1999 09:03:00','mm/dd/yyyy hh24:mi:ss'),'','4111111111111111',,,to_date('01/10/1999','mm/dd/yyyy'),'','self','Cyber')
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[Microsoft][ODBC driver for Oracle][Oracle]ORA-00936: missing expression

/michaelmarom-23/mck-cgi/directpaycredit.asp, line 73
0
Info_user100
Asked:
Info_user100
1 Solution
 
meowshCommented:
try this

insert into XYZ
values
('WEB00001'
, 10
,'PrePaid CC'
, to_date('10/15/1999 09:03:00'
,'mm/dd/yyyy hh24:mi:ss')
,NULL
,'4111111111111111'
,NULL
,NULL
,to_date('01/10/1999','mm/dd/yyyy')
,NULL
,'self'
,'Cyber')
/


I always try to code NULL when I dont want to insert into a field as opposed to using ,, or ,''.

It also good practice to list the field names you are inserting into.

e.g.

Insert into <table>
(<col1>,<col2>,<col3>)
values
(<val1>,<val2>,<val3>)

then if the table changes the insert statement will still run....in your current way if you add another field to the table the insert statement will fail.

Meowsh
0
 
Info_user100Author Commented:
Meowsh you were right the absence of NULL was throwing me off.      

Thanks
Max.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now