Jdeveloper query form - oracle11g

I'm trying to create an adf query panel with table but I need to limit the search values as also the result values in the table.
For example:
- I have a table with FName, LName, Dateofbirth, address, phone
- I want that the values presented in the search form are FName, Lname
- the values in the result table Fname, Lname, address, phone
I've checked several links including this one enter link description here
But I can't understand how to limit the values.

There are lot of resources available on the internet on how to implement search functionality in ADF. here are few for your reference:
http://www.baigzeeshan.com/2010/04/creating-simple-search-form-in-oracle.html
https://www.youtube.com/watch?v=LAWSfO-7xR8
http://adfnote.blogspot.com/2013/02/create-simple-search-form-in-oracle-adf.html
Normally a search functionality is implemented using a View Critreia, which is created on a View Object. It shows up in Data Control as a Named Criteria under your View Object instance.
While creating the view criteria you can specify the items that you would want to see in the panel as search fields.
When you use (drag and drop) your view criteria as an 'ADF Query Panel with Table' on a page, you get the option to specify the columns you want to see in the results table. You can restrict the number of columns there, or even afterwards by just removing the unwanted columns from your page.

I was able to make it work, by not checking the attribute option 'Queryable'.
This way the it does not appear in the query form,only in the results table.
Thank you all for your help

Related

Get Requsition ID based on PO

In FSCM I am looking to modify the Search view on Add/Update PO page (Main Menu--> Purchasing--> Purchase Orders--> Add/Update POs) to display the Requisition ID associated with the PO in the search results page. The only table I have found that has both PO_ID and REQ_ID is PS_PO_LINE_DISTRIB however unless I use a SELECT DISTINCT clause I will get multiple PO_ID rows when there are more than 1 line on a PO.
Within Purchase Order Inquiry you can see the related Requisition ID's related to a PO by clicking on Document Status link inside the Purchase Order inquiry details page.
I started looking at the PeopleCode within the the Purchase Order Inquiry to see how they are linking the PO to a Requisition and it appears to use work tables with related PeopleCode function libraries, but I wasn't able to figure our how they get linked. I am hoping someone else may know the answer to this. Thank you.
I'm on an old version of PeopleSoft (SCM 8.80, Tools 8.51), so your mileage may vary. I'm assuming you're familiar with App Designer. If not, comment below and I'll add some details about what I'm clicking on.
Find the name of the Add/Update PO component.
Open the PURCHASE_ORDER component in App Designer. Now let's find the name of the search record. Note that there is a different record for the Add Search Record, so if you want to change that too, do all of this for that record as well.
Open the PO_SRCH record, and add the REQ_ID field to it. Make sure you mark the field as a key. You should consider saving your modified PO_SRCH under a new name in case you want to be able to revert to vanilla PeopleSoft. If you do, change the Search Record in the component to your new record name.
We can see that PO_SRCH is a view. So let's modify the view to pull in REQ_ID from PO_LINE_DISTRIB. As you mentioned above, there doesn't appear to be another table with both PO_ID and REQ_ID, so you'll have to do a SELECT DISTINCT.
We should do a LEFT OUTER JOIN instead of a standard join because if you do a standard join and you enter a purchase order with no lines and save it, then you'll never be able to retrieve that purchase order in this window. Since REQ_ID is a key field, we can't have a null, so we have to do the CASE.
One odd thing that I ran into here was building the view now gave me an error about selecting fewer columns in the SQL than I had in my record definition. I solved it by modifying the view for SQL Server. I've never had to do that before and I don't know why I had to do it for this specific record. But anyway, I entered the same SQL under the record's "Microsoft SQL Server" definition.
In the properties of PO_SRCH, we can see that it has a related language record. If you're only using one language, you can probably get away without changing this, but I'll do it for completeness. Open PO_SRCHLN. Now add REQ_ID to it (mark it as a key field like you did above), and save it as PO_SRCHLN2 (I'm saving it under a new name so I don't break anything else that may be using PO_SRCHLN).
Edit the SQL the same was as you did above. Note: I didn't have to also change the Microsoft SQL Server definition like I did above. I have no idea why.
Now build PO_SRCHLN2.
Go back to PO_SRCH and change its related language record to PO_SRCHLN2.
Now build PO_SRCH.
Hopefully you didn't get any errors and your search page has the requisition ID in it now. My system doesn't use requisitions so they're all blank in the example below, but the new field is there.

