Solved

Reading Blob by crystal report

Posted on 2008-10-26
2
2,294 Views
Last Modified: 2013-11-16
Hi experts,

I'm upgrading JDE from Xe to 8.12 and found that the spec of F00165 has been changed. Text attachment was stored as long string in rtf format but now has become blob. I'm using crystal report to get the text attachment but now it doesn't work. Can anyone enlighten me how to do it with blob?
0
Comment
Question by:kennysflau
  • 2
2 Comments
 
LVL 47

Accepted Solution

by:
schwertner earned 500 total points
ID: 22810868
Read this:

http://www.jdelist.com/ubb/showflat.php?Cat=0&Board=Crystalreports&Number=123971&page=0&view=collapsed&sb=7&o=&fpart=1



The view looks like this:

------------------------------------------------------
connect PRODDTA/XXXXXX@XXXXXX;
CREATE OR REPLACE VIEW f00165_view(
NameObject_GDOBNM ,
GenericTextKey_GDTXKY ,
SeqNo_GDMOSEQN ,
MediaObjType_GDGTMOTYPE ,
LanguagePreference_GDLNGP ,
UpdatedByUser_GDUSER ,
DateUpdated_GDUPMJ ,
TimeOfDay_GDTDAY ,
ObjectTypeName_GDGTITNM ,
QueueName_GDQUNAM ,
FileName_GDGTFILENM ,
MediaObjectVariableLeng_GDTXVC)
AS SELECT
GDOBNM,
GDTXKY,
GDMOSEQN,
GDGTMOTYPE,
GDLNGP,
GDUSER,
JDE2Date(GDUPMJ),
GDTDAY,
GDGTITNM,
GDQUNAM,
GDGTFILENM,
JDETextFix(ROWID)
FROM F00165
WHERE GDGTMOTYPE = 0
WITH READ ONLY;
---------------------------------------------------------------------

Note that there are 2 Oracle Function Calls in this select.
The first one, JDE2DATE, just converts the JDE Julian Date to a standard date.
The second, JDETextFix(ROWID), does data type conversion on the BLOB data field. Here's the function I wrote to do this:
---------------------------------------------------------------------
CREATE OR REPLACE FUNCTION "PRODDTA"."JDETEXTFIX" (p_rowid in
ROWID) RETURN VARCHAR2
IS
v_textout VARCHAR2(4000);
v_lob BLOB;
v_buffer RAW(8192);
v_offset INTEGER := 1;
v_textlen BINARY_INTEGER := 8192;
v_rawlen NUMBER;
v_from_set RAW(2);
v_to_set RAW(1);
v_output RAW(8192);
BEGIN
SELECT gdtxft INTO v_lob
FROM F00165 where ROWID = p_rowid;
DBMS_LOB.READ (v_lob, v_textlen, v_offset,v_buffer);
v_textout := ' ';
v_from_set := HEXTORAW('7D00');
v_to_set := HEXTORAW('7D');
v_output := UTL_RAW.TRANSLATE (v_buffer, v_from_set, v_to_set);
v_rawlen := UTL_RAW.LENGTH (v_output);
if (v_rawlen > 4000) then
v_rawlen := 4000;
end if;
if (v_rawlen > 0) then
v_textout := UTL_RAW.CAST_TO_VARCHAR2 (UTL_RAW.SUBSTR(v_output,1,v_rawlen));
end if;
RETURN (v_textout);
EXCEPTION WHEN NO_DATA_FOUND THEN
RETURN (v_textout);
END;
0
 
LVL 47

Expert Comment

by:schwertner
ID: 22829857
Thank you very much!
Good luck!
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I showed you how to use console view (HERE (http://www.experts-exchange.com/articles/18379/Getting-Started-and-Using-the-Salesforce-com-Console.html)) -– but how do you set it up on the admin side of Salesforce? Note that you have to have Admin leve…
For cloud, the “train has left the station” and in the Microsoft ERP & CRM world, that means the next generation of enterprise software from Microsoft is here: Dynamics 365 is Microsoft’s new integrated business solution that unifies CRM and ERP fun…
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question