Solved

Reading Blob by crystal report

Posted on 2008-10-26
2
2,309 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 48

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 48

Expert Comment

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

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
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 shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.

734 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