We have added search box. Key in SAP issue keyword to search
TopBottom

Announcement: wanna exchange links? contact me at sapchatroom@gmail.com.

RE:[sap-abap] Query on Oracle DB Table From ABAP

Posted by Admin at
Share this post:
Ma.gnolia DiggIt! Del.icio.us Yahoo Furl Technorati Reddit

Reply from sats35 on Dec 16 at 1:08 AM
I tried ..but no success.

I even tried..

data: w_date(48) type c.

concatenate 'TO_DATE( ' '''' sy-datum+0(4) sy-datum+4(2) sy-datum+6(2) ' 000000' '''' ',' '''' 'RRRRMMDD HH24MISS' '''' ' )' into w_date RESPECTING BLANKS.

---------------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.
 
__.____._
Manage Settings | Unsubscribe | Create FAQ | Send Feedback
  
Copyright © 2014 Ziff Davis, LLC. and message author.
Ziff Davis, LLC. 28 E 28th Street New York, NY 10016
sats35  

achievements
 
Mark as helpful
View this online
Ask a new question
 
In the Spotlight
Become a blogger at Toolbox.com and share your expertise with the community. Start today.

_.____.__

0 comments:

Post a Comment

T r a n s l a t e to your language