Quick QBE - query by example with updateable report ?
Hi,
I'm using the function quick_qbe (thanks a lot to Scott Spendolino) and the report
works fine.
My problem is, what is the easiest way to make this report updateable ?
The report should have an separate column for the edit-icon and link this record to another form page.
It's necessary to create a new column for my table ?
Thanks in advance
Holger
Hi Holger -
You do need to create an extra column containing the ID field of the underlying table.
You can then set the link attributes of that column to specify:
1. The page you want to link to; and
2. The ID value to pass to the new page.
The 'edit' page will then use the value you passed to fetch a row from the table in order to populate the page's items.
If you create a Form and Report on a Table using the wizard, you will see how it's done.
Regards,
John.
Similar Messages
-
Dynamic order by with updateable report
I have a region of type sql query (updateable report)
I want to add a dynamic order by clause based on the value of a page item
ie order by nvl(:PX_ORDER, 1)
I can get the dynamic ordering to work using the 'function returning sql query' reqion type but having a little problem with the sql query type above.
nb. Have also tried ORDER BY decode(:PX_ORDER, 2, 2, 1) but no luck.Thanks Vikas,
I was using column numbers in the decode. Needed to specify the actual column_name including any "" surrounding it.
decode(:PX_ORDER, 2, "COL2_NAME", "COL1_NAME")
works
any ideas on how to dynamically flip the ASC, DESC ordering in a SQL statement?? The 'ASK TOM' note you mentioned above states you should use dynamic query strings if this functionality is required.
Unfortunately updateable report regions can't be created using dynamic query strings. -
Query By Example with view object - how?
Hi all,
I have a named query "select new model.vo.PatientVO(o) from Patient o", how to write this using Query By Example?
Entity Patient has complex structure, so PavientVO (we call it "view object", I don't know the official term for this), which is very simplified Patient, is used for displaying the basic data.
I guess I would still use Patient as example object, but how to tell the query framework to return PatientVOs?
Thanks,
PedjaYou would need to use a ReportQuery with the example object, and add a constructor item to the ReportQuery.
You could also just use a regular ReadAllQuery and wrap the Patient objects with your PatientVO after.
James : http://www.eclipselink.org -
HELP! How to make RRI from BEX query into Workbook with one report???
How to make RRI from query into Workbook???
Hi Alex,
A workbook is a set format of queries, so when you try to jump to another query , you will definitely open another session and hence another excel file. This is the same for web templates also though you have an option of opening the new result in the same window.
You would have to use some macros and open the query on the same page. A RRI is a query jump and not a drill down . A drill down would be getting more of the dimensions into the query.
Regards
CSM Reddy -
Query by example and outer join supported?
Does TopLink support outer joins when using query by example and cursored streams? I am having problems getting this to work. It seems to completely ignore the requested outer join.
I have tried several variations of what is below, but have never seen TopLink generate the outer join. This is against Oracle 9i on TopLink 9.0.4.5.
Customer 1->1 Address (using valueholder indirection)
ReadAllQuery q = new ReadAllQuery();
q.setReferenceClass(Customer.class);
QueryByExamplePolicy policy = new QueryByExamplePolicy();
policy.addSpecialOperation(String.class, "like");
q.setQueryByExamplePolicy(policy);
ExpressionBuilder builder = q.getExpressionBuilder();
Expression addressExp = builder.getAllowingNull("address");
q.addJoinedAttribute(addressExp);
q.addOrdering(addressExp.get("city").ascending());
q.useCursoredStream(end-start, end-start);
q.setExampleObject(exampleCustomer);
CursoredStream stream = (CursoredStream)s.executeQuery(q);
...iterate through the stream...
Note, that the database level relationship is expressed through a target foreign key.
( addressMapping.addTargetForeignKeyFieldName("ADDRESS.CUSTOMER_ID", "CUSTOMER.CUSTOMER_ID");)
Any help would be appreciated.
Thanks,
KevinKevin,
I spoke too soon. All you need to do is use the getAllowingNull in the ordering expression and not use the addJoinedAttribute. With this you can use query-by-example with additional outer-joined ordering.
Here is an example based on the Employee demo:
ReadAllQuery raq = new ReadAllQuery(Employee.class);
ExpressionBuilder eb = raq.getExpressionBuilder();
raq.addOrdering(eb.getAllowingNull("address").get("city").ascending());
Employee exampleEmp = new Employee();
exampleEmp.setLastName("%");
// My default constructor populates the period so I'll null them so
// they are not included in the selection criteria of the example object
exampleEmp.getPeriod().setStartDate(null);
exampleEmp.getPeriod().setEndDate(null);
QueryByExamplePolicy policy = new QueryByExamplePolicy();
policy.addSpecialOperation(String.class, "like");
raq.setQueryByExamplePolicy(policy);
raq.setExampleObject(exampleEmp);
List emps = (List) session.executeQuery(raq);
I hope this helps,
Doug -
SQL Query updateable report with row selector. Update process.
I have a SQL Query updateable report with the row selector(s).
How would I identify the row selector in an update process on the page.
I would like to update certain columns to a value of a select box on the page.
Using the basic:
UPDATE table_name
SET column1=value
WHERE some_column=some_value
I would need to do:
UPDATE table_name
SET column1= :P1_select
WHERE [row selector] = ?
Now sure how to identify the [row selector] and/or validate it is checked.
Thanks,
BobI don't have the apex_application.g_f01(i) referenced in the page source...In the page source you wouldn't find anything by that name
Identify the tabular form's checkbox column in the page(firebug/chrome developer panel makes this easy)
It should be like
<input id="..." value="" type="checkbox" name="fXX" >we are interested in the name attribute , get that number (between 01 and 50)
Replace that number in the code, for instance if it was f05 , the code would use
apex_application.g_f05
--i'th checked record' primary keyWhen you loop through a checkbox array, it only contains the rows which are checked and it is common practice to returns the record's primary key as the value of the checkbox(available as the the i'th array index as apex_application.g_f05(i) , where i is sequence position of the checked row) so that you can identify the record. -
Problem With SQL Query (updateable report)
Hi,
I have a report which I have set as type 'SQL Query (updateable report)'. I have added a 'row selector' to the report but when I run it I get the following error message:
failed to parse SQL query:
ORA-00904: "COL60": invalid identifier
The report works fine if I remove the row selector. Any ideas as to why the error is being produced?
Cheers
SimonI don't have the apex_application.g_f01(i) referenced in the page source...In the page source you wouldn't find anything by that name
Identify the tabular form's checkbox column in the page(firebug/chrome developer panel makes this easy)
It should be like
<input id="..." value="" type="checkbox" name="fXX" >we are interested in the name attribute , get that number (between 01 and 50)
Replace that number in the code, for instance if it was f05 , the code would use
apex_application.g_f05
--i'th checked record' primary keyWhen you loop through a checkbox array, it only contains the rows which are checked and it is common practice to returns the record's primary key as the value of the checkbox(available as the the i'th array index as apex_application.g_f05(i) , where i is sequence position of the checked row) so that you can identify the record. -
Sql Query(Updateable Report) with pagination
Hi,
We're on APEX 3.2 I have a question on Sql Query(Updateable Report) and pagination. I have an updateable report which we have set to show 20 rows. When the userwhi has more than 20 rows enters the data and clicks next the data disappears. I have been reviewing other posts, but haven't come to a clear conclusion on how to prevent this from happening. I have been trying to use javascript to show a save popup when clicking 'Next' Any help is appreciated.
Thanks,
Joeany ideas?
-
SQL Query (updateable report) Region - Conditionally Hide and Set Values
SQL Query (updateable report) Region - Conditionally Hide and Set Values
Outline of requirement :-
Master / Detail page with Detail updated on same page using SQL Query (updateable report).
The detail region has the following source
SELECT item_id,
contract_id,
CASE WHEN hardware_id IS NOT NULL THEN
'HA'
WHEN backup_dev_id IS NOT NULL THEN
'BD'
WHEN hardware_os_id IS NOT NULL THEN
'HS'
END item_type,
hardware_id,
backup_dev_id,
hardware_os_id
FROM "#OWNER#".support_items
WHERE contract_id = :P26_CONTRACT_IDThe table support_items implements arced relationships and has the following columns
CREATE TABLE SUPPORT_ITEMS
ITEM_ID NUMBER NOT NULL,
CONTRACT_ID NUMBER NOT NULL,
HARDWARE_ID NUMBER,
BACKUP_DEV_ID NUMBER,
HARDWARE_OS_ID NUMBER
)A check type constaint on support_items ensures that only one of the fk's is present.
( hardware_id IS NOT NULL
AND backup_dev_id IS NULL
AND hardware_os_id IS NULL
OR ( hardware_id IS NULL
AND backup_dev_id IS NOT NULL
AND hardware_os_id IS NULL
OR ( hardware_id IS NULL
AND backup_dev_id IS NULL
AND hardware_os_id IS NOT NULL
) Hardware_Id is a FK to Hardware_Assets
Backup_dev_id is a FK to Backup_Devices
Hardware_os_id is a FK to Hardware_op_systems
The Tabular Form Element based on item_type column of SQL query is Displayed As Select List (based on LOV) referencing a named list of values which have the following properties
Display Value Return Value
Hardware Asset HA
Backup Device BD
Computer System HSThe Tabular Form Elements for the report attributes for hardware_id, backup_dev_id and hardware_os_id are all Displayed As Select List (Based on LOV).
What I want to do is only display the Select List for the FK depending on the value of the Select List on Item Type, e.g.
Item_Type is 'HA' then display Select List for hardware_id, do not display and set to NULL the Select Lists for backup_dev_id and hardware_os_id.
Item_Type is 'BB' then display Select List for backup_dev_id, do not display and set to NULL the Select Lists for hardware_id and hardware_os_id.
Item_Type is 'HS' then display Select List for hardware_os_id, do not display and set to NULL the Select Lists backup_dev_id and hardware_id.
There are properties on elements to conditionally display it but how do we reference the values of the SQL query Updateable region? they are not given a page item name?
Also on the Tabular For Elements there is an Edit tick against a report item - however when you go to the Column Attributes there is not a property with which you can control the Edit setting.
What's the best way of implementing this requirement in APEX 3.1?
Thanks.>
Welcome to the forum: please read the FAQ and forum sticky threads (if you haven't done so already), and update your profile with a real handle instead of "user13515136".
When you have a problem you'll get a faster, more effective response by including as much relevant information as possible upfront. This should include:
<li>Full APEX version
<li>Full DB/version/edition/host OS
<li>Web server architecture (EPG, OHS or APEX listener/host OS)
<li>Browser(s) and version(s) used
<li>Theme
<li>Template(s)
<li>Region/item type(s) (making particular distinction as to whether a "report" is a standard report, an interactive report, or in fact an "updateable report" (i.e. a tabular form)
With APEX we're also fortunate to have a great resource in apex.oracle.com where we can reproduce and share problems. Reproducing things there is the best way to troubleshoot most issues, especially those relating to layout and visual formatting. If you expect a detailed answer then it's appropriate for you to take on a significant part of the effort by getting as far as possible with an example of the problem on apex.oracle.com before asking for assistance with specific issues, which we can then see at first hand.
I have a multi-row region that displays values and allows entries in a number of fields.Provide exact details of how this has been implemented. (An example on apex.oracle.com is always a good way to do this.)
I should like the fields to be conditional in that they do not permit entry, but still display, if certain conditions apply (e.g. older rows greyed out). Can this be done? Almost anything can be done, often in multiple ways. Which are appropriate may be dependent on a particular implementation, the skills available to implement it, and the effort you're willing to expend on it. Hence it's necessary to provide full details of what you've done so far... -
Update Field On Change For A SQL Query (updateable report)
Hi,
I'd like to request help from anyone with ideas on how to solve this.
We are using APEX 4.2, 10GR2, RedHat5.
I have a report that comes from SQL Query (updateable report).
I'm using the apex_item.text and apex_item.hidden on fields.
I'm using a button to submit and after submit process to add some logic that I need.
There could be 1 - 10 records in the report.
There is only 1 field that is needed to enter a value, but the value of this field determines the value of another field.
I think that I can do this with a submit button and an after submit process where I loop through all the records. I think I have this handled.
This is the question
When the value of that field is changed then the value of another field in the same row changes immediately.
Is this possible?
All the examples I've seen so far are for a single record and that doesn't work for us.
I guess this is a MRU process but I haven't seen an example where a dynamic action is possible on a Multi Row Update.
Could anyone direct me to where I can see an example or help me get directions?
I appreciate all your help an comments and I thank you in advance.Yes why not...what you looking for is a ajax call
See {message:id=10390979}
Please note:-you can also do this as a dynamic action as shown below
Event: Change
Selection type: jQuery Selector
jQuery Selector: input[name="f01"]
True action with Execute JavaScript Code and put all code inside the test funtion, you may need to amend the code to use this.triggeringElemnt in place of this -
Where clause in sql query for updateable report
Why is the following not working as source for an updateable report ?
select customer_name from temp_customers
where customer_type = :my_field;
How can I make a filter for an updateable report that is based on a field on my page ?
Greetings BerndHoward,
The htmldb_item API package allows you to display column values in a report as HTML form fields. You have a choice of different types of form fields. In your example for instance you get a select list by using the function select_list_from_lov. But by simply placing form fields in an HTML page, you don't specify that those fields are actually supposed to update data in a database. You need an after submit process that is actually performing the update.
You can implement this type of process manually using your own PL/SQL code. Or you can have HTML DB do this for you. If for example you were using the tabular form wizard, you would get an updateable report, including the update process and even including checksum functionality to make sure that you don't overwrite another person's changes (lost update detection).
If you use the wizard, the report form items use the build-in display types. This means you don't have to do your own calls to htmldb_item as part of your query. It is generally advisable to use the build-in types as they are easier to work with and are only rendered for the rows actually shown as opposed to be rendered for the entire result set.
If you do choose to use htmldb_item, you'll have to code your own PL/SQL code to perform the updates and you should also include some logic for lost update detection. The HTML DB documentation provides information on how to manually process data from tabular forms.
Hope this clarifies your question about updateable reports,
Regards,
Marc -
Setting fields defined in SQL updateable report with a process
I have SQL statement defined in a SQL updateable report with hidden fields. I want to be able to update these hidden fields with values from other displayed fields on the page. How do I reference these hidden items - I have referencign them as :my_field but get and error telling me thats its underfined.
But, the reason I am doing this is because I want to format the page with 6 columns in one <TD> cell with some extra text and formatting etc - I don't want 1 column per <TD>. Thats why I am using the APEX_ITEM.TEXT so I can format the 1 <TD> the way I want it (with 6 columns it there).
In the short term can you tell me how to reference hidden fields please.
I will create the case in apex.oracle.com in the next few days to make it clearer.
P.S. see my previous post: SQL QUERY updateable report with APEX_ITEM fields to update hidden columns -
Apex conditional field in "SQL Query (updateable report)" region
I have a multi-row region that displays values and allows entries in a number of fields. I should like the fields to be conditional in that they do not permit entry, but still display, if certain conditions apply (e.g. older rows greyed out). Can this be done?
I have searched Google and this forum but all the threads I have found relate to field formatting or display/non-display.
Many thanks in advance Dave Barber
[Apex=4.1.1.00.23; Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production]
Edited by: user13515136 on 03-Sep-2012 00:05>
Welcome to the forum: please read the FAQ and forum sticky threads (if you haven't done so already), and update your profile with a real handle instead of "user13515136".
When you have a problem you'll get a faster, more effective response by including as much relevant information as possible upfront. This should include:
<li>Full APEX version
<li>Full DB/version/edition/host OS
<li>Web server architecture (EPG, OHS or APEX listener/host OS)
<li>Browser(s) and version(s) used
<li>Theme
<li>Template(s)
<li>Region/item type(s) (making particular distinction as to whether a "report" is a standard report, an interactive report, or in fact an "updateable report" (i.e. a tabular form)
With APEX we're also fortunate to have a great resource in apex.oracle.com where we can reproduce and share problems. Reproducing things there is the best way to troubleshoot most issues, especially those relating to layout and visual formatting. If you expect a detailed answer then it's appropriate for you to take on a significant part of the effort by getting as far as possible with an example of the problem on apex.oracle.com before asking for assistance with specific issues, which we can then see at first hand.
I have a multi-row region that displays values and allows entries in a number of fields.Provide exact details of how this has been implemented. (An example on apex.oracle.com is always a good way to do this.)
I should like the fields to be conditional in that they do not permit entry, but still display, if certain conditions apply (e.g. older rows greyed out). Can this be done? Almost anything can be done, often in multiple ways. Which are appropriate may be dependent on a particular implementation, the skills available to implement it, and the effort you're willing to expend on it. Hence it's necessary to provide full details of what you've done so far... -
Which row was clicked in an SQL Query (updateable report)?
I have an application with a report based on an SQL Query (PL/SQL function ...) defined on the Global Page.
On the pages where the report is used, I want to click in a particular column (TCKT_ID) and pass the values in that row to another page for processing.
Things I would like to know:
1) How to determine which row was clicked? The column is TCKT_ID and it is used as a link to another page. The SQLis a non-trivial (for me!) join of tables.
2) How to refer to the values of the other columns in that row? Because I format with "div," the columns are named -- no "f02", "f03", etc.
3) How to pass multiple values (ENAME, JOB, MGR, SAL, COMM) to the target page? You might ask: Why not just re-query for the data using a unique key. Splendid idea, but the unique key is four columns so I still need some way to pass these four values to have that unique key.
I've constructed a "pretty close" example of the situation here:
WS APEX_EXAMPLES_01
demo / demo
Application: Row Info 10782 - Page 0 has the report. Page 1 displays it with a link (in red) to page 2.
I think I can complete most of what I need if someone can just show me how to get, say, the ENAME of the row clicked on page 1, so I can use it to filter the query on page 2 to just this row clicked on page 1.
Using <tt> </tt>, I tried to display the actual row from View -- Source of the real report I'm dealing with but it just comes out like this
M - F
MM_O_BD_DAILY.ctl (ftp D046)CMM_O_BD_DAILY.sh (ftp D046)17:15
10JUN13 17:00:52
10JUN13 17:00:53
17:15
10JUN13 17:00:52
10JUN13 17:00:53
17:00
10JUN13 17:00:59
10JUN13 17:01:00
Y
ARS003_TESTNBDI wonder if I'm not understanding something. This seems like a very simple thing to do without any "tricks"
Take a look, I've modified the LINKING_NUMBER column on the p0 report.
Basically, you just specify the fields you want to populate and their assignments. I added 4 destination fields on p2 to receive the assignments. Then you can do anything you want with them like modifying a report, etc...
The only trick here is that in order to pass more than 3 items in the URL you need to change your link type from Page in this application to URL. Then you can specify lost of items this way.
Thanks
-Jorge -
Query based LOV in an updateable report
Hi,
I have an updateable report which has a select box where the user can select "Item"
I have another select box in the same report that needs to "update" its values according to the selected item. Is this possible?
My first thought was to let the second select box be an empty div tag, and then use javascript to build the select. The problem with that is that if I just print a div tag in my select for the report (select '<div></div> from...') then it will not show untill the line has been saved so that is out of the question.. Any suggestions is welcome :)
Thanks
BjarkeHi Bjarke,
Yes it is possible providing the two are linked in some way. I'll explain with the idea that your first LOV is :P1_ITEM and the second is :P1_DETAILS
*:P1_ITEM query:*
SELECT DISTINCT ITEM FROM TABLE*:P1_DETAILS query:*
SELECT DISTINCT DETAILS FROM TABLE WHERE ITEM = :P1_ITEMYou want an unconditional branch which returns to the current page. Make sure that the "reset pagination" option in this branch is not ticked (i.e. you do not want it to reset as the values will go back to default).
Your report might then be something like:
SELECT * FROM TABLE WHERE ITEM = :P1_ITEM AND DETAILS = :P1_DETAILSHope this helps.
Mike
Maybe you are looking for
-
This question is related to other questions in this discussion thread, but about a different aspect. The program on my QNAP NAS uses Java to bring up the dialog for the selection of files to upload. Each time Java is updated this code has the problem
-
Harman Kardon SoundSticks Wireless bluetooth on Yosemite problem
Hi there, Since upgraded to Yosemite, I have problems with re-connecting my Harman Kardon SoundSticks Wireless (via bluetooth) to MacBook Pro (retina 15" late 2013). Every time when that happen, I need to restart the speakers to make them connect aga
-
How can i get rid of a message asking for a keychain password
how can i get rid of a message asking for a keychain password
-
Error 440 Automation Error: modupsShell.ExecuteCustomScriptEx
We are experiencing the following error when trying to load data files to FDM using the batch processing functionality. If no files are present in the OpenBatch folder, no error occurs. However, the attached occurs once files are present. The process
-
Printout are printed to the right side of the paper
Printout are printed to the right side of the paper all other settings are ok but the text is printed too much to the right side