Announcement:
wanna exchange links? contact me at sapchatroom@gmail.com.
Posted by
Admin at
Reply from sats35 on Dec 16 at 9:32 AM nls_date_format is 'DD-MON-YY'. sy-datum FORMAT in SAP IS '20041216'. I tried...that. too CONCATENATE 'TO_DATE(' '''' sy-datum 6(2)'-' w_month '-' sy-datum 2(2) '''' ',' '''' 'DD-MON-YY' '''' ')' INTO w_date RESPECTING BLANKS. w_month is declared in MODULE POOL TOP as global variable which will get 'JAN' for 01 in sy-datum ( from a separate perform)
| | | ---------------Original Message--------------- From: Satish V Sent: Monday, December 15, 2014 11:07 PM Subject: Query on Oracle DB Table From ABAP Hi All, I am trying to query and fetch data from an oracle DB table using native sql from ABAP. I have used a simple query: data: db_msg(200) type C. data: w_date(32) type C. w_month is declared in TOP as global variable which will get 'JAN' for 01 in sy-datum ( from a separate perform) I have used all below formats ( given at end of query) to pass :w_date to the query below and none works. Everything erors out with ORA-01858: non-numeric character found where numeric is expected though same query works fine in Oracle DB environment ( SQLPLUS, TOAD etc), what could be the problem? I want to get the data from below query: EXEC SQL. select name into :db_msg from driver_pass where logdate = :w_date ENDEXEC. ==== different below formats of date were passed to w_date in the query above and was still getting error concatenate 'DATE ' '''' sy-datum 0(4)'-' sy-datum 4(2)'-' sy-datum 6(2) '''' into w_date RESPECTING BLANKS. / concatenate 'TO_DATE(' '''' sy-datum 6(2)'-' sy-datum 4(2)'-' sy-datum 0(4) ' 00:00:00' '''' ',' '''' 'DD-MM-RRRR HH24:MI:SS' '''' ')' into w_date RESPECTING BLANKS. / concatenate 'TO_DATE(' '''' sy-datum '''' ',' '''' 'YYYY-MM-DD' '''' ')' into w_date RESPECTING BLANKS. / CONCATENATE 'TO_DATE(' '''' sy-datum 6(2)'-' w_month '-' sy-datum 2(2) '''' ',' '''' 'DD-MON-YY' '''' ')' INTO w_date RESPECTING BLANKS. / CONCATENATE 'TO_DATE(' '''' sy-datum 6(2)'-' sy-datum 4(2)'-' sy-datum 0(4) '''' ',' '''' 'DD-MM-RRRR' '''' ')' INTO w_date RESPECTING BLANKS. MESSAGE i000(zmm) WITH w_date. / | | Reply to this email to post your response. __.____._ | _.____.__ |