Oracle Apex: show picture in report from a different table? - oracle

I have the following apex report :
select id,
user_ as participant,
--This is a blob
dbms_lob.getlength(MY_UTILITIES.GetUserPicture(user_)) as Picture,
order_ as order_
from My_Operations
I would like to display the column Picture as an image in the report. It's a blob stored in another table : Table My_Users (the Primary key column name is 'ID')
I configured as follows the Picture Column :
enter image description here
The report generates but the picture doesn't show :
enter image description here
I'm sure using this implementation Apex has no way to know that the field picture corresponds to the row X in the table My_Users.
Does anyone know how to correct that please ?
Cheers,

The way APEX displays images in reports is somewhat weird and wacky it would seem. What you need to do is apparently undocumented but I believe it is as follows:
The column that will be displayed as an image must contain the length of the BLOB column (which you have done correctly). I found this out from this blog post.
The column specified for Primary Key Column 1 specified in the BLOB attributes of that column must also appear in the report with the same name. I figured that out by trial and error.
You have aliased column user_ as participant. APEX requires it to be called ID - but you already have a different column called ID! So I think you should try this:
select id as op_id,
user_ as id,
dbms_lob.getlength(MY_UTILITIES.GetUserPicture(user_)) as Picture,
order_ as order_
from My_Operations

Related

How to resolve error ORA-20987: APEX - ORA-02015?

I have a page in apex with multiple interactive grid. In one of the interactive grid i am trying to update the data of a column of a table in the database. The column named defect kind is a dropdown in the grid and on click of save should be able to updated the column value in database with the selected value in the grid.
While clicking on save apex is showing an error as follows:
Ajax call returned server error ORA-20987: APEX - ORA-02015: cannot select FOR UPDATE from remote table for.
I have used the type interactive grid - automatic row processing(DML) for saving the grid. Only defect kind is selected by the user rest all column value are coming directly from the table.
Interactive grid image:
NOTE:For this workspace the tables are accessed through a database link. I am using APEX 5.1.
This error is raised specifically because you are working over a database link.
Error code: ORA-02015
Description: cannot select FOR UPDATE from remote table
Cause: An attempt was made to select FOR UPDATE on a remote table (directly, or via a view) that had abstract data type columns, and the
view or select list contained abstract data type columns or non-column
items.
Action: To attempt a select FOR UPDATE, use a view or select list that consists only of base columns from the remote table, none of
which may be abstract data type columns.
I can't tell from what you've posted if the issue is with the query you're using to populate the IG or with some underlying view or the table itself. Depending your ability to locate and remove the "abstract data type columns or non-column items" (if that's even possible with an IG) you may not be able to make this work with automatic row processing over a database link at all. It may require a custom PL/SQL API instead.
Have you tried to set the attribute Lock Row (group Settings) to No in your Interactive Grid - automatic row processing(DML) process?

oracle forms not showing all fields

I have 2 tables: product which has primary key product_id and Review which has product_id which references the product_id of product table;
I created form master-detail for them but when executing I get at the bottom of page:
FRM-40505: ORACLE error: unable to perform query
and when pressing ctrl+shift+e I get:
SELECT ROWID, REVIEW_ID, LIKE, DISLIKE, FIRST_NAME, LAST_NAME, PRODUCT_ID
FROM U1.REVIEW WHERE (PRODUCT_ID=:1)
ORA-00936: missing expression
how to solve this? what is wrong? thank you in advance
Seems you have a field named like in your block with base table named review has Database Item set to Yes in the property palette, and for this reason Oracle treats that field as if a column of the table, but there's no such column, and not possible to have a column named like within a db table, since it's a reserved keyword.

how to create the download blob link in oracle apex 5.2

I have created an interactive report in oracle apex 5.1 in which I have 4 columns. One of those columns is blob column named as doc_pic. I made it download blob type column and fill all the requirements, IE: MIME type, file name, last updated, primary key 1 according to the view from where it belong.
In that view I have multiple tables and most of them contain composite primary key which is based on number and varchar2 columns. The problem is when I run the page it gives me no data found error but when I hide that column report is running fine.
I tried created it by making unique id through rownum but still it is giving the same error.
I also tried to make a unique column by concatenating it with another column which is varchar2 but, then it gave me error
ORA-06502: PL/SQL: numeric or value error: character to number conversion error
Somebody please tell me where I am going wrong in creating a download blob link. Thanks in advance.
You shouldn't use the BLOB column directly in IR's query. Instead of it, use this:
select column_list_here,
dbms_lob.getlength(doc_pic) doc_pic --> this
from your_table
...
The rest should be easy.

oracle ADF related query

there is one search page in ORACLE ADF with header & line section ... in header section i search for the customer id (i can also search with any column name like customer name , organization id etc) then in line section it will show me all the customer related to that customer id now in line section i make that customer id a hyperlink and as user click on that link (customer id) it will show a popup contain all the details related to that customer (around 700 column)..column names are like column 1,column 2,column3 ....column 700 like that and the name of this column 1 ,column 2 up-to column 700 is stored in some other table so how can i change that column1 ,column2 ...column 700 with their actual name (which is stored in some different table ).
One thing you might trey is to Query the other table using this:How can I get column names from a table in Oracle? to get the column names and then use the VO api to change the hint for the column: ADF how to convert column name to attribute anme
You use two VOs in the page.
VO1 fetches column names, the other VO2 fetches column values.
Create a Form based on VO2, then go to each column and update the label attribute for that column to point to the right value from VO1.

defining a unique key column in apex

I am trying to get the distinct records from a table, as many duplicate rows are coming from the following query
select * from sales_details_view;
When I query the following query in pl/sql developer, I am getting correct results
select distinct * from sales_details_view;
But when I use the same query in an interactive report in Oracle APEX 4.1, it is giving me the following error
The report query needs a unique key to identify each row. The supplied
key cannot be used for this query. Please edit the report attributes
to define a unique key column. ORA-01446: cannot select ROWID from, or
sample, a view with DISTINCT, GROUP BY, etc.
You need to set Link Column (in Report Attributes) to something other than "Link to Single Row View". You can set it to either "Exclude Link Column" or "Link to Custom Target".

Resources