EPMA deployment hangs - last recorded entry sysout references deleted member
Hi, we are on 11.1.1.3 and using EPMA to a planning application.We have removed a level 0 entity member. Now, we can get EPMA to deploy on essbase/planning. We have disabled create and update outline boxes in an attempt to simply update the planning and it still does not work.
The last entry recorded in the file sysout EPMA member references that deleted us. The deployment takes normally 2 to 3 minutes.
There are no entries in the planning pending_xacts table.
How can we determine what is the problem and how to solve?
Thank you
Jeff
pending_xacts is no longer used, I think it has been used last 9.2
Is a process of active workflow, this can generally cause a problem if you try to remove a member from the entity that is part of a workflow process, the system may hang.
If it's a question of workflow, then stop the workflow and remove the Member.
See you soon
John
http://John-Goodwin.blogspot.com/
Tags: Business Intelligence
Similar Questions
-
Cursor does not properly... Gives entry each record last records.
Hi all.
a simple for someone, I'm sure...
I've just added the cursor:
-- ***************************************************
-The cursor for Oracle_Loc_Code de SU CHRIS vs ORACLE table locations in a variable...
-- ***************************************************
CURSOR csr_ora_loc_code IS
SELECT sil. ORACLE_LOC_CODE
OF std, sil SU_IEXP_LOCATIONS SU_TEMPLOYEE_DETAILS
WHERE STDS. STD_LOCATION_ID = sil. CHRIS_LOC_code;
.. the script I paste below in order to complete each record with what in LIS. Field ORACLE_LOC_CODE.
But, although it works fine when you have 1 card to run at, where several records need to be loaded together, the script, well between records in ORACLE thin, fills all records with the same store code - whatevers in the last record (instead of dealing with each of them individually). How can I fix?
Thanks for looking...
The code...
/* Formatted on 2009/04/29 11:52 (Formatter Plus v4.8.7) */ SET serveroutput ON SIZE 1000000 FORMAT WRAPPED SET verify OFF SET feedback OFF DECLARE -- ********* -- Debugging/error handling -- ********* -- ********* -- Work variables -- ********* ora_loc_code number := 0; p_emp_number VARCHAR2 (14); v_rec_cnt NUMBER := 0; insert_flag VARCHAR2 (8); err_num NUMBER; err_msg VARCHAR2 (150); err_line VARCHAR2 (350); err_seq NUMBER := 0; l_validate BOOLEAN DEFAULT FALSE; l_std_business_group_id NUMBER := '0'; l_default_code_comb_id NUMBER := '217269'; l_organization_id NUMBER := '0'; l_set_of_books_id NUMBER := '1'; l_job_id NUMBER := '10'; l_obj NUMBER; l_datetrack_update_mode VARCHAR2 (30) := 'CORRECTION'; l_assignment_sequence NUMBER; l_name_combination_warning BOOLEAN := FALSE; l_assign_payroll_warning BOOLEAN := FALSE; l_org_now_no_manager_warning BOOLEAN; l_other_manager_warning BOOLEAN; l_spp_delete_warning BOOLEAN; l_entries_changed_warning VARCHAR2 (30); l_tax_district_changed_warning BOOLEAN; l_person_id NUMBER; l_assignment_id NUMBER; l_special_ceiling_step_id NUMBER; l_per_effective_end_date DATE:= TO_DATE ('11-Jul-2049', 'DD-MON-YYYY'); l_people_group_id NUMBER; l_group_name VARCHAR2 (30); l_assignment_number VARCHAR2 (35); l_effective_end_date DATE := TO_DATE ('11-Jul-2049', 'DD-MON-YYYY'); l_date DATE := SYSDATE; ip_p_address_id per_addresses.address_id%TYPE; ip_p_object_version_number NUMBER; ip_p_party_id per_addresses.party_id%TYPE; l_per_object_version_number NUMBER; l_asg_object_version_number NUMBER; l_full_name VARCHAR2 (240); l_per_comment_id NUMBER; l_per_effective_start_date DATE; l_concatenated_segments VARCHAR2 (240); l_soft_coding_keyflex_id NUMBER; l_comment_id NUMBER; l_no_managers_warning BOOLEAN; -- *********************************** -- Get employee details info from work table -- *********************************** CURSOR get_employee_details IS SELECT std_hire_date, std_last_name, std_sex, std_date_of_birth, std_email_address, LPAD (std_employee_number, 8, '0') std_employee_number, std_first_name, std_marital_status, std_middle_names, std_nationality, std_title, std_national_identifier, std_address_line1, std_address_line2, std_address_line3, std_address_line4, std_post_code, std_telephone_1, std_country, std_region, std_location_id, std_organization_id, std_supervisor_id, std_person_id, std_position_id FROM SU_TEMPLOYEE_DETAILS; -- ***************************************** -- checks employee details info from PER_ALL_PEOPLE_F table -- ***************************************** CURSOR c_check_employee (p_emp_number VARCHAR2) IS SELECT per.person_id, per.business_group_id, per.last_name, per.start_date, per.date_of_birth, per.email_address, per.employee_number, per.first_name, per.marital_status, per.middle_names, per.nationality, per.national_identifier, per.sex, per.title, padd.address_id, padd.primary_flag, padd.address_line1, padd.address_line2, padd.address_line3, padd.town_or_city, padd.postal_code, padd.telephone_number_1, paas.assignment_number, paas.object_version_number -- padd.telephone_number_2, padd.telephone_number_3, paas.job_id, paas.location_id, -- paas.organization_id, paas.assignment_type, paas.supervisor_id, -- paas.default_code_comb_id, paas.set_of_books_id, paas.period_of_service_id, FROM per_all_people_f per, per_all_assignments_f paas, per_addresses padd WHERE per.employee_number = p_emp_number AND per.person_id = padd.person_id AND paas.person_id(+) = per.person_id; emp_rec c_check_employee%ROWTYPE; -- *************************************************** -- Cursor retrieves latest Object Version Number from per_assignments_f table.. -- *************************************************** CURSOR csr_ovn (cp_person_id IN per_all_people_f.person_id%TYPE) IS SELECT MAX (paas.object_version_number) FROM per_assignments_f paas, per_all_people_f per WHERE paas.person_id = per.person_id AND per.employee_number = paas.assignment_number AND per.person_id = cp_person_id; -- *************************************************** -- Cursor to get Oracle_Loc_Code from SU CHRIS vs ORACLE Locations Table into a variable.. -- *************************************************** CURSOR csr_ora_loc_code IS SELECT sil.ORACLE_LOC_CODE -- INTO ora_loc_code FROM SU_TEMPLOYEE_DETAILS std, SU_IEXP_LOCATIONS sil WHERE std.STD_LOCATION_ID = sil.CHRIS_LOC_code; BEGIN -- *********************************** -- Process each record in the work table -- *********************************** FOR v_emp IN get_employee_details LOOP -- ************************************ -- determine whether customer already exists -- ************************************ OPEN c_check_employee (v_emp.std_employee_number); FETCH c_check_employee INTO emp_rec; IF c_check_employee%NOTFOUND THEN insert_flag := 'I'; DBMS_OUTPUT.PUT_LINE ('Employee No: ' || v_emp.std_employee_number); ELSE DBMS_OUTPUT.PUT (CHR (10)); insert_flag := 'X'; RAISE_APPLICATION_ERROR (-20001, 'Employee No: ' || v_emp.std_employee_number || ' already exists - please UPDATE manually..' ); END IF; CLOSE c_check_employee; -- ************************************ -- Obtain the most recent Object Version Number.. -- ************************************ OPEN csr_ovn (v_emp.std_person_id); FETCH csr_ovn INTO l_obj; -- IF csr_ovn%NOTFOUND THEN RAISE NO_DATA_FOUND; END IF; CLOSE csr_ovn; -- ************************************ -- Open Oracle Location Code cursor -- ************************************ OPEN csr_ora_loc_code; -- (v_emp.std_person_id); FETCH csr_ora_loc_code INTO ora_loc_code; CLOSE csr_ora_loc_code; -- *********************************** -- Create new PER_ALL_PEOPLE_F and PER_ADDRESSES record from -- info in table record -- *********************************** IF insert_flag = 'I' THEN -- BEGIN -- Importing Employee Procedure -- Hr_Employee_Api.create_gb_employee (p_validate => l_validate, p_hire_date => v_emp.std_hire_date, p_business_group_id => l_std_business_group_id, p_date_of_birth => v_emp.std_date_of_birth, p_email_address => v_emp.std_email_address, p_first_name => v_emp.std_first_name, p_middle_names => v_emp.std_middle_names, p_last_name => v_emp.std_last_name, p_sex => v_emp.std_sex, p_ni_number => v_emp.std_national_identifier, p_employee_number => v_emp.std_employee_number, p_person_id => l_person_id, p_title => v_emp.std_title, p_assignment_id => l_assignment_id, p_per_object_version_number => l_per_object_version_number, p_asg_object_version_number => l_asg_object_version_number, p_per_effective_start_date => l_per_effective_start_date, p_per_effective_end_date => l_per_effective_end_date, p_full_name => l_full_name, p_per_comment_id => l_per_comment_id, p_assignment_sequence => l_assignment_sequence, p_assignment_number => l_assignment_number, p_name_combination_warning => l_name_combination_warning, p_assign_payroll_warning => l_assign_payroll_warning ); Hr_Person_Address_Api.create_person_address (p_validate => l_validate, p_effective_date => v_emp.std_hire_date, p_pradd_ovlapval_override => NULL, p_validate_county => NULL, p_person_id => l_person_id, p_primary_flag => 'Y', p_style => 'GB_GLB', p_date_from => SYSDATE, p_date_to => NULL, p_address_type => NULL, p_comments => NULL, p_address_line1 => v_emp.std_address_line1, p_address_line2 => v_emp.std_address_line2, p_address_line3 => v_emp.std_address_line3, p_town_or_city => v_emp.std_address_line4, p_region_1 => NULL, p_region_2 => NULL, p_region_3 => NULL, p_postal_code => v_emp.std_post_code, p_country => v_emp.std_nationality, p_telephone_number_1 => NULL, p_telephone_number_2 => NULL, p_telephone_number_3 => NULL, p_party_id => ip_p_party_id, p_address_id => ip_p_address_id, p_object_version_number => l_obj ); Hr_Assignment_Api.update_emp_asg (p_validate => l_validate, p_effective_date => SYSDATE, -- l_date, p_datetrack_update_mode => l_datetrack_update_mode, p_assignment_id => l_assignment_id, p_object_version_number => l_obj, p_supervisor_id => v_emp.std_supervisor_id, p_default_code_comb_id => l_default_code_comb_id, p_set_of_books_id => l_set_of_books_id, p_concatenated_segments => l_concatenated_segments, --IN/OUT p_soft_coding_keyflex_id => l_soft_coding_keyflex_id, --IN/OUT p_comment_id => l_comment_id, --IN/OUT p_effective_start_date => l_date, --IN/OUT p_effective_end_date => l_effective_end_date, --IN/OUT p_no_managers_warning => l_no_managers_warning, --IN/OUT p_other_manager_warning => l_other_manager_warning --IN/OUT ); Hr_Assignment_Api.update_emp_asg_criteria (p_validate => l_validate, p_effective_date => SYSDATE, -- l_date, p_datetrack_update_mode => l_datetrack_update_mode, p_assignment_id => l_assignment_id, p_object_version_number => l_obj, p_organization_id => l_organization_id, p_location_id => ora_loc_code, p_job_id => l_job_id, p_position_id => v_emp.std_position_id, p_special_ceiling_step_id => l_special_ceiling_step_id, p_effective_start_date => l_date, --per_effective_start_date, p_effective_end_date => l_effective_end_date, --IN/OUT p_people_group_id => l_people_group_id, --IN/OUT p_group_name => l_group_name, --IN/OUT p_org_now_no_manager_warning => l_org_now_no_manager_warning, --IN/OUT p_other_manager_warning => l_other_manager_warning, --IN/OUT p_spp_delete_warning => l_spp_delete_warning, --IN/OUT p_entries_changed_warning => l_entries_changed_warning, --IN/OUT p_tax_district_changed_warning => l_tax_district_changed_warning --IN/OUT ); v_rec_cnt := v_rec_cnt + 1; DBMS_OUTPUT.PUT (CHR (10)); DBMS_OUTPUT.PUT_LINE ( 'There were ' || v_rec_cnt || ' records read in..' ); DBMS_OUTPUT.PUT (CHR (10)); -- ****************************** -- End of customer related details -- ****************************** END IF; END LOOP; COMMIT; EXCEPTION WHEN NO_DATA_FOUND THEN ROLLBACK; WHEN OTHERS THEN ROLLBACK; err_num := TO_CHAR (SQLCODE); err_msg := SUBSTR (SQLERRM, 1, 150); err_line := 'ORACLE error occurred processing record.. ' || err_msg; DBMS_OUTPUT.PUT_LINE (err_line); INSERT INTO SU_SL_ERRORS VALUES (err_num, err_msg, SYSTIMESTAMP); END; / EXIT;
CURSOR csr_ora_loc_code IS
SELECT sil. ORACLE_LOC_CODE
-BY ora_loc_code
OF std, sil SU_IEXP_LOCATIONS SU_TEMPLOYEE_DETAILS
WHERE STDS. STD_LOCATION_ID = sil. CHRIS_LOC_code; OPEN csr_ora_loc_code. -(v_emp.std_person_id);
EXTRACTION csr_ora_loc_code
IN ora_loc_code;
CLOSE Csr_ora_loc_code;Of course Yes.
He chooses a sil. ORACLE_LOC_CODE, you are to pick up a. Which may be one of the sil. ORACLE_LOC_CODE, you don't like Oracle to choose an individual.
If you want to get a few specific sil. ORACLE_LOC_CODE, you need to put a filter on it.CURSOR csr_ora_loc_code(p_your_parameter NUMBER) IS -- whatever datatype you wan to pass SELECT sil.ORACLE_LOC_CODE -- INTO ora_loc_code FROM SU_TEMPLOYEE_DETAILS std, SU_IEXP_LOCATIONS sil WHERE std.STD_LOCATION_ID = sil.CHRIS_LOC_code AND your_column = p_your_parameter;
OPEN csr_ora_loc_code(v_emp.std_person_id); -- (v_emp.std_person_id); -- I'm not sure why did you comment this out. FETCH csr_ora_loc_code INTO ora_loc_code; CLOSE csr_ora_loc_code;
By
VAMSi -
Properties of the file - Date of the last recorded
Hello.
I'm having trouble understanding the properties of the file, as "Last record Date" (DLS) and "Date modified" (MD).
I asked that the last of them, MD, has been changed whenever the content has changed. But Distribution lists must be updated also.
However, I have a file which has the DLS on 2007 and MD 2014 and the 'last impression"also is 2014.
How is that possible?
What has changed the date the content of the file was really the last?
I would be grateful if someone could help me understand this.
Thank you,
Nuno Roque
Modification date is when the file got changed on that hard drive. Even if you have never opened the file, just drag-and - drop it to drive flash (for an example) would last updated date change, because the file on this disk changed really.
Properties such as "Date of last recorded" and "date printed" are stored in the file itself, such as metadata and are updated no not by disk or operating system, but by the design (such as Word) program.
-
Select the last record of each month
Hello
to select the last docnumber and qty of every month
Structure
Name Null? Type
------------------------------- -------- ----
PRODUCTCODE NUMBER
NUMBER NUMBER
DATE OF PLANFORMONTH
NUMBER OF CLEXPECTEDQTY
NUMBER OF CLCONFIRMQTY
NUMBER OF CLFGBUFFERQTY
NUMBER OF CLTOTPRINTBUFFER
in this select query if I take the sum he required all records where, as I want the last record of each month
SELECT productcode docnumber MAX (Number), planformonth, SUM (clexpectedqty) clexpectedqty (planformonth) MAX.
SUM (clconfirmqty) clconfirmqty, SUM (clfgbufferqty) clfgbufferqty, cltotprintbuffer OF FGSALESPLAN of the SUM (cltotprintbuffer)
GROUP BY productcode, (planformonth)
Sandy
Hello
Thanks its working now the code is written as below:
SELECT * FROM
(SELECT
e.*,
ROW_NUMBER() OVER (partition by PRODUCTCODE by DOCNUMBER DESC order) r
Of
E FGSALESPLAN)
WHERE r = 1 AND
entryvalid = 'Y '.
order by Number
Sandy
-
Tasks &; events see history limited to last 100 entries?
It seems that display it the history of tasks and events is limited to the display of only the last 100 entries. I was wondering if there is a way to increase this limit to display because I know that history is there if I export logs. TIA
Go to Edition > customer settings, select the tab lists and change the Page size setting.
Dave
VMware communities user moderator
Now available - vSphere Quick Start Guide
You have a system or a PCI with VMDirectPath? Submit your specifications to Officieux VMDirectPath HCL.
-
Add a string to the last record
Hello
I was just trying to format an o/p to a table, and looking at the result, I thought it would be nice to add a piece of a chain to the last record. For example
with dat as ( select 'First Record' as COL from DUAL union all select 'Second Record' from DUAL union all select 'Third Record' from DUAL union all select 'Nth Record' from DUAL ) select * from dat o/p Desired o/p COL COL ------------- ------------- first RECORD first RECORD second RECORD second RECORD THIRD RECORD THIRD RECORD NTH RECORD This is the last record NTH RECORD
with dat as ( select 'First Record' as COL from DUAL union all select 'Second Record' from DUAL union all select 'Third Record' from DUAL union all select 'Nth Record' from DUAL ), ord as ( select count(*) rn from dat ) select decode(rownum, rn, 'This is Last Record ' || col, col) from ord, dat;
-
Ask the deptno 20 last record at the end show
Oracle 9i Database
I want to create a query that shows records, Deptno 20 last record at the end.
application of shot show all records that are in the emp table.
I want the resultSQL> select empno,ename,job,deptno, row_number() over (order by deptno) rno from emp; EMPNO ENAME JOB DEPTNO RNO ---------- ---------- --------- ---------- ---------- 7782 CLARK MANAGER 10 1 7839 KING PRESIDENT 10 2 7934 MILLER CLERK 10 3 7369 SMITH CLERK 20 4 7876 ADAMS CLERK 20 5 7902 FORD ANALYST 20 6 7788 SCOTT ANALYST 20 7 7566 JONES MANAGER 20 8 7499 ALLEN SALESMAN 30 9 7698 BLAKE MANAGER 30 10 7654 MARTIN SALESMAN 30 11 EMPNO ENAME JOB DEPTNO RNO ---------- ---------- --------- ---------- ---------- 7900 JAMES CLERK 30 12 7844 TURNER SALESMAN 30 13 7521 WARD SALESMAN 30 14 14 rows selected. SQL>
ConcerningEMPNO ENAME JOB DEPTNO RNO ---------- ---------- --------- ---------- ---------- 7566 JONES MANAGER 20 8 7499 ALLEN SALESMAN 30 9 7698 BLAKE MANAGER 30 10 7654 MARTIN SALESMAN 30 11 7900 JAMES CLERK 30 12 7844 TURNER SALESMAN 30 13 7521 WARD SALESMAN 30 14
with t as ( select 7782 e1,'CKING ' e2 , ' PRESIDENT ' e3 , 10 e4 from dual union all select 7934, 'MILLER' , 'CLERK ' , 10 from dual union all select 7369, 'SMITH ' , 'CLERK ' , 20 from dual union all select 7876, 'ADAMS' , 'CLERK ' , 20 from dual union all select 7902, 'FORD ' , 'ANALYST ' , 20 from dual union all select 7788, 'SCOTT' , 'ANALYST ' , 20 from dual union all select 7788 ,' SCOTT ' ,'ANALYST ' , 20 from dual union all select 7566, 'JONES ', 'MANAGER ' , 20 from dual union all select 7499, 'ALLEN ' , 'SALESMAN' , 30 from dual union all select 7698, 'BLAKE ' , 'MANAGER ' , 30 from dual union all select 7654, 'MARTIN' , 'SALESMAN ' , 30 from dual union all select 7900, 'JAMES ' , 'CLERK ' , 30 from dual union all select 7844, 'TURNER' , 'SALESMAN ' , 30 from dual union all select 7521 ,'WARD ' , 'SALESMAN ' , 30 from dual ) SELECT o.* FROM (SELECT p.*, MAX (CASE WHEN p.e4 = 20 THEN p.rno END) OVER (ORDER BY p.e4) AS mx FROM (SELECT a.*, ROW_NUMBER () OVER (ORDER BY e4) rno FROM t a) p) o WHERE o.rno >= o.mx
-
How to find the last record of the extracted records
Dear members,
I have an OFA Page in which I view record master detail. For each master record can one or more detail records.
In the page I got the button NEXT. If the user clicks the next button, I'm populating the next record of the master and its corresponding detail records.
To achieve this, I wrote the code below in AM:_
Public Sub findNextRec()
*{*
String headerID = null;
Rank rank is getMaster_VO1 () .next ();.
if(Row!=null)
*{*
headerID = row.getAttribute ("HeaderId") m:System.NET.SocketAddress.ToString ();
getDetail_VO1 (.setMaxFetchSize(-1));
getDetail_VO1 () .setWhereClause (null);
getDetail_VO1 () .addWhereClause ("header_id in (: 1)" ");
getDetail_VO1 () .setWhereClauseParams (null);
getDetail_VO1 (.setWhereClauseParam(0,headerID));
getDetail_VO1 () .executeQuery ();
*}*
*}*
My CO code in processFormRequest method is as follows:_
If (PageContext.GetParameter ("Next")! = null)
*{*
am.invokeMethod ("findNextRec");
*}*
Here my requirement is that if it's a last drive, I want to show the user a message saying it's last recording. To achieve this please let me know what the code should be written.
Thanks in advance.
Best regards
Arun D. ReddyArun,
If my interpretation is correct, then you can achieve the same thing by making some minor changes to your existing code.
public void findNextRec() { String headerID=null; Row row = getMaster_VO1().next(); if(row!=null) //your code will return null when if there is no record { headerID=row.getAttribute("HeaderId").toString(); getDetail_VO1().setMaxFetchSize(-1); getDetail_VO1().setWhereClause(null); getDetail_VO1().addWhereClause("header_id in (:1)"); getDetail_VO1().setWhereClauseParams(null); getDetail_VO1().setWhereClauseParam(0,headerID); getDetail_VO1().executeQuery(); } else{ //write down the message that there exist no more rows (custom message) } }
Kind regards
GYAN -
How to find inserted last record in the table.
Version: Oracle 10g
I have a table called 'Manufacturing' and 3 columns as mfno, itemname, quantity.
How to find inserted last record in the table 'manufacturing '.
As I got to know that the Rowid is not a result perfect result. Please provide your inputs.user13416294 wrote:
Version: Oracle 10gThis is not a version. It's a product name. A version is 10.1.0.2 or 10.2.0.4, etc.
I have a table called 'Manufacturing' and 3 columns as mfno, itemname, quantity.
How to find inserted last record in the table 'manufacturing '.Not possible as your data model do not answer for him. As simple as that.
If there is a need to determine an order or associate some time to an entity, then that should be part of the data model - and a relationship, or one or several attributes are necessary to represent this information. Your data model in this case is therefore unable to meet your requirements.
If the requirements are valid, set the data model. In other words - your question has nothing to do with Oracle and nothing to do with the other pseudo columns in Oracle, the rowscn or the rowid. It is a question of pure data modeling. Nothing more.
-
Display the last 10 entries in database...
Hi, I would like to display the last 10 entries in my database, I use PHP and mySQL and Dreamweaver...
the latest entries are defined by the 10 highest ID numbers in the database, but there may be gaps in the numbers if an entry has been deleted.
What the WHERE the statement would look like to my request
SELECT *.
OF databasetable
WHERE ID = the largest number less than 10?
ORDER BY ID ASCAny ideas greatly appreciated!
Best regards, Ken
The correct way to proceed in MySQL is like this:
SELECT * FROM databasetable ORDER BY ID DESC LIMIT 10
It retrieves the results in reverse order.
If you want to order the results in ascending order AND use MySQL 4.1 or higher, you can do this:
SELECT * from databasetable WHERE ID > (SELECT ID FROM databasetable ORDER BY ID DESC LIMIT 10, 1) ORDER BY ID ASC
-
How to get the first and last record
Hai All
I have a table called T1 and there are more than 8 lakhs Archives and I have a column named Timestamp, so I need to get the first record value and time stampvalue and last record and time stamp value so that I can conclude that for example
form June 13 to 15 June data are here
Kind regards
SrikkanthMWhat is the problem with:
select min(timestamp),max(timestamp) from T1;
?
-
Hello
my request is to go looking for records. I want to know the second last record.
for example. Select * from emp by empno.
I want to know second last empname.
can someone help me?
thnx in advance.Hello
It is a special case of a Query of paging , which itself is a variation of a Query of Top - N .
Do a search on these terms to other techniques and discussion.Here's one way:
WITH got_rnum AS ( SELECT ename -- or whatever columns you want , RANK () OVER (ORDER BY empno DESC) AS rnum FROM emp ) SELECT * -- or list all columns except rnum FROM got_rnum WHERE rnum = 2 ;
For your specific problem, another way may be a bit simpler, but only a little.
I suggest you to master this technique first, because it can very easily be extended to cover the problems associated with, such as "who has the 2nd empno higher in each Department? -
Insert correctly last record to the child table in the multi user environment.
Hello
I have the following situation.
Two Tables
Table1 has a primary key named ID column
Tabel2 contains a column named table1_id, this is a foreign key to table1.
I have a tabular report that contains an add record button and a button submit to table1. (this table has other columns that require attribution)
I want to insert a record into table2 automatically whenever the user presses submit.
I have a query like this to get the last record in table1:
and I would use it in a submit after procedure like this:SELECT MAX(id) FROM table1
The thing that worries me, is that the application that I use is a multi user environment. I'm afraid that if two or more people use as MAX recording is not the right one.DECLARE v_id NUMBER; BEGIN SELECT MAX(id) INTO v_id FROM table1 INSERT INTO table2(table1_id) VALUES (v_id); END;
It's a legitimate concern?
If so, is there a best way to do this kind of thing.Ben:
The triggers are usually avoidable IMO. But, there is always a but, you already use triggers elsewhere in your application, and probably your form the apex uses the routines of APEX MRU for DML and thus leaves the trigger as the only viable option to achieve what you're trying to do.
CITY
-
calculation of ratios and rounding - how the sum of last record to give 1
I'm putting in a single query to calculate the reports for an unknown number of records. I want to turn the ratios to 5 decimal places and I want the total reports of equal to 1.
for example
If I have 3 folders with Qty total overal 4,5,6 is 15
I note 3 lines
Round (4/15.5),
Round (5/15.5),
Round (6/15.5)
but I want to ensure total = 1
so I will try to do something like
Round (4/15.5),
Round (5/15.5),
1 - round(4/15,5) - round(5/15,5)
can someone help show me the sql construction? I've been trying and failing using where clause
of course this example would add to 1 but other unknown ratios may not match up to 1.
Published by: user12154024 on November 2, 2009 22:32Hello 12154024,
Welcome to the forum. May not be a more elegant solution, but it shows how it works step by step
WITH t AS ( SELECT 4 n FROM dual UNION ALL SELECT 5 n FROM dual UNION ALL SELECT 6 n FROM dual ) ,t1 AS ( SELECT n ,ROUND(RATIO_TO_REPORT(n) OVER (),5) AS rr ,COUNT(n) OVER () AS c ,ROW_NUMBER() OVER (ORDER BY n) AS rn FROM t ) ,t2 AS ( SELECT n ,rr ,SUM(rr) OVER (ORDER BY n) s ,c ,rn FROM t1 ) SELECT n ,rr ,CASE WHEN c = rn THEN rr + (1 - s) ELSE rr END rr2 ,s FROM t2 ORDER BY rn; N RR RR2 S --- --------- --------- -------- 4 0.26667 0.26667 0.26667 5 0.33333 0.33333 0.6 6 0.4 0.4 1 3 rows selected
The part "WITH t AS" generates data
T1 calculate the ratio, counts the number of records and signs a current issue
T2 to calculate a cumulative ratio
the last part takes these data and for the last record (number = count running) it allows to adjust the ratio.You can see if you are using other data
WITH t AS ( SELECT 4.78 n FROM dual UNION ALL SELECT 5 n FROM dual UNION ALL SELECT 6 n FROM dual ) ... N RR RR2 S ---- -------- -------- -------- 4.78 0.30292 0.30292 0.30292 5 0.31686 0.31686 0.61978 6 0.38023 0.38022 1.00001 3 rows selected
Concerning
Marcus -
remove the last record from the plsql table
Under certain conditions, I need to remove the last record from i_CustomerLoopTYPE r_LOOPElement IS RECORD (TermID NUMBER ); TYPE t_LOOPType IS TABLE OF r_LOOPElement INDEX BY BINARY_INTEGER; i_CustomerLoop t_LOOPType ; i_CustomerLoop(1).TermID=1; i_CustomerLoop(2).TermID=2; i_CustomerLoop(3).TermID=3;
whichi s the best way to do it. because I sometimes get duplicates for TermID in this plsql table.Hello
See [removing items from Collection (DELETE method) | http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28370/collections.htm#CJAFGFIG]
Kind regards
Maybe you are looking for
-
Is this a genuine version of Windows XP?
I want to install Windows XP on my old laptop. It's that true buy? http://ekooafpmsjlosoov.programsdeals.NET/product/Windows-XP-Professional-SP3/?SID=NkDfsRKxBYZxVtfEFwhngPsXEjsLbyrZ If not, where can I get it back?
-
XB271HU - stuck at 134Hz in games
Hello I have a strange problem with my XB271HU where when in any game it will only show in 134Hz - can he confirm by selecting "Refresh rate num" in the OSD menu. Make sure the monitor is set to display at 144 Hz in the Nvidia drivers. It also locks
-
Error message at startup "SQLite 3 has stopped working"
original title: problem with SQLite 3 After you restore my computer, I received the following message and don't know what I have to do: A problem with SQLite 3 SQLite 3 has stopped working properly. A newer version of this software is available for d
-
C7280 All in One. Can not scan flat bed after installing wireless with the desktop computer. Several times uninstalled and reinstall. Everything worked fine when connected to the usb port. I also have the error fatal and 96%, which I took care of gr
-
BlackBerry Z10 reduce an image file to be attached to an e-mail message on a new Z10
Hello there, recently got a new Z 10, love it by the way. Does anyone know how to reduce the image files that you take with the Z10 to attach one or more to an e-mail message. There is no prompt in the options to reduce the size and the process t