I'm a new user of oracle apex 5. I'm using interactive grid but i have a problem, by default apex 5 add the new row after the selected row, but i want add the new row after the latest row.
How can i do it?
I don't know, but - why do you care about position where row is inserted? It is - after all - stored into a RDBMS table, and in those tables there's no "order" of rows; think of them like apples in a basket. Which one is first, which one is last? You can't tell until you sort them, and that's done with the ORDER BY clause.
Which, in your case, means: the next fetch (or refresh) will sort them properly anyway.
Related
In an interactive grid, what is the best way to validate for duplicate values in a column. I have a requirement to check if a date column exists for more than one row. Is there an api or a declarative way to not allow more than one row with the same date.
APEX version : 20.1
Thanks,
Found this neat example at https://lschilde.blogspot.com/2020/04/interactive-grid-validation-duplicated.html very useful
Populating an Apex 5.1 select list of employees with about 25,000 names is proving to be a performance problem when loading the page. Is there a method of limiting the initial list to a set number (such as 200), and dynamically populating with chunks of additional names as the user scrolls through the list? Are there other options I should consider that would not slow down the page load?
I am currently using a dynamic LOV, and have tried adjusting this LOV to include Oracle row limiting code; however, there is no way of fetching past the initial set of rows. The source of the data is a view on a materialized view.
I appreciate any ideas
I'd use a pop-up LOV with a search function, not showing any records until the user enters a search value (more than 3 characters). I know it's tedious to use a pop-up LOV but it seems the only way to prevent waiting for a slow list to display.
I'd try with cascading lists of values. I don't know what those 25.000 names represent, but - suppose it is a large company. Then you'd
1st LoV: continent
2nd Lov: country
which refers to the previous LoV as where country.continent = :P1_CONTINENT
3rd LoV: city
which refers the previous LoV as where city.coutry = :P1_COUNTRY
4rd Lov is actually your current query:
which refers to the previous Lov as where person.city = :P1_CITY
Now your list of values wouldn't contain 25.000 rows, but - hopefully - a lot less.
how can i do "soft delete" - and add a hidden column deleted. And instead of actually deleting records, mark them as deleted. This way you can see where deleted = 1 to see deleted rows. Otherwise, use where deleted = 0
Instead of deleting, you'd update some column in that row and set (for example) cb_deleted = 1. To do that, you'd have to write your own processing procedure (because Apex would really delete that row otherwise).
For viewing purposes, add an item (a radio button would be just fine) to show deleted (that value would be 1) or "active" (value = 0) rows.
Report's query would then look like
select ...
from that_table
where cb_deleted = :P1_RB_DELETED
You could use instead-of-triggers and a view. You would let Apex do it's operations (insert, update, delete) on the view instead of the table. The instead-of-triggers would transport the changes then to the real table in what ever way you like it to. I use this mechanism with apex to realize a history-mechanism. Just search the web for an example on instead-of-triggers ...
There are two Tables having their own dataset on my report :
I want to place the second Table at the right of the first one. How to do that ?
Just place the two tables in a grid with two columns.
You could even use a third table to do that, but I would use grids if it is only for positioning.
I'm using ASP.NET MVC3 and Entity Framework with Database first aproach.
I have a table with id(key), number and description columns. I need to generate a number after item insertion. I created instead of trigger where I generate number that I need (it depends on last number that allready exists in database).
The problem is: When users insert items at same time the number in both cases is the same. So for both inserted items trigger fires and inside the trigger select returns same last number of item that allready exsist.
What is the best practice to solve this kind of issue?
Thanks.
I believe this will help you.
http://www.sqlteam.com/article/custom-auto-generated-sequences-with-sql-server
Also, if you're using SQL Server 2012, there is a new feature called SQL Sequence. It's something that Oracle databases have for a long time.
If you need those numbers without any gap, I'd suggest you to lock the table (prevent write), query it, update the row with max(number) and unlock it.