DataPower 2 Searching
Question:
I searched for some records within my database, and now I can't get
my other records back.
The 'Subset' button hasn't appeared on the toolbox, so I can't seem
to turn it off.
Answer:
What's happened here is that you've performed a search while in Edit
Layout mode.
If you do this, DataPower creates a permanent query called "Join
for layoutname", and attaches the layout to that query.
This means that the layout shows the records that are returned by the
query, rather than those from the underlying table. The other records are
still there, but you won't be able to see them using that layout.
This behaviour is in contrast to what happens if you perform a search
in browse mode, where DataPower will normally just create a temporary query
on top of the table or query that the layout is attached to, and you can
toggle between this query and the base query by clicking on the "Subset"
button.
If you've performed the search while in Edit Layout mode, however, the
subset button will not come on unless you perform another search while
in browse mode, and this search will only return records from within the
original search, as the base query will already have your original search
applied to it.
Question:
Why is this behaviour useful?
Answer:
Well, it allows you to create layouts that only show certain records:
for example, you could have a layout showing overdue library books.
In a similar way, it also allows you to have different sort orders in
different layouts, since the sort order is just another aspect of a query.
Question:
OK, I see what you're saying. Now how do I get my records back?
Answer:
If you want to revert to showing all the records from the underlying
table, you need to edit the layout, and then either choose Query/Table=>Attach
to=>TableName, or, if you don't want to keep your query, choose
Query/Table=>Search, then click on Delete in the toolbar to delete the
query, and click Cancel in the toolbox to return to edit layout mode. At
this point DataPower will realise that the underlying query has been deleted,
and will automatically re-attach the layout to the main table within that
query.
|