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!

Apex function apex_util.get_blob with unexpected behavior

Mikemul305-OracleSep 30 2013 — edited Oct 2 2013

Hi Experts.

I've been building an Apex search application and hit a snag while testing the apex_util.get_blob download url.  It appears the Download url is only valid in the session that it was generated. Meaning this.  The url in Step 2 below now returns an "500 - Internal Server Error".  But when it was first generated (i.e. select Download link in Apex app, the right click and select Copy Link Location) the same url below worked.  Is there a way to fix this?

Here are my steps:

1) Upload a store a document using the Download syntax : DOWNLOAD:GPAP_PROJECT_FILES:FILE_BLOB:ID::FILE_MIMETYPE:FILENAME:UPDATED:FILE_CHARSET:Inline:Download.

2) with either FF or IE, when I select to cfopy the lijnk, e.g.

https://apex.oraclecorp.com/pls/apex/apex_util.get_blob?s=101780738579356&a=2853&c=35900184302057347654&p=19&k1=307565788455977950718535285815317923965&k2=&ck=23EE058993C510D8E30A6B23E12431E8&rt=CR

3) Result:  If I paste this url into another browser window from the "same" session as the file, it works fine.  But if I start a new browser instance/session, and paste the same url a "500 - Internal Server Error" results.  Should this be possible, and if so, can you please share any suggestions?

Thanks a lot!

Mike

This post has been answered by Joni Vandenberghe on Oct 2 2013
Jump to Answer

Comments

105967

If I understand you correctly you need:

SQL> get t
  1  with td as ( select to_date('27.11.07 06:00', 'dd.mm.yyyy hh24:mi') my_date, 1 id from dual union all
  2               select to_date('27.11.07 10:00', 'dd.mm.yyyy hh24:mi'), 2 from dual union all
  3               select to_date('27.11.07 10:00', 'dd.mm.yyyy hh24:mi'), 1 from dual union all
  4               select to_date('27.11.07 10:30', 'dd.mm.yyyy hh24:mi'), 2 from dual union all
  5               select to_date('27.11.07 10:45', 'dd.mm.yyyy hh24:mi'), 1 from dual union all
  6               select to_date('27.11.07 15:00', 'dd.mm.yyyy hh24:mi'), 2 from dual
  7             )
  8  -- end of testdata
  9  select to_char(max(my_date), 'dd.mm.yyyy hh24:mi')
 10  from   td
 11  where  id = 2
 12  and    my_date < ( select max(my_date)
 13                     from   td
 14                     where  id = 1
 15                     group by id
 16                   )
 17* group by id
SQL> /
 
TO_CHAR(MAX(MY_D
----------------
27.11.0007 10:30
 
SQL> 
21205
with x as 
(
select to_date ('27.11.07 06:00', 'dd.mm.rr hh24:mi') dt, 1 type from dual union all
select to_date ('27.11.07 10:00', 'dd.mm.rr hh24:mi') dt, 2 type from dual union all
select to_date ('27.11.07 10:00', 'dd.mm.rr hh24:mi') dt, 1 type from dual union all
select to_date ('27.11.07 10:30', 'dd.mm.rr hh24:mi') dt, 2 type from dual union all
select to_date ('27.11.07 10:45', 'dd.mm.rr hh24:mi') dt, 1 type from dual union all
select to_date ('27.11.07 15:00', 'dd.mm.rr hh24:mi') dt, 2 type from dual
)
select max_value
     , (select max (dt) 
          from x 
         where type = 2
           and dt < max_value
       ) min_value
  from (
select max (dt) max_value
  from x
 where type = 1
 ) 
;
Dip
I need to get both: 10:30 and 10:45.
jeneesh

or:

SQL> select * from td;

MY_DATE                  ID
---------------- ----------
27/11/0007 06:00          1
27/11/0007 10:00          2
27/11/0007 10:00          1
27/11/0007 10:30          2
27/11/0007 10:45          1
27/11/0007 15:00          2

6 rows selected.

SQL> select max(decode(id,1,my_date)) mx1,
  2         max(decode(id,2,my_date)) mx2
  3  from ( select my_date,id,max(decode(id,1,my_date)) over(order by null) mx
  4           from td)
  5  where my_date < mx
  6  or id = 1;

MX1              MX2
---------------- ----------------
27/11/0007 10:45 27/11/0007 10:30                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
Dip
So i need to use two select statements.

I knew that i could do that.
But i thought, there is some shorter way to get what i want (because i have long SQL statement).


Thanks.
Aketi Jyuuzou
with td as (
select to_date('27.11.07 06:00', 'dd.mm.yyyy hh24:mi') my_date, 1 id from dual union
select to_date('27.11.07 10:00', 'dd.mm.yyyy hh24:mi'), 2 from dual union
select to_date('27.11.07 10:00', 'dd.mm.yyyy hh24:mi'), 1 from dual union
select to_date('27.11.07 10:30', 'dd.mm.yyyy hh24:mi'), 2 from dual union
select to_date('27.11.07 10:45', 'dd.mm.yyyy hh24:mi'), 1 from dual union
select to_date('27.11.07 15:00', 'dd.mm.yyyy hh24:mi'), 2 from dual)
select to_char(TargetMy_date,'dd.mm.yyyy hh24:mi') as TargetMy_date,
to_char(ID2,'dd.mm.yyyy hh24:mi') as ID2
from (select my_date,id,
      max(decode(ID,1,my_date)) over () as TargetMy_date,
      Last_Value(case when ID = 2 then my_date end ignore nulls) over(order by my_date) as ID2
        from td)
 where id = 1
   and my_date = TargetMy_date;
1 - 6
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Oct 30 2013
Added on Sep 30 2013
5 comments
939 views