Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Trigger Problems with to_date()
Hi there,
I'm using php/pear to connect to several databases. One is oracle. When I'm
adding a german formated date string to a date field in oracle usually the
rdbms returns an error
insert into table (datefield) values ('1.1.2004 10:10:10')
what I hav to do is using to_date.
insert into table (datefield) values (to_date('1.1.2004 10:10:10'))
Since I using php-pear I dont want to add extra code to the web site, I started to write an oracle trigger to convert my date string into a oracle readable format.
unfortunately my trigger:
:new.von := to_date(:new.von,'dd/mm/yyyy hh24:mi:ss'); :new.bis := to_date(:new.bis,'dd/mm/yyyy hh24:mi:ss');
//:new.von = '24.10.2004'
//:new.bis = '24.10.2004'
end;
doesn't work.
I still get the same error message
"[1]: (Error): ORA-01830: date format picture ends before converting entire
input string"
What am I doing wrong?
P. Received on Mon Jan 12 2004 - 10:38:30 CST
![]() |
![]() |