on 10-18-2007 10:38 PM
Hi All,
I'm having SERIOUS problems trying to insert a simple date value in my oracle.
I did this one million times before in xMII 11.5, but now it appears that doesn't work anymore!
Here are some info:
Data Server Config:
Date Prefix: TO_DATE('
Date_Sufix: ', 'MM/DD/YYYY HH24:MI:SS')
Internal Date Format: yyyy-MM-dd HH:mm:ss
In my Query Template:
Date and Time Format: MM/dd/yyyy HH:mm:ss
In my Transaction
Parameter: datefromxmlformat(datenow, "MM/dd/yyyy HH:mm:ss")
I also tried change the parameter to datenow, no success.
I tried to change the Query Template format, no success.
Finally, I tried to change my Date prefix & sufix, no success too.
I really don't know what else I can do. I would appreciate some help.
PS: I'm using xMII 12.0.1 with ojdbc14.jar
Thanks in advance.
Pedro Sena
Pedro,
The Data Server config for InternalDateFormat should be: MM/dd/yyyy HH:mm:ss
This is because it is used in conjunction with the DatePrefix and DateSuffix whenever you use the DateColumn or the [SD] and [ED] tokens in a query template.
If you are inserting a date field with an arbitrary parameter (not a date token like above) then you need to use the TO_DATE wrapper pieces around your date field string.
The DateFormat in the query template controls the format of the StartDate and EndDate buttons in the applet toolbar if using an iChart/iSPCChart/iGrid and a time sensitive query, but when you build the string for an insert parameter you must manage the whole format yourself.
If you really just want datenow and the xMII server time is sufficient for your insert query then you can leverage the Data Server config settings like: INSERT INTO TABLE VALUES([ED)
This way the default query template time settings will use 'now' for the end date of the query and when the string is sent to Oracle it will actually look like:
INSERT INTO TABLE VALUES(TO_DATE('10/19/2007 08:41:00', 'MM/DD/YYYY HH24:MI:SS'))
Regards,
Jeremy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jeremy,
I was looking for a solution that doesn't include put a TO_DATE in every date field of my query but I think that this is not possible.
I changed my Internal Date Format like you said and my query template to:
INSERT INTO OI(TESTE) VALUES (TO_DATE('[Param.1]', 'MM/DD/YYYY HH24:MI:SS'))
and now its working...
It's not exactly what I wanted but at least works...
Thanks
Pedro - please re-read the last two sentences in my initial response to your post.
You can set the StartDate property of the query action (use the string format the matches the DateFormat or take a look at the QueryStartDate link in the SQLQuery action and notice that it uses the XML date format) and then use [SD] in your insert statement. The dateprefix and datesuffix handling will be done automatically.
To learn better how these work you can just build a simple select statement in a fixed query and see the responses, then turn it into the desired INSERT statement.
Regards,
Jeremy
User | Count |
---|---|
11 | |
6 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.