Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Oracle Apex 5.1 apex_util.get_blob_file_src

Amatu Allah Neveen EbrahimOct 21 2018 — edited Oct 26 2018

Hello,

My environment is

--------------------

Oracle apex 5.1

ords. 18.1.1.95.1251

Oracle Database release 11.2.0.4.0

Os Windows 8.1 64-bit

jdk1.8.0_181

Google Chrome Version 69.0.3497.100 (Official Build) (64-bit)

-----------------------------------------------------------------------

I am trying to display the employee blob image using apex_util.get_blob_file_src i got the following url

Escape special characters > set to > NO

--------------------------On page Load ------------------------------------

$('.a-TreeView-label').each(function(){

//var $this = $(this);

var t = $this.text();

$this.html(t.replace('&lt','\<').replace('&gt', '>'));

});

-----------------------------------------------------------------------

My Table database is

----------------------------

G_Dept > id > dept_id > PK

G_Sub_Dept > sub_dept_id > PK + dept_id FK

G_Emp_pic > dept_id+ sub_dept_id+ emp_id 3 PKs

------------------------------------My Sql Tree ---------------------------------------

select case when connect_by_isleaf = 1 then 0

        when level = 1             then 1

        else                           -1

   end as status, 

   level, 

   --- Start Title

   -------------------

   case when dbms\_lob.getlength( PIC ) = 0 THEN NULL ELSE 

   case when MIMETYPE   LIKE 'image%'then 

   '\<img class="image" src="'||apex\_util.get\_blob\_file\_src('P7\_EMP\_PIC',EMPLOYEE)||'" width="100px"/>'

   END

   END

   ||

   label||': '||  name as title, 

  -- 'icon-tree-folder' as icon, 

  case   when item\_type = 'D' then  'icon-tree-folder' --'fa-file-text-o'

         when item\_type = 'S' then    'fa-caret-square-o-right'          

         when item\_type = 'E' then     '\<img class="image" src="'||apex\_util.get\_blob\_file\_src('P7\_EMP\_PIC',EMPLOYEE)||'" width="100px"/>' --'fa-minus-square-o' --'fa-caret-square-o-right'

   else null

   end as icon, 

   "ID" as value, 

   -- Start tooltip

   ---------------------

  case when dbms\_lob.getlength(PIC) = 0 THEN NULL ELSE 

  case when MIMETYPE  LIKE 'image%'then 

   /\*'\<img src="f?p=&APP\_ID.:0:&APP\_SESSION.:APPLICATION\_PROCESS=GETFILE:::FILE\_ID:'||EMP\_ID||'" width="400" ">'\*/

   '\<img  src="'||apex\_util.get\_blob\_file\_src('P7\_EMP\_PIC',EMPLOYEE)||'" width="300px"/>'

   END

   END

  ||

'\<figcaption>'|| name||'\</figcaption>'

   as tooltip,

     ---Start  link 

       --------------

      case when item\_type = 'D' then 

                apex\_util.prepare\_url('f?p='||:app\_id||':14:'||:app\_session||':D:::P8\_SELECTED\_NODE,P14\_DEPT\_ID:'||id||','||id)

       when item\_type = 'S' then

                apex\_util.prepare\_url('f?p='||:app\_id||':17:'||:app\_session||':D:::P8\_SELECTED\_NODE,P17\_DEPT\_ID,P17\_SUB\_DEPT\_ID:'||id||','||link)

     when item\_type = 'E' then 

                apex\_util.prepare\_url('f?p='||:app\_id||':7:'||:app\_session||':D:::P8\_SELECTED\_NODE,P7\_DEPT\_ID,P7\_ROWID:'||id||','||link)

   end as link 

from (

select

 'D' item\_type,

   t.label label,

   to\_char(a.DEPT\_ID) id,

   NULL parent,

   a.DNAME name,

NULL PIC,

null MIMETYPE,

null EMPLOYEE,

   null tooltip,

   null link

from G_DEPTS a, (select wwv_flow_lang.system_message('Main Department') label from dual) t

union all

select 

 'S' item\_type,

   v.label label,

 to\_char(b.DEPT\_ID)  ||'-'|| to\_char(b.SUB\_DEPT\_ID) id,

    to\_char(b.DEPT\_ID) parent,

   b.SUB\_DNAME name,  

NULL  PIC,

null MIMETYPE,

null EMPLOYEE,

   NULL tooltip,

   null link

from G_SUB_DEPTS b, (select wwv_flow_lang.system_message('Sub-Department') label from dual) v

union all

select

 'E' item\_type,

   u.label label,

   to\_char(c.DEPT\_ID)||'-'||to\_char(c.SUB\_DEPT\_ID)||'-'||to\_char(c.EMP\_ID)    id,

  to\_char(c.DEPT\_ID) ||'-'|| to\_char(c.SUB\_DEPT\_ID) parent,

   c.F\_NAME  name,

EMP\_PIC   PIC,

MIME\_TYPE MIMETYPE,

c.EMP\_ID EMPLOYEE,

   NULL tooltip,

   c.DEPT\_ID||','||c.rowid link

FROM G_EMP_PIC c, (select wwv_flow_lang.system_message('Employee') label from dual) u

      )

start with parent is null

connect by prior ID = parent

order siblings by name

I noticed a red left error for Uncaugh exception. what is this error ? How can i fix it ?

How can i retrieve the blob image from the database into the tree node ?

Besides, i can't pass the sub-dept. id to

pastedImage_14.png

Thanks in advance.

Amatu Allah.

This post has been answered by Pierre Yotti on Oct 21 2018
Jump to Answer
Comments
Post Details
Added on Oct 21 2018
13 comments
1,270 views