How to use a repository in a new report
HelloI'm starting to learn OBIEE and installed in my home. I installed OBIEE and used the RCU to install a deposit in an Oracle database.
Then I used the tool of Administration of BI to do a "repository" that connects to my data (also in an Oracle database).
In the Administration of BI tool, I now have a physical layer, a business model and mapping and a presentation layer. I saved it as a file on my HDD DPR.
Then, in the Oracle BIEE home I choose 'new report '. But I can not find how do I choose my 'repository' with my data. I also tried to make a new datamodel, but here I am also not able to choose my deposit.
How can I connect to my data in a report? How does it work?
Many thanks in advance,
Best regards
André.
You are totally getting confused...
Have these figure everything out.
You have installed DB.
You will create the schema (two users) in DB with the remote control (repository creation utility: basically stores the metadata required for OBIEE).
You install OBIEE and use these schema here.
Above installation install weblogic and then deploy on weblogic BI files so that they work. To remember the password weblogic.
Now when you open Admin tool - password repository must be "Admin123" (capital A) and username is weblogic and password must be the password weblogic.
You will be able to open to the top of the RPD in online mode.
I suggest you go first by the OBIEE Architecture then the installation and start the exercises.
Mark correct or useful if it helps. Also let me know if you were able to open the RPD and answers.
Kind regards
Rayan Vieira
Tags: Business Intelligence
Similar Questions
-
How to use windows scan with my new canon MX 922 printer. It is conncected and copying and printing but can't seem to use the windows scan option, the cannon that which for me is slow thanks
All in one, type printers (print, copy, scan) usually have a very specific set of instructions during the installation. If not followed exactly the probability is that the scanner will not work.
Canon: http://www.usa.canon.com/cusa/consumer
Download and read the Setup instructions for your model, have you followed the instructions exactly, more precisely when to connect the printer / scanner during installation of the software process?
J W Stuart: http://www.pagestart.com
-
Hello
I work with APEX 5.0.
I would like a report (classic) display a report of details (also classical report) using a hyperlink, but not a "text-hyperlink" like 'click here for details'.
Instead, I want to use a small icon which will occur the same result when you click on.
It works fine, when the hyperlink is defined as text like: 'click here for details'.
When I try to use an image, I don't get the desired result.
Here's what I tried to Hare:
1)
Link-> Link attributes, then filled column: src = "& WORKSPACE_IMAGES. "" #ICON_NAME # "width ="40"height = 40 ' or img src =" & WORKSPACE_IMAGES. " "" #ICON_NAME # "width ="40"height = 40.
= > no picture for the items in the column, but the link already created for each column of the remains (and works)
2)
Formatting of column-> HTML Expression, then filled: < img src = "& WORKSPACE_IMAGES. "" #ICON_NAME # "width ="40"height = 40" >
= > the image appears for each column element, but the hyperlink is gone.
Somone has idea how to use a picture/icon to have a hyperling in screens reported a detail?
Thank you in advance for sharing your experience.
Kimd cordially
Hi Patrick,
Link to the column-> then filled:
Link text = #ICON_IS #
Link attributes =.
Target = this Application Page
Page = 5
Article 1 = P5_DEPTNO
Value 1 = #DEPTNO #.
Article 2 = P5_DEPARTMENT
Value 2 = #DNAME #.
Put this in the link text not in attributes of link
Remove the code from the link attributes.
I don't have how to make it the way that describe you.
Apex. Oracle.com is a hosted version of application Express, you can build online applications.
Go to this link and the application workspace https://apex.oracle.com/en/
Hope this helps you,
Kind regards
Jitendra
-
How to use WITH Clause of Apex classic report
Hello.
I use Apex 4.2.1 on mod_plsq and Oracle 11 g 3.
I need to create a report classic usiing a WITH clause in the SQL report. Apex keeps throwing the error 'CAN finf SELECT statement.
I then wrapped my report query in an envelope, SELECT * clause. Apex then raises an error you need to use a variable LONG.
How is - a uses a WITH clause in the report query.
Here is my report query:
SELECT *.
Of
(
WITH W
AS
(
SELECT
MIN (W1. URMT_BTRS_PK URMT_BTRS_PK),
MIN (W1. EARLIER_NOTICE_ID URMT_NOTICES_ID),
TO_CHAR (MAX (W1. EARLIER_NOTICE_TYPE NOTICE_TYPE)),
TO_CHAR (MAX (W1. NOTICE_TYPE)) | '- Day' EARLIER_NOTICE_TYPE_DESC,.
MAX (W1. LATER_NOTICE_ID URMT_NOTICES_ID),
TO_CHAR (MIN (W1. LATER_NOTICE_TYPE NOTICE_TYPE)),
TO_CHAR (MIN (W1. NOTICE_TYPE)) | '- Day' LATER_NOTICE_TYPE_DESC,.
W1. NOCHG_STATUS_ORDER,
W1. CHG_STATUS_ORDER,
W1. ADD_STATUS_ORDER,
W1. REM_STATUS_ORDER
Of
(
SELECT
URMT_BTRS_PK,
URMT_NOTICES_ID,
NOTICE_TYPE,
: P202_NOCHG_STATUS_ORDER AS NOCHG_STATUS_ORDER,
: P202_CHG_STATUS_ORDER AS CHG_STATUS_ORDER,
: P202_ADD_STATUS_ORDER AS ADD_STATUS_ORDER,
: P202_REM_STATUS_ORDER AS REM_STATUS_ORDER
Of
V_URMT_COMPARE_NUCLIDE_DATA
WHERE
URMT_NOTICES_ID IN (TO_NUMBER(:P202_COMPARE_EARLER_NOTICE_ID), TO_NUMBER (:P202_COMPARE_LATER_NOTICE_ID))
) W1
)
------------------
SELECT
CASE WHEN (X.STATUS IS NULL) THEN
CASE WHEN (INSTR(X.MASS ||)
X.NUCLIDE_FRACTION
((' *', 1, 1) > 0) THEN '< div class = "chg_highlight" >' | HTF. ESCAPE_SC (' changed (' |)) (SELECT EARLIER_NOTICE_TYPE |) ' => ' || LATER_NOTICE_TYPE | ((' W)) | "< / div >"
Else 'no change '.
END
WHERE (X.STATUS = 'Added') THEN ' < div class = "add_highlight" > ' | HTF. ESCAPE_SC(X.STATUS ||) "To" | (BY SELECTING LATER_NOTICE_TYPE_DESC IN W)) || "< / div >"
WHERE (X.STATUS = 'Deleted') THEN "< div class ="rem_highlight"> ' |" HTF. ESCAPE_SC(X.STATUS ||) 'From ' | (BY SELECTING EARLIER_NOTICE_TYPE_DESC IN W)) || "< / div >"
OF OTHER X.STATUS
END AS STATUS
----
CASE WHEN (X.STATUS_ORDER IS NULL) THEN
CASE WHEN (INSTR(X.MASS ||)
X.NUCLIDE_FRACTION
((' *', 1, 1) > 0) THEN (SELECT CHG_STATUS_ORDER FROM W)
OTHER (SELECT NOCHG_STATUS_ORDER FROM W)
END
OF OTHER X.STATUS_ORDER
END AS STATUS_ORDER,
----
X.NUCLIDE,
----
CASE WHEN (X.STATUS IS NULL) THEN
BOX WHEN (SUBSTR (X.MASS, 1, 1) = ' *') THEN SUBSTR (X.MASS, 2).
OF OTHER X.MASS
END
OF OTHER X.MASS
MASS OF THE END AS,
----
CASE WHEN (X.STATUS IS NULL) THEN
BOX WHEN (SUBSTR (X.NUCLIDE_FRACTION, 1, 1) = ' *') THEN SUBSTR (X.NUCLIDE_FRACTION, 2).
OF OTHER X.NUCLIDE_FRACTION
END
OF OTHER X.NUCLIDE_FRACTION
END AS NUCLIDE_FRACTION
Of
(
-THE NUCLIDES EXIST IN * TWO * BEFORE AND AFTER VIEW. SOME OF THEIR ATTRIBUTES (MASS, NUCLIDE_FRACTION, ETC.) MAY HAVE CHANGED.
SELECT
STATUS AS NULL,
VALUE NULL AS STATUS_ORDER,
C.NUCLIDE,
BOX WHEN (NVL (C.A_MASS, 'Null')! = NVL (C.B_MASS, 'Null')) THEN ' *' | '< div class = "chg_highlight" >' | HTF. ESCAPE_SC (NVL (C.A_MASS, 'Null') |) ' => ' || NVL (C.B_MASS, 'Null')) | "< / div >"
Of ANOTHER NVL (C.B_MASS, 'Null')
MASS OF THE END AS,
----
BOX WHEN (NVL (C.A_NUCLIDE_FRACTION, 'Null')! = NVL (C.B_NUCLIDE_FRACTION, 'Null')) THEN ' *' | '< div class = "chg_highlight" >' | HTF. ESCAPE_SC (NVL (C.A_NUCLIDE_FRACTION, 'Null') |) ' => ' || NVL (C.B_NUCLIDE_FRACTION, 'Null')) | "< / div >"
Of ANOTHER NVL (C.B_NUCLIDE_FRACTION, 'Null')
END AS NUCLIDE_FRACTION
Of
(
SELECT
A.NUCLIDE,
TO_CHAR(A.MASS, '999.99EEEE') AS A_MASS,
TO_CHAR(A.NUCLIDE_FRACTION, '99999.999EEEE') AS A_NUCLIDE_FRACTION,
----
TO_CHAR(B.MASS, '999.99EEEE') AS B_MASS,
TO_CHAR(B.NUCLIDE_FRACTION, '99999.999EEEE') AS B_NUCLIDE_FRACTION
Of
V_URMT_COMPARE_NUCLIDE_DATA, A.
V_URMT_COMPARE_NUCLIDE_DATA B
WHERE
1 = 1
AND A.URMT_BTRS_PK = B.URMT_BTRS_PK
AND A.NUCLIDE = B.NUCLIDE
AND A.URMT_BTRS_PK = (SELECT URMT_BTRS_PK FROM W)-TO_NUMBER(:P202_URMT_BTRS_PK)
AND A.URMT_NOTICES_ID = (SELECT EARLIER_NOTICE_ID FROM W) - TO_NUMBER(:P202_COMPARE_EARLER_NOTICE_ID) - PRIOR NOTICE (EXAMPLE: 30 DAYS)
AND B.URMT_NOTICES_ID = (SELECT LATER_NOTICE_ID FROM W) - TO_NUMBER(:P202_COMPARE_LATER_NOTICE_ID) - FURTHER VIEWS (EXAMPLE: 7 DAYS.) NOTE: PRIOR NOTICE IS COMPARED WITH OPINIONS LATER, FOR EXAMPLE, 30 DAYS IS COMPARED TO 7 DAYS)
) C
UNION
-ADDED NOTICE LATER NUCLIDES. THEY DO NOT APPEAR IN THE EARLIER OPINION.
SELECT
"Added" AS the STATUS,
(BY SELECTING ADD_STATUS_ORDER IN W) AS STATUS_ORDER,
A.NUCLIDE,
TO_CHAR(A.MASS, '999.99EEEE') AS A_MASS,
TO_CHAR(A.NUCLIDE_FRACTION, '99999.999EEEE') AS A_NUCLIDE_FRACTION
Of
V_URMT_COMPARE_NUCLIDE_DATA HAS
WHERE
1 = 1
AND A.URMT_BTRS_PK = (SELECT URMT_BTRS_PK FROM W)-TO_NUMBER(:P202_URMT_BTRS_PK)
AND A.URMT_NOTICES_ID = (SELECT LATER_NOTICE_ID FROM W)-TO_NUMBER(:P202_COMPARE_LATER_NOTICE_ID)
AND NOT EXISTS
(SELECT NULL
OF V_URMT_COMPARE_NUCLIDE_DATA B
WHERE B.URMT_BTRS_PK = A.URMT_BTRS_PK
AND B.NUCLIDE = A.NUCLIDE
AND B.URMT_NOTICES_ID = (SELECT EARLIER_NOTICE_ID FROM W)-TO_NUMBER(:P202_COMPARE_EARLIER_NOTICE_ID)
)
UNION
-DELETED THE PREVIOUS NOTICE NUCLIDES. THEY DO NOT APPEAR IN THE NOTICE LATER.
SELECT
'Removed' AS the STATUS,
(BY SELECTING REM_STATUS_ORDER IN W) AS STATUS_ORDER,
A.NUCLIDE,
TO_CHAR(A.MASS, '999.99EEEE') AS A_MASS,
TO_CHAR(A.NUCLIDE_FRACTION, '99999.999EEEE') AS A_NUCLIDE_FRACTION
Of
V_URMT_COMPARE_NUCLIDE_DATA HAS
WHERE
1 = 1
AND A.URMT_BTRS_PK = (SELECT URMT_BTRS_PK FROM W)-TO_NUMBER(:P202_URMT_BTRS_PK)
AND A.URMT_NOTICES_ID = (SELECT EARLIER_NOTICE_ID FROM W)-TO_NUMBER(:P202_COMPARE_EARLER_NOTICE_ID)
AND NOT EXISTS
(SELECT NULL
OF V_URMT_COMPARE_NUCLIDE_DATA B
WHERE B.URMT_BTRS_PK = A.URMT_BTRS_PK
AND B.NUCLIDE = A.NUCLIDE
AND B.URMT_NOTICES_ID = (SELECT LATER_NOTICE_ID FROM W)-TO_NUMBER(:P202_COMPARE_LATER_NOTICE_ID)
)
) X
)
I have searched this forum for clues but found nothing.
Any help would be appreciated.
Thank you.
Elijah
EEG wrote:
I'll now try to place my report within a packaged procedure, and then run it from there. You don't love doing cela, but seem to don't have is not a choice.
Elijah
Huh? How can you put a SELECT statement in a procedure? you return a cursor reference?
You create VIEWS. You have three sections. Give an opinion on each of them. Test them with SQL Developer (or SQL * more)
Build from there.
In fact, it looks like you are trying to compare two tables"and return a DIFF
THINKING IN SETS
Use the WITH clause to build a 'virtual' table for EARLIER_NOTICE and a 'virtual' table for LATER_NOTICE.
Use FULL OUTER JOIN to compare the two.
THE FORMAT OF THE EXAMPLE:
select * from ( with w as ( .... ) ,table_A as ( -- build the Virtual Table for EARLIER_NOTICE SELECT * FROM V_URMT_COMPARE_NUCLIDE_DATA A1 join W on (A1.urmt_btrs_pk, W.urmt_btrs_pk and A1.earlier_notcie_id=W.earlier_notice_id) -- old code -- WHERE -- 1 = 1-- why??? -- AND A.URMT_BTRS_PK = (SELECT URMT_BTRS_PK FROM W) --TO_NUMBER(:P202_URMT_BTRS_PK) -- AND A.URMT_NOTICES_ID = (SELECT EARLIER_NOTICE_ID FROM W) --TO_NUMBER(:P202_COMPARE_EARLER_NOTICE_ID) ,table_b as ( -- build the Virtual Table for the LATER_NOTICE select * from V_URMT_COMPARE_NUCLIDE_DATA B1 join W on (b1.urmt_btrs_pk = W.urmt_btrs_pk and b1.urmt_notice_id=W.later_notice_id) ) --/*** NOW - WE COMPARE THE TWO ***/ select CASE when A.urmt_btrs_pk is null then 'ADDED' when B.urmt_btrs_pk is null then 'DELETED' else 'possibily updated' end CHANGES_MADE , A.* , B.* FROM TABLE_A A FULL OUTER JOIN B ON ( A.URMT_BTRS_PK = B.URMT_BTRS_PK AND A.NUCLIDE = B.NUCLIDE )
-
Satellite Pro U400-12y: how to use HDD recovery after the new installation of the OS
Dear Sir
I have the Satellite Pro U400-12y and give tem my friend use it when he gets back, the laptops it do format c: and reinstalled new windows.
I try to do the recovery only by pressing f8 without answering.How can I recover my laptop to its state of origin as drive HARD recovery again in d:
Thanks in advHello
You will not be able to restore the factory settings because another operating system has been installed on the first partition.
Usually by pressing F8 immediately after the laptop has been powered should allow the advanced on-screen menu. Here, you should choose option called repair my computer and Toshiba Recovery HARD drive.But if this doesn t work then you will not be able to use HARD drive recovery.
In this case, you will need to order the new CD from here:https://backupmedia.Toshiba.EU/landing.aspx
Good bye
-
So, how I continue with using the software Adobe Acrobat Standard in my new computer whitout pay a new subscription?
@
Hey Ignacio vazquez martinez,
If you have the installation disk and serial number then you can use it to install on your other computer.
Kind regards
Anand
-
How to use module Downloadthemall with the new edition of Firefox?
I installed the new version of Firefox, but now can't use the Downloadthemall application. Please notify.
Make sure you have the latest version of installed DownThemAll - https://addons.mozilla.org/firefox/addon/downthemall
If you have the latest version, which is the real problem you're having with DownThemAll? Are there any error messages?
-
How to use the repository Variable title
Hi all
I'm new to Obiee. I have a requirement, I want to show variable repository in title.
Please help me
Thank you...Hello
In the legend of view title write as follows
@{biServer.variables ['NQ_SESSION.variablename']}
For more details abt this link below, you will find the table of variables
Concerning
NGO
-
iPhone 6s start-up aid
Update the new phone first. Settings > general > software update. Accept the update, download and install it. Once the phone lights up and takes you through the installation process, go to settings > General > reset > erase content and settings. The phone will restart, take you through the installer again and you will be asked to you want to restore the backup to iCloud. Say yes to that, choose the backup you want and let the process complete.
-
How to use the recovery with a new ssd disk after the death of original hard drive
I thought I had a simple fix/upgrade for my dv5 - 2077cl.
decided to replace the defective hard drive with an SSD. couldn't afford a 240 GB size but it's big enough for my needs.
I installed the new drive easily and cycled through my 4 recovery disc reinstall the minimum overlap. After you delete the last record, the screen goes gray and there is a cursor in the top left corner for more than 10 hours.
I finally it turned off and tried again two times the same results. I removed the DDI and run disk management on it from my other laptop and an external cable to remove the partiion and create a single partition. Tried to install windows xp on a disk that I own this isn't an update or restore disc thinking I might switch to windows 7 32 bit because I own and upgrade the disks also. even if it is a 64-bit system, but I do not have any disk 64-bit except the recovery disks that didn't seem to work.
When I ran the xp it seemed to work but then I got the blue screen that said there is no drivers for the SDS (the error is as follows stop0x0000007B (0xF78D2524, 0XC0000034, 0x00000000, 0x00000000))
So I guess I need to have a windows 7 install disk rather than the recovery discs?
the SSD is a Silicon Power S70 240 GB.
any suggestions?
Recovery discs usually require a hard drive of equal or greater capacity. XP doesn't have SATA drivers Sockets.
If you can read the Microsoft Windows 7 of 25-character license key, you can download a Windows 7 ISO file to burn to a DVD or USB flash drive. The version must match that's installed on your PC as shown on the sticker COST Microsoft fixed on the bottom of the laptop. Like Windows Home Premium.
Links to downloads of Windows 7 ISO files: -
How to use an option button in the report of the IR to redirect itself to view another report
IHH team, I have a requirement where I have an IR report option button. By clicking this radio button, another report appears under the main report with few other details of the selected item. The idea was to have a zoom of report as seen in the Group of MS Excel. However, I am stuck because I don't want the user to press the "submit" button each time after selection of a radio button. I want the result to Report2 to change on the selection radio button in report 1.
Please notify.
Kind regards
Samar
for example
Report1 details
RB col_id text1 text2 Text3
1 . abc erd 45
2 ghj dfgrt 67
Suppose the user selects the first option button, the page displays another report with details below the main report
Report1 details
col1_id text1 text2 Text3
RB1 1 abc erd 45
2 RB2 ghj dfgrt 67
Report2 details
col1_id col2_id text1 text2 Text3
1 11 ihj pkpk 78
1 23 ljl kpk 45
user6255521 wrote:
Please update your forum profile with a real handle instead of 'user6255521': Video tutorial how to change username available
When asking a question, always include the information referred to in these guidelines: How to get the answers from the forum
I was able to achieve using the linl. I created a link on the col_id and it redirected to itself after you set the value of col2_id. I also changed the style of the button link and so col1_id looks like a button.
However, I was interested to know if we can achieve this with a radio button and use the update form the Report2.
You mean like this? It is very simple to implement using dynamic measurements.
1. Add a column of radio group to the main report:
select apex_item.radiogroup(1, d.department_id) rbg , d.* from oehr_departments d
APEX 5.0, apply a static ID "rbg" to the column of radio group.
2. create a hidden page unprotected element to maintain the value of the selected radio button to use as a filter in the detailed report. In the example, it is P31_DEPARTMENT_ID.
3 refer to the element of filter in the WHERE clause of the report detail:
select * from oehr_employees where department_id = :p31_department_id
Set the Items property of the Page to send in the definition of report P31_DEPARTMENT_IDretail area.
4. create a dynamic action of change on the Group of radio buttons:
Event: Change
Selection type: jQuery Selector
jQuery Selector:
td[headers="rbg"] input[type="radio"]
Real Actions
Seq: 10
Action: Set value
Type of value: Expression of JavaScript
JavaScript expression:
$(this.triggeringElement).val()
Selection type: Article (s)
Point: P31_DEPARTMENT_ID
Seq: 20
Action: Discount
Selection type: Region
Region:
The best way to get help with something like that is for you to reproduce the problem with an example on apex.oracle.com. Set up as much as you can before posting here and when you post the question, share identification information of developer comments for the workspace so that we can see the example and work the solution directly.
-
How to use BETWEEN function in calculation discoverer report?
Hello
I need discoverer report to:
All part_numbers between SDK00 and SDK99 should have calculation (Pay_amount + 100)
SQL for this is: PART_NUM between 'SDK00' and 'SDK99 '.
* How can I get the function BETWEEN in Discoverer report level calculation in Discoverer Desktop or discoverer more? *
Thanks in advance,
Gayatri
Published by: cool gayatri on June 24, 2009 08:32Hi Gayatri
Did you not see my answer for the CASE because the CASE offer the use of the clause BETWEEN, but DECODE indeed does not work. Let me give you a quick summary of DECODE.
In its simplest form, it takes 4 values and looks like this: DECODE (A, B, C, D)
This basically means, IF A = B THEN C D OTHER
The trick to solve ENTERS a DECODING is to work on algoriths where A = B. Because we do not know how values are from 00 to 99, although I could tell there were 100 we would of course 100 pieces in DECODING, but that would be awful. How about if we look at it another way and say this:
IF PART_NUMBER< 'sdk00'="" then="">
ELSE IF PART_NUMBER > 'SDK99' DO pay_AMOUNT
ANOTHER pay_amount + 100This statement was only 2 hard coded values, but how do you DECODE work with less of? Easy, we use the function LESS. The LEAST function takes 2 values and returns the one with the lowest value. So I use LESS (PART_NUMBER, 'SDK00'), then whenever the PART_NUMBER is lower than SDK00 it will be true. A similar situation exists for the inverse function more GRAND. Put it all together, then you can do this:
DECODE (PART_NUMBER, BIGGER (PART_NUMBER, 'SDK00'), DECODE (PART_NUMBER, LESS (PART_NUMBER, 'SDK99'), PAY_AMOUNT * 100, PAY_AMOUNT), PAY_AMOUNT)
In English it can be read as follows:
IF the PART_NUMBER is greater than or equal to SDK00 and the PART_NUMBER is less than or equal to SDK99 THEN PAY_AMOUNT x 100 ELSE 0
Best wishes
Michael -
How to use swivel to cross a tabular report with external business logic
Hello gurus,
I have it here is the Emp_Hist table, which is usually audit table for the Emp table.
For each record, we maintain version whenever it updated there.
ENo EName Sal job DOB Version Tstamp
---------- ---------- ---------- ---------- ---------- ---------- ----------------------
1 Sanjiv 1000 committed 12/10/89 1 02/03/12 13:00
1 Sanjiv 1000 committed 12/10/89 2 02/03/12 14:00
1 Sanjeev 1900 committed 12/10/89 3 02/03/12 15:00
2 Scott 2000 analyst 22/10/85 1 02/05/12 13:00
2 Scott 2000 analyst 22/10/85 2 02/05/12 14:00
2 Scott 3000 lead 22/10/85 3 02/05/12 15:00
Smith 4000 lead 13/11/81 1 3 06/02/12 13:00
Smith 5000 lead 13/11/81 2 3 02/06/12 14:00
3 Smith 5500 lead 13/11/81 3 06/02/12 16:00
3 Smith 8000 CTO 13/11/81 5 02/06/12 17:00
4 Tom 4000 lead 13/11/81 1 02/07/12-13:00
4 Tom 5000 lead 13/11/81 2 07/02/12 14:00
4 Tom 5500 lead 13/11/81 3 02/07/12 15:00
Tom 4 8000 CTO 13/11/81 4 02/07/12-16:00
CREATE
TABLE Emp_Hist
(
ENo NUMBER,
EName VARCHAR2 (20).
SAL NUMBER,
Use VARCHAR2 (20).
DATE OF BIRTH,
Version NUMBER,
Tstamp DATE
);
Insert into EMP_HIST (ENO, ENAME, SAL, JOB, DOB, VERSION)
values (1, 'Sanjiv', 1000, 'Clerk', to_date (December 10, 1989 "," DD-MON-RRRR'), 1, to_date (March 2, 2012 13:00 ',' DD-MON-RRRR hh24:mm'));
Insert into EMP_HIST (ENO, ENAME, SAL, JOB, DOB, VERSION)
values (1, 'Sanjiv', 1000, 'Clerk', to_date (December 10, 1989 "," DD-MON-RRRR'), 2, to_date (March 2, 2012 14:00 ',' DD-MON-RRRR hh24:mm'));
Insert into EMP_HIST (ENO, ENAME, SAL, JOB, DOB, VERSION)
values (1, 'Sanjeev', 1900, 'Clerk', to_date (December 10, 1989 "," DD-MON-RRRR'), 3, to_date (March 2, 2012 15:00 ',' DD-MON-RRRR hh24:mm'));
Insert into EMP_HIST (ENO, ENAME, SAL, JOB, DOB, VERSION)
values (2, 'Scott', 2000, 'Analyst', to_date (October 22, 1985 "," DD-MON-RRRR'), 1, to_date (May 2, 2012 13:00 ',' DD-MON-RRRR hh24:mm'));
Insert into EMP_HIST (ENO, ENAME, SAL, JOB, DOB, VERSION)
values (2, 'Scott', 2000, 'Analyst', to_date (October 22, 1985 "," DD-MON-RRRR'), 2, to_date (May 2, 2012 14:00 ',' DD-MON-RRRR hh24:mm'));
Insert into EMP_HIST (ENO, ENAME, SAL, JOB, DOB, VERSION)
values (2, 'Scott', 3000, 'Lead', to_date (October 22, 1985 "," DD-MON-RRRR'), 3, to_date (May 2, 2012 15:00 ',' DD-MON-RRRR hh24:mm'));
Insert into EMP_HIST (ENO, ENAME, SAL, JOB, DOB, VERSION)
values (3, 'Smith', 4000, 'Lead', to_date (22 October 1981 "," DD-MON-RRRR'), 1, to_date (June 2, 2012 13:00 ',' DD-MON-RRRR hh24:mm'));
Insert into EMP_HIST (ENO, ENAME, SAL, JOB, DOB, VERSION)
values (3, 'Smith', 5000, 'Lead', to_date (22 October 1981 "," DD-MON-RRRR'), 2, to_date (June 2, 2012 14:00 ',' DD-MON-RRRR hh24:mm'));
Insert into EMP_HIST (ENO, ENAME, SAL, JOB, DOB, VERSION)
values (3, 'Smith', 5500, 'Lead', to_date (22 October 1981 "," DD-MON-RRRR'), 3, to_date (June 2, 2012 15:00 ',' DD-MON-RRRR hh24:mm'));
Insert into EMP_HIST (ENO, ENAME, SAL, JOB, DOB, VERSION)
values (3, 'Smith', 8000, 'CTO', to_date (22 October 1981 "," DD-MON-RRRR'), 5, to_date (June 2, 2012 17:00 ',' DD-MON-RRRR hh24:mm'));
Insert into EMP_HIST (ENO, ENAME, SAL, JOB, DOB, VERSION)
values (4, 'Tom', 4000, 'Lead', to_date (22 October 1981 "," DD-MON-RRRR'), 1, to_date (July 2, 2012 13:00 ',' DD-MON-RRRR hh24:mm'));
Insert into EMP_HIST (ENO, ENAME, SAL, JOB, DOB, VERSION)
values (4, 'Tom', 5000, 'Lead', to_date (22 October 1981 "," DD-MON-RRRR'), 2, to_date (2 July 2012 14:00 ',' DD-MON-RRRR hh24:mm'));
Insert into EMP_HIST (ENO, ENAME, SAL, JOB, DOB, VERSION)
values (4, 'Tom', 5500, 'Lead', to_date (22 October 1981 "," DD-MON-RRRR'), 3, to_date (July 2, 2012 15:00 ',' DD-MON-RRRR hh24:mm'));
Insert into EMP_HIST (ENO, ENAME, SAL, JOB, DOB, VERSION)
values (4, 'Tom', 8000, 'CTO', to_date (22 October 1981 "," DD-MON-RRRR'), 4, to_date (July 2, 2012 16:00 ',' DD-MON-RRRR hh24:mm'));
I want to display changes (current value and previous value)
for each column as below.
PK_Value Column_Name Previous_value Current_Value
-------------- -------------------------- -------------------- --------------------
1 ENo 1 1
1 Ename Sanjiv Sanjeev
1 1000 1900 sal
1 committed post clerk
1 DATE OF BIRTH 12/10/89-12/10/89
2 ENo 2 2
2 Ename Scott Scott
2 sal 2000 3000
2 senior analyst job
2 DATE OF BIRTH 12/10/89-12/10/89
3 ENo 3 3
3 Ename Smith Smith
3 5500 8000 sal
3 Job Lead CTO
3 DATE OF BIRTH 12/10/89-12/10/89
Solution for above requirement is query below.
WITH
got_r_num AS
(
SELECT
Eno,
Ename,
To_char (sal) AS sal,
employment,
To_char (dob, 'DD-MON-YYYY') AS date of birth,
ROW_NUMBER () OVER (PARTITION BY eno ORDER BY version DESC) AS r_num
Of
emp_hist
)
SELECT
*
Of
(got_r_num) PIVOT UNPIVOT (str FOR column_name IN (ename, sal, job, birth date))
MIN (str) FOR r_num IN (2 AS previous_val, 1 AS)
current_val))
ORDER BY
Eno,
Column;
But there are a few changes to the rquirement as below
There is a table that maintains the version the most recent/maximum for each employee.
Table EMP_AUD_LOOKUP have structure below
CREATE
TABLE emp_aud_lookup
(
ENo NUMBER,
Version NUMBER
);
Insert into emp_aud_lookup (ENO, VERSION) values (1.3);
Insert into emp_aud_lookup (ENO, VERSION) values (2,3);
Insert into emp_aud_lookup (ENO, VERSION) values (3.6);
Insert into emp_aud_lookup (ENO, VERSION) values (4.6);
version of Eno
------ -----------
1 3
2 3
3 6
4 6
maximum/later in the EMP_AUD_LOOKUP table.
For emp = 1, version the most recent/maximum is 3
For emp = 2, version the most recent/maximum is 3
For emp = 3, version the most recent/maximum is 6, if it's 5 emp_hist table but the matching record in
Table 6 (since it can be changed in other tables to load of the EMP_AUD_LOOKUP
that is the case has changed in child table thats why he is 6)
For emp = 4, version the most recent/maximum is 6, if it is 4 emp_hist table but the matching record in
Table 6 (since it can be changed in other tables to load of the EMP_AUD_LOOKUP
that is the case has changed in child table thats why he is 6)
Updated the result will be like
PK_Value Column_Name Previous_value Current_Value
-------------- -------------------------- -------------------- --------------------
1 ENo 1 1
1 Ename Sanjiv Sanjeev
1 1000 1900 sal
1 committed post clerk
1 DATE OF BIRTH 12/10/89-12/10/89
2 ENo 2 2
2 Ename Scott Scott
2 sal 2000 3000
2 senior analyst job
2 DATE OF BIRTH 12/10/89-12/10/89
3 ENo 3 3
3 Ename Smith Smith
3 8000 8000 sal
3 Job CTO CTO
3 DATE OF BIRTH 12/10/89-12/10/89
4 ENo 4 4
4 Tom Tom Ename
4 8000 8000 sal
4 Job CTO CTO
4 DATE OF BIRTH 12/10/89-12/10/89
In the case of ENo = 1, will be later
SELECT version in v_latest OF EMP_AUD_LOOKUP where Eno = 1;
v_latest = 3
Latest = > max (version) of emp_hist < = v_latest or 3 < = 3 so 3
Previous = > max (version) of emp_hist < v_latest-1 or 2 < = 2 so 2
In the case of ENo = 2, will be later
SELECT version in v_latest OF EMP_AUD_LOOKUP where Eno = 2;
v_latest = 3
Latest = > max (version) of emp_hist < = v_latest or 3 < = 3 so 3
Previous = > max (version) of emp_hist < v_latest-1 or 2 < = 2 so 2
In the case of ENo = 3, will be later
SELECT version in v_latest OF EMP_AUD_LOOKUP where Eno = 3;
v_latest = 6
Latest = > max (version) of emp_hist < = v_latest or 5 < = 6 so 5
Previous = > max (version) of emp_hist < v_latest-1 is 5 < = 5 so 5
In the case of ENo = 4, will be later
SELECT version in v_latest OF EMP_AUD_LOOKUP where Eno = 4;
v_latest = 6
Latest = > max (version) of emp_hist < = v_latest or 4 < = 6 so 4
Previous = > max (version) of emp_hist < v_latest - 1 = 4 < = 5 so 4
Can we make changes above with a modified respect logic based on the id of the most recent version of the other table.
either we can manipulate in row_number() function.
Hello.. Try the below...
WITH qry1 AS (SELECT eno,
Ename,
SAL,
employment,
Date of birth
Version
Max (version) OVER (PARTITION BY eno) mx_ver
Of emp_hist).
qry2 AS
(SELECT eno1,
To_char (Eno) eno,
Ename,
To_char (SAL) sal,
employment,
Date of birth to_char(DOB,'DD-mon-YYYY'),
To_char (ld_eno) ld_eno,
ld_ename,
To_char (ld_sal) ld_sal,
ld_job,
To_char(DOB,'DD-mon-YYYY') ld_dob
FROM (SELECT q1.eno, eno1,
Q1. Nwe eno,
Ename,
SAL,
employment,
Date of birth
INF. ROW_NUMBER() over (PARTITION BY q1.eno ORDER BY q1.version),
Lead (Q1. Eno, 1, Q1. ENO) OVER (PARTITION BY q1.eno ORDER BY q1.version) ld_eno,.
Lead(Ename,1,Ename) OVER (PARTITION BY q1.eno ORDER BY q1.version) ld_ename,
Lead(SAL,1,SAL) OVER (PARTITION BY q1.eno ORDER BY q1.version) ld_sal,
Lead(Job,1,Job) OVER (PARTITION BY q1.eno ORDER BY q1.version) ld_job,
Lead(DOB,1,DOB) OVER (PARTITION BY q1.eno ORDER BY q1.version) ld_dob,
version Q1.version
OF qry1 q1 emp_aud_lookup eal
WHERE q1.eno = eal.eno
AND (q1.mx_ver = eal.version AND (q1.version = q1.mx_ver OR q1.version = q1.mx_ver - 1))
OR(Q1.mx_ver <> EAL.version and Q1.version = Q1.mx_ver)))
WHERE rn = 1)
SELECT eno1 eno,
CASE WHEN lvl = 1 THEN 'ENO '.
ONCE lvl = 2 THEN 'ENAME '.
ONCE lvl = 3 THEN 'SAL '.
ONCE lvl = 4 THEN "JOB."
ONCE lvl = 5 THEN 'DOB '.
ELSE 'N/A '.
END as col_name,
CASE WHEN lvl = 1 THEN eno
ONCE lvl = 2 THEN ename
ONCE lvl = 3 sal THEN
ONCE lvl = 4 THEN employment
ONCE lvl = 5 THEN dob
END as previous_value,
CASE WHEN lvl = 1 THEN ld_eno
ONCE lvl = 2 THEN ld_ename
ONCE lvl = 3 THEN ld_sal
ONCE lvl = 4 THEN ld_job
ONCE lvl = 5 THEN ld_dob
END AS current_value
OF qry2, (lvl SELECT LEVEL FROM dual CONNECT BY LEVEL<=>=>
ORDER BY eno, lvl;
OUTPUT:-
-------
ENO COL_N PREVIOUS_VALUE CURRENT_VALUE
---- ----- --------------- ---------------
1 1 1 ENO
1 ENAME Sanjiv Sanjeev
1 1000 1900 SAL
1 committed POST clerk
1 DOB DECEMBER 10, 1989 10 DECEMBER 1989
2 2 2 ENO
2 ENAME Scott Scott
2 SAL 2000 3000
2 senior analyst JOB
2 DATE OF BIRTH 22 OCTOBER 1985 OCTOBER 22, 1985
3 3 3 ENO
3 ENAME Smith Smith
3 8000 8000 SAL
3 USE CTO CTO
3 DATE OF BIRTH 22 OCTOBER 1981 OCTOBER 22, 1981
ENO 4 4 4
4 Tom Tom ENAME
4 8000 8000 SAL
4 JOB CTO CTO
4 DATE OF BIRTH 22 OCTOBER 1981 OCTOBER 22, 1981
20 selected lines.
-
How to use an element not DB in reports
Hi all
I want to use a DB element not in a report to retrieve a value from the database using a part of the DB in the data model
What should I do?
Create a column placeholder or a formula column?
I tried to do by creating this function:
FUNCTION CHAR INF_RET(PINF_NO IN NUMBER) IS BACK
INF_TEXT VARCHAR2 (100);
BEGIN
SELECT table_namr.information - information is a column of this table
in inf_text
from table_name
where table_name.information = PINF_NO;
RETURN INF_TEXT;
END;
create a placeholder column and then retrieves the value using the previuos as follows:
function INFFormula returns the Char type is
INF varchar2 (100);
Start
SELECT INF_RET(:information_sid) - an element DB
IN: inf_P - it's the placeholder column
DOUBLE;
end;
But it gives me the following error:
"Function INF_RET cannot be used in SQL.Hello
You cannot use a local function in SQL.
Possible solutions:
Join your Select used directly in your local function in the query (this is the best, because he needs without code and will be the best for performance).
Create a column formula in the same group where your field: information_sid is located, in what form-function, make your selection and return the result as a result of the formula-function. Then you can use this formula column in page layout as part of the 'normal' query
-
How to use the model instead of RP pspice to create the new component?
Hi, I need to create the model of opa890 of TI, but I found no spice I find model pspice, how to use it to create the new template part.
Fouda, salvation
I took a quick glance to the component but for some reason, the model pspice does not correctly applied to the component. The second problem was that the pins have been mapped properly. I've done the component for you with the model and print and attached it to this message. You just need to add it to your database of click with the right button on the component, and then clicking on save to DB component.
If all goes well, you should start to see the results of the component. I hope this helps.
Best regards
Maybe you are looking for
-
A driver for HP 3520 10.11.6-compatible
I can't find a driver for my printer HP deskjet 3520. I El capitan and my printer does not print black whire and more!
-
Satellite A300D-14R still overheating
Hello My toshiba A300D - 14R is always overheated way.The temperature is 90 degrees Celsius, no load.When loading it is 101-105 degrees celsius. On an even heavier load (like video editing) it just stops. What should I do to stop this? Sincerely,Mich
-
Lenovo G580 Bletooth are not not in Device Manager after upgrade Windows 10
Hello everyone, I'm sorry for the question once again, but after that I have upgraded to Windows 10 my Bluetooth did not appear on the Device Manager. I tried everything to fix it, but all the solutions on the previous posts has not worked for me. Wh
-
HP Stream 13: Battery not detected
Hello I bought a 13 Stream to my daughter about 6 months ago. She has not used... A few days ago, the battery suddenly disappeared! It only works on power now. Is there some kind of warranty that covers this? I didn't expect the battery to go kaput i
-
I still have Microsoft "Picture It" installed on my computer (because I love it), but it causes a conflict with the .php files. i.e. the php files get saved to the "Picture It". Is there a way around that does not uninstall Picture It?