I have a small doubt regarding xmltype.getStringVal().
the following is my type
- Code: Select all
create or replace type type_sample as object (
f_id number,
f_name varchar2(100),
f_start_date date,
f_end_date date
)
/
I am converting the above type to string xml using the below
- Code: Select all
SET SERVEROUTPUT ON
DECLARE
xmltype1 SYS.XMLType;
message type_sample;
BEGIN
message := new type_sample(1, 'Manohar', current_date, sysdate);
xmltype1 := XMLtype.createXML(message);
DBMS_OUTPUT.PUT_LINE('out_errm : '|| xmltype1.getStringVal());
END;
/
and the output of the above execution is as below
<TYPE_SAMPLE><F_ID>1</F_ID><F_NAME>Manohar</F_NAME><F_START_DATE>26-JAN-13</F_START_DATE><F_END_DATE>26-JAN-13</F_END_DATE></TYPE_SAMPLE>
I have a problem with my date field. In the previous execution it is coming in DD-MON-YY format, sometimes the same field is giving the output in DD-MM-YY format. This unexpected format is creating a problem for me. Can you please suggest, how to get output in the same format everytime.
<F_START_DATE>26-JAN-13</F_START_DATE>
Thank you,
Manohar RG