Oracle SP Fails when called from Apex form due to date format -


i have table inserting , updating data using procedure based on input parameters. procedure called oracle apex form. procedure works fine in oracle. when call apex form, procedure fail error. on analysis, found because of date format mismatch in value passed apex form , in oracle.

date format in apex form-->16-aug-2017 

date format in oracle db-->2017-08-17

do need format input parameter in apex form before calling oracle procedure or need change format within procedure. please help.

apex treats item values strings e.g. '16-aug-2017'. if procedure calling expects date parameter need convert value before calling it. go against grain many people, in apex application happily use implicit conversion:

myproc (p_date => to_date(:p1_date)); 

this work regardless of date format setting in apex. alternative perform explicit conversion using prevailing apex date format this:

myproc (p_date => to_date(:p1_date, :app_nls_date_format)); 

but seems redundant me.

of course, procedure call going fail if value in p1_date not valid date in prevailing apex date format, should validate prior calling procedure. can using apex validation example. way have apex procedure layer accepts values strings, validates , converts them using common utilities, , calls main procedure.


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -