oracle forms not showing all fields - oracle

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.

Related

BIRT List of Values parameter query

I have a large detail table for which one column is a foreign key to a list of values/lookup table.
The BIRT report is on the detail table.
I want to select rows from the detail table given a user-selected value from the foreign key table.
Detail:
select id, o.owner_name, ....
from detail as d
inner join
owner as o
on (d.owner_id = o.owner_id)
where d.owner_id = ?
Foreign Key/LOV/Lookup table
select owner_id, owner_name
from owner;
So, on report execution, the user is presented with a pulldown menu populated with the owner_id/owner_name values from the owner table. The user selects the required owner_name whose owner_id value is then provided to the detail where clause parameter.
Is this possible?
I didn't see it after quite a bit of time looking, but in the end RTFM got me there.
Create two data sets, one for the detail the other for the lookup;
In report's parameters, see "Selection list values"/Dynamic

How to select specific columns in a polymorphic relationship where table columns are different?

How can I only select specific columns in a polymorphic relationship because the table columns are different?
$query->with(['Postable' =>function($query){
$query->select('business_title','name ','last_name');
}
The business_title column exists in the agency table. Name and last_name exist in the user table. If I select one table other table gets an error of column not found.
Either develop a naming convention that fulfills your needs (ex: columns like 'name', 'title' can be found on many tables), or do not use select in your query and get all coulmns: $query->with(['Postable']); and you would need appropriate ways to read your query results. Or simply use multiple queries to read from different tables which seems to be the rational option.

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.

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

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

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