Ms-Access forms view will not display lookup table "value"

Using Ms-Access 2010 on Windows 7 - forms view will not show the lookup table value, just the number ID. The drop-down arrow is non-functional, but works fine in the table view. Table view shows the value - Georgia from States table, drop-down list works, relationships show valid links from employee state field to the States ID. No answers posted address this peculiar problem. Any ideas? Thanks
On the form, do you have StateID as a text box or a combo box? To get your desired behaviour it needs to be a combo box. The properties should be set as per the attached image. Note that only one column width value is set - this means that the first column is hidden (width = 0cm) so you only see the second column. The first column needs to be there though as this is holding the value (StateID) that is being stored on the Employee table
This is one of the issues with the use of Access Look-up fields stored directly in tables. They are very confusing, and worse still not supported in other database formats, so if you upscale to SQL Server or MySql you'll have to convert them all to separate tables anyway.
Create a separate table with your values in and use it as the source for your combo, and store the the StateID in your main table.
There is more of an explaination here http://access.mvps.org/access/lookupfields.htm

Choosing from multiple query results to display in a single form

I have a form that submits parameters to a query, then opens the resulting record in another form. The problem is, whenever there is more than one record it automatically puts the first one into the from without any kind of option to choose the record I want. I have a macro set up on the search button on the first form that submits the parameters to the query and then displays it in the second form, I've tried to set up another macro in between the two, but I don't know if it's possible to set up the expression creator to check the number of rows resulting from a query. Is it possible to modify the query to create a prompt to choose which record I want? Or should I change something else?
This is the query:(automatically created by access)
SELECT CHILD.CHILD_L_NAME, CHILD.CHILD_F_NAME, CHILD.DOB, CHILD.GENDER, CHILD.DAYS_IN_CARE,
CHILD.HOURS_PER_DAY, CHILD.ENROLLMENT_DATE, CHILD.CHILD_ADDRESS, CHILD.CHILD_CITY,
CHILD.CHILD_ZIP, CHILD.CHILD_STATE, CHILD.CLASSROOM, CHILD.SNACK, CHILD.LAST_UPDATED, CHILD.CIN
FROM CHILD
WHERE (((CHILD.CHILD_L_NAME)=[Forms]![Search]![L_NAME]) AND
((CHILD.CHILD_F_NAME)=[Forms]![Search]![F_NAME])) OR
(((CHILD.CHILD_L_NAME)=[Forms]![Search]![L_NAME]) AND
((CHILD.DOB)=[Forms]![Search]![DOB])) OR
(((CHILD.DOB)=[Forms]![Search]![DOB])) OR
(((CHILD.CHILD_L_NAME)=[Forms]![Search]![L_NAME]));
If I understood well your problem and you use VBA it's quite easy to do.
You can create a reduced query based on the query you're creating with the button. This new query should include all and only the fields that allows you to discriminate beetwen the records to show in the 2nd form.
For instance it could include LastName, FirstName and classroom to select between children with same full name.
You can count the number of records of this 2nd query and if greater than 1 it means that you have more than one children to show.
So you can use this 2nd query to populate a combo-box or a listbox for selecting the record you really want to show.
When number of records is 1 you can simply skip the listbox population using an if statement on recordcount.
Next step is opening the form with the selected (or unique) record.
Bye

Lookup field appears as numerical values instead of text on Access report

