Hello
I've been struggling for a while with the output of one of my SPs
It goes like this:
Begin
Declare cursor as query
loop and write lines to a file
end
Problem is, I cannot seem to be able to set NLS settings properly. I need the dates to come out as YYYY-MM-DD HH24:MI:SS but it doesnt seem to work at all. Columns are DATE datatype but no matter what I do (Obviously I am doing something wrong!) I am not able to get HH24:MI:SS output only YYYY-MM-DD.
I've tried using TO_DATE in the query, executing immediate ALTER SESSION SET NLS_DATE.. , using DBMS_SESSION.SET_NLS . Nothing seems to work, any help is appreciated (Maybe I am misplacing the DMBS_SESSION.SET_NLS or something?).
Sample code:
CREATE OR REPLACE PROCEDURE TEST (parameters.. ) AS
/*variables*/
BEGIN
DECLARE CURSOR c_AICTT IS
SELECT TO_DATE(DATE1,'YYYY-MM-DD HH24:MI:SS'), DATE2 FROM DATES;
.
.
.
Thanks in advance,
N K