Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Native SQL query issue when fetching data from Oracle Server L2 Interface

Former Member
0 Likes
509

Dear All,

I am facing an issue when fetching data from Level 2 Oracle server using DBCO connection by writing native SQL. In legacy Oracle server  START_DATE column is having data stored in below format:

01/13/2011 09:37:56

When I am writing select query in ABAP editor in  below way I am getting date in this format (25-SEP-16) but time is not coming along with it as it is in same field as above. Can anybody please suggest me syntax to get date and time both

EXEC SQL.

     open c for

       SELECT * from L2PRD.REPORTS where start_date > TO_DATE('09-25-2016 00:00:00', 'MM:DD:YYYY HH24:MI:SS')

                                     AND AREA_ID = :'400'

   ENDEXEC.


Please help.


Regards,

Vipin Saraika

1 REPLY 1
Read only

Former Member
0 Likes
448

Hi Vipin,

Check the Declaration TYPE of a variable which is getting data in the format '01/13/2011 09:37:56',

Do not refer system fields and predefined data type (sy-datum,dats).

if you given as above change that TYPE to char 20.

ex: lv_date(20) type c.

if it helps u,pls give reward points.

Thanks,

Kiran.