I am trying to create a report putting a field called contact which has the name of a person. This name is linked directly to another table where I keep all the contacts.
For some strange reason, when I include this name (which in query view displays as the name of the contact), instead of the name appearing, the unique ID number is shown on my report.
As mentioned in the article cited in the above comment, you can use a Combo Box control on your report to do the lookup for you. To see how this can be done, create a new report based on the table containing the lookup field, then drag and drop that field onto the report. That will create a Combo Box control with properties that look something like this:
Row Source: SELECT [Clients].[ID], [Clients].[LastName] FROM Clients;
Bound Column: 1
Column Count: 2
Column Widths: 0";1"
You could use a similar Combo Box control on your actual report to display the client's name rather than their numeric ID value.
Another alternative would be to change the Control Source of the report's Text Box control to have it do a DLookUp() on the table. If the lookup field is named [client] then changing the Control Source of the Text Box to something like
=DLookUp("LastName","Clients","ID=" & [client])
would also work.
I wanted to add to the great answer by Gord:
When using a "web" database (started in Access 2007 I think), you cannot change a report's fields to ComboBox style, nor can you use DLookUp(). (web databases lack a ton of features)
The workaround for this, if you want to create a Web-Report that uses lookup fields, is to create a Web-Query first based on your Web-Table (all the Web-* stuff has a www planet icon over the logo, if you create a new Web-DB in Access 2007+ you'll see what I mean)
So, instead of Table -> Report, you'll have to do W-Table -> W-Query -> W-Report.
Then, the only thing you need to customize to get the data right is the W-Query. Start by trying to reproduce the look in the query to match what you want users to see in the report. Note that here in the query, lookups will work fine (instead of the unique ID's, you get field names like you want). However, this will not carry over to the report. To do that, you gotta get the actual text field name you want into the query:
You should already have one table in your query; start by adding the table that your first lookup field points to. For example, the table I want to print is called Stock_Boards, and it has a lookup field called PCBID_lookup that points to the table Stock_PCBs.
Since you're using lookup fields, there should already be a relationship line between the two tables when you add the second one. If there isn't, something has gone horribly wrong.
Now, see how that line connects two fields on the two different tables? For example, I've got my PCBID_lookup field on my Stock_Boards table, which connects to the ID field on my Stock_PCBs table. If I created a report from this now, PCBID_lookup would be a number, a number that correlates to the ID of a record on Stock_PCBs.
To fix it, I will add the name field I want to show up on the report. In my example, that happens to be a Part Number, rather than the ID. I add the PartNumber field from my Stock_PCBs table to the query, and remove the PCBID_lookup field of the Stock_Boards table from my query.
Since PartNumber is what I want to show up on my report, it effectively replaces the original field (PCBID_lookup)
Repeat for all lookup fields you want in your report.
I had 1 more: I removed the Status field of the Stock_Boards table (which was an ID/Lookup) and added the 'Status' field from the Status table (which was the actual text name)
When finished, your query should look exactly how you want the data to appear, without any special tricks or asking Access to do something unnatural. Save your query, and create a web-report from it. Done!

use dynamic data in dreamweaver CS6 to populate a hyperlink

Basically I have a news page which stores headlines, stories, and a unique story identifier in a SQL database. I want to be able to create a hyperlink on a webpage to the pictures.
so when someone selects a news story from a drop down menu (which uses the headline) and presses submit I want to pass the storyID, which is a unique identifier, to a spot in a hyperlink. so if it was story 134 then then link would look like:
I know the SQL statement would look like:
SELECT StoryID from db.News
Where Headline = {The headline selected in the dropdown menu}
the dropdown menu is called NewsDrop
this would be an ASPX page written with a VB code base
SO I guess I need help passing the variables along to the search string and the hyperlink.
Not even sure if this is even possible.
There are a number of options available to achieve this, the most common would be to using a query string in the hyperlinks in your drop down menu to send a parameter to a SQL stored procedure which would use it in a variable in your select statement. So basically the hyperlinks you have in the drop down menu would be appended with ?storyID=<uniquestoryid> and on the far end SELECT StoryID from db.News Where StoryID = #StoryID it would be less efficient to use the headline from the link as a query string and variable in the where clause as you have shown but if that is your only option it could be done.
However you should proceed carefully when using query strings here is a link to a good basic article about query strings and another link about best practices.

Resources