SQL Experts, Please help!!
Hi
Here is my query:
select
--Element Details:
pet.element_name, pet.element_type_id, pet.reporting_name,
decode(pet.processing_type, 'R', 'Recurring', 'Nonrecurring') "Processing Type",
pet.EFFECTIVE_START_DATE, pet.EFFECTIVE_END_DATE,
--Run Result Details:
prr.run_result_id,
NVL(prrv.RESULT_VALUE, 0)"Extra Mileage Details",
decode(piv.name, 'Pay Value', 'Amount',
'Number of KMs', 'Total Kilometers Covered',
'Vehicle Registration No', 'Vehicle Registration No.')"Input Value",
--Assignment Details:
paa.assignment_id,
--Time Period
ptp.START_DATE, ptp.end_date,
ptp.period_name "Payroll Period"
from
hr.pay_element_types_f pet,
hr.pay_run_results prr,
hr.pay_run_result_values prrv,
hr.pay_input_values_f piv,
hr.pay_assignment_actions assact,
hr.per_all_assignments_f paa,
hr.pay_payroll_actions payroll,
hr.per_time_periods ptp
where
pet.ELEMENT_TYPE_ID = prr.ELEMENT_TYPE_ID
and prr.run_result_id = prrv.run_result_id
and piv.input_value_id = prrv.input_value_id
and assact.ASSIGNMENT_ACTION_ID = prr.ASSIGNMENT_ACTION_ID
and paa.ASSIGNMENT_ID = assact.ASSIGNMENT_ID
and payroll.payroll_action_id = assact.PAYROLL_ACTION_ID
and ptp.TIME_PERIOD_ID = payroll.time_period_id
and pet.element_name = 'IVTB Extra Mileage'
and ptp.end_date between pet.effective_start_date and pet.effective_end_date
and ptp.end_date between paa.EFFECTIVE_START_DATE and paa.EFFECTIVE_END_DATE
and ptp.end_date between piv.effective_start_date and piv.effective_end_date
and paa.payroll_id != 0
and paa.pay_basis_id != 0
When I get the results, I get the Pay Value, Kilometers and Vehicle Registration no. in rows. They are my 'input values' having different input ids, however, they have same run result id and thus. I want to display them as separate columns each with the heading 'Pay value' , 'Kilometers' etc. and display my run resulyt value below each heading.
Is this possible? Can someone plz guide me?
Thanks in advance.
Regards,
Aparna Gupte
This should be possible with SQL*Plus reporting
http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14357/ch6.htm#CHDBEAAB
think it will be something like this;
COLUMN Pay_Value NEW_VALUE V_pay_value NOPRINT
COLUMN Kilometers NEW_VALUE V_Kilometers NOPRINT
COLUMN Registration NEW_VALUE V_Registration NOPRINT
TTITLE LEFT 'Heading: ' V_pay_value,V_Kilometers,V_Registration SKIP 2
BREAK ON piv.name SKIP PAGE
select
--Element Details:
pet.element_name, pet.element_type_id, pet.reporting_name,
decode(pet.processing_type, 'R', 'Recurring', 'Nonrecurring') "Processing Type",
pet.EFFECTIVE_START_DATE, pet.EFFECTIVE_END_DATE,
--Run Result Details:
prr.run_result_id,
NVL(prrv.RESULT_VALUE, 0)"Extra Mileage Details",
decode(piv.name, 'Pay Value', 'Amount',
'Number of KMs', 'Total Kilometers Covered',
'Vehicle Registration No', 'Vehicle Registration No.')"Input Value",
--Assignment Details:
paa.assignment_id,
--Time Period
ptp.START_DATE, ptp.end_date,
ptp.period_name "Payroll Period"
from
hr.pay_element_types_f pet,
hr.pay_run_results prr,
hr.pay_run_result_values prrv,
hr.pay_input_values_f piv,
hr.pay_assignment_actions assact,
hr.per_all_assignments_f paa,
hr.pay_payroll_actions payroll,
hr.per_time_periods ptp
where
pet.ELEMENT_TYPE_ID = prr.ELEMENT_TYPE_ID
and prr.run_result_id = prrv.run_result_id
and piv.input_value_id = prrv.input_value_id
and assact.ASSIGNMENT_ACTION_ID = prr.ASSIGNMENT_ACTION_ID
and paa.ASSIGNMENT_ID = assact.ASSIGNMENT_ID
and payroll.payroll_action_id = assact.PAYROLL_ACTION_ID
and ptp.TIME_PERIOD_ID = payroll.time_period_id
and pet.element_name = 'IVTB Extra Mileage'
and ptp.end_date between pet.effective_start_date and pet.effective_end_date
and ptp.end_date between paa.EFFECTIVE_START_DATE and paa.EFFECTIVE_END_DATE
and ptp.end_date between piv.effective_start_date and piv.effective_end_date
and paa.payroll_id != 0
order by piv.name,Number of KMs,Vehicle Registration No
Similar Messages
-
SQL experts please help for a query
I have following table1.
What query can give the result as given below, SQL experts please help on this.
TABLE1
Event DATETIME
in 2/JAN/2010
out 2/JAN/2010
in 13/JAN/2010
out 13/JAN/2010
in 5/JAN/2010
out 5/JAN/2010
RESULT REQUIRED FROM THE SQL QUERY
COL1_IN COL2_OUT
2/JAN/2010 2/JAN/2010
13/JAN/2010 13/JAN/2010
5/JAN/2010 5/JAN/2010I tried to help, but this puzzles me.
Why is this not returning pre-selected set of rows, why it's doing some merge join cartezian ?
SQL> select * from v$version;
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Prod
PL/SQL Release 10.2.0.4.0 - Production
CORE 10.2.0.4.0 Production
TNS for Linux: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production
SQL> select * from table1;
EVENT DATETIME
in 2/JAN/2010
out 2/JAN/2010
in 13/JAN/2010
out 13/JAN/2010
in 5/JAN/2010
out 5/JAN/2010
6 rows selected.
SQL> explain plan for
2 with a as
(select datetime from table1 where event='in'),
b as
(select datetime from table1 where event='out')
select a.datetime COL1_IN ,b.datetime COL2_OUT from a,b ;
Explained.
SQL> set wrap off
SQL> set linesize 200
SQL> select * from table(dbms_xplan.display);
PLAN_TABLE_OUTPUT
Plan hash value: 185132177
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 9 | 288 | 8 (0)| 00:00:01 |
| 1 | MERGE JOIN CARTESIAN| | 9 | 288 | 8 (0)| 00:00:01 |
|* 2 | TABLE ACCESS FULL | TABLE1 | 3 | 48 | 3 (0)| 00:00:01 |
| 3 | BUFFER SORT | | 3 | 48 | 5 (0)| 00:00:01 |
|* 4 | TABLE ACCESS FULL | TABLE1 | 3 | 48 | 2 (0)| 00:00:01 |
PLAN_TABLE_OUTPUT
Predicate Information (identified by operation id):
2 - filter("EVENT"='in')
4 - filter("EVENT"='out')
Note
- dynamic sampling used for this statement
21 rows selected.
SQL> with a as
(select datetime from table1 where event='in'),
b as
(select datetime from table1 where event='out')
select a.datetime COL1_IN ,b.datetime COL2_OUT from a,b ;
COL1_IN COL2_OUT
2/JAN/2010 2/JAN/2010
2/JAN/2010 13/JAN/2010
2/JAN/2010 5/JAN/2010
13/JAN/2010 2/JAN/2010
13/JAN/2010 13/JAN/2010
13/JAN/2010 5/JAN/2010
5/JAN/2010 2/JAN/2010
5/JAN/2010 13/JAN/2010
5/JAN/2010 5/JAN/2010
9 rows selected.
SQL> -
BDC - table control - experts please help
Hi experts,
Please help. I am in need of your help.
I am working with BDC and I have a table control in one of the screen. Table control has a check box in the first column. While recording how I entered the data is : I select the check box in a row, enter two values in next two columns of that row and then hit enter then the other columns in that row turn from grey to white (initially these columns are greyed out).
NOw in BDC when I run my session in foreground, I am able to check(select) the check box and enter the values in next two columns and then I have a Enter OKCODE. But when I hit enter it is not able to recognize the row and its unable to turn the greyed out columns in that particular row to white.
Is there a way to specify in my program that I am hitting enter in one particular row.
Please help. Let me know if something is not clear. Very urgent . Pleasee respond. ThanksHi Rich,
Thanks for the replies. I will try that. I got one more doubt. While manually creating the recipes using C201, there is a screen Recipe header. When I record this transaction, I see a different screen for the Recipe header. Fro example the screen numbers are like 4210(manual) and 4211(recording).
But my problem is there are two fields which are missing in the screen which I am getting while recording C201. These two fields are present on the screen for manual creation. I need to enter those two fields while I record. But how can I do this.
Please help. -
I bought an iphone 5 from one of my friends and unluckily I had yet lost his contact, I had update this iphone to IOs 7 and now it's be locked at iCloud because there was no password . Actually I dont know what I must do for its. Experts, please help me!
The friend who sold it to you needed to clear his Apple ID off the phone before he sold it to you. Of course if it wasn't his phone in the first place then he could not do so. He is your friend but you don't know where he is?
There is nothing that will help you short of getting the password for the Apple ID from your friend. If you cannot obtain that there is no workaround. -
Hi experts,
what i want to do is write a single query which will show whether a employee
exits in the company or not.I have two tables emp and dept.There are as follows.
SQL> select * from emp;
NAME DEPTNO EMPNO
xxx 10 33036
YYY 12 2345
ZZZ 13 678
KKK 14 5678
RRR 15 7865
SQL> select * from dept;
DEPTNO LOCATION
10 AAA
11 BBB
12 CCC
13 DDD
what i want is it will select records from the emp table and find whether corrosponding
deptno really exists in the dept table.If the value is found in deptno column the dept table then it will set the value
Y other wise it will be N and all i have to do with the help of a single query.
expected result
name empno exists
xxx 33036 Y
YYY 2345 Y
ZZZ 678 Y
KKK 5678 N
RRR 7865 N
Please help.
Regards
RajatSELECT EMPNO, NAME , EMPNO , NVL( ( SELECT 'Y' FROM DEPT WHERE EMP.DEPTNO=DEPT.DEPTNO),'N') EXIST
FROM EMP
ORDER BY 1
Demo
SQL> WITH EMP AS(
2 SELECT 'XXX' NAME , 10 DEPTNO ,33036 EMPNO FROM DUAL UNION
3 SELECT 'YYY', 12, 2345 FROM DUAL UNION
4 SELECT 'ZZZ', 13 ,678 FROM DUAL UNION
5 SELECT 'KKK', 14 ,5678 FROM DUAL UNION
6 SELECT 'RRR', 15 ,7865 FROM DUAL ),
7 DEPT AS(
8 SELECT 10 DEPTNO,'AAA' DNAME FROM DUAL UNION
9 SELECT 11 ,'BBB' FROM DUAL UNION
10 SELECT 12 ,'CCC' FROM DUAL UNION
11 SELECT 13 ,'DDD'FROM DUAL )
12 SELECT EMPNO, NAME , EMPNO , NVL( ( SELECT 'Y' FROM DEPT WHERE EMP.DEPTNO=DEPT.DEPTNO),'N')
EXIST
13 FROM EMP
14 ORDER BY 1
15 /
EMPNO NAM EMPNO E
678 ZZZ 678 Y
2345 YYY 2345 Y
5678 KKK 5678 N
7865 RRR 7865 N
33036 XXX 33036 Y
SQL> Edited by: Salim Chelabi on Dec 7, 2008 4:15 AM -
I want to submit a concurrent program from pl/sql. Please help me.
Dear all,
I want to submit a concurrent program from pl/sql. But I failed. Please help me.
Detail:
I create a concurrent program in 'Cash Management, Vision Operations (USA)' responsibility. <strong>And it be submitted success in EBS</strong>.
Then
I create a test script in pl/sql. And use 'FND_GLOBAL.APPS_INITIALIZE' to initialize ebs, then use 'FND_REQUEST.SUBMIT_REQUEST' to submit
the consurrent program, But the procedure aways return <strong>0</strong>.
I cannot found the reason. Please help me.Thanks.
<em>Attached informations may describe the problem:
1.The concurrenct submitted success in EBS.</em>
request_id = 4750655 (Sorry, I dont know how to add pictures.)
<em>2.The initialize informations which from SQL</em>.
SELECT FCR.REQUESTED_BY USER_ID
,FCR.RESPONSIBILITY_ID
,FCR.RESPONSIBILITY_APPLICATION_ID
,FA.APPLICATION_SHORT_NAME
,FCP.CONCURRENT_PROGRAM_NAME
FROM FND_CONCURRENT_REQUESTS FCR
,FND_APPLICATION FA
,FND_CONCURRENT_PROGRAMS FCP
WHERE FCR.PROGRAM_APPLICATION_ID = FA.APPLICATION_ID
AND FCR.CONCURRENT_PROGRAM_ID = FCP.CONCURRENT_PROGRAM_ID
AND FCR.REQUEST_ID = 4750655;
Result: user_id = 1318;
responsibility_id = 50579;
application_id = 260;
application_short_name = 'CE';
program_short_name = 'CALLK009';
<em>3.The test script code.</em>
<p>
-- Created on 2008/10/22 by ERIC
declare
-- Local variables here
Wv_conc_req_id VARCHAR2(10) DEFAULT NULL;
BEGIN
FND_GLOBAL.APPS_INITIALIZE(
1318
,50579
,260
Wv_conc_req_id := FND_REQUEST.SUBMIT_REQUEST(
'CE'
,'CALLK009'
,NULL
,SYSDATE
,FALSE
, CHR(0), CHR(0), CHR(0), CHR(0), CHR(0)
, CHR(0), CHR(0), CHR(0), CHR(0), CHR(0)
, CHR(0), CHR(0), CHR(0), CHR(0), CHR(0)
, CHR(0), CHR(0), CHR(0), CHR(0), CHR(0)
, CHR(0), CHR(0), CHR(0), CHR(0), CHR(0)
, CHR(0), CHR(0), CHR(0), CHR(0), CHR(0)
, CHR(0), CHR(0), CHR(0), CHR(0), CHR(0)
, CHR(0), CHR(0), CHR(0), CHR(0), CHR(0)
, CHR(0), CHR(0), CHR(0), CHR(0), CHR(0)
, CHR(0), CHR(0), CHR(0), CHR(0), CHR(0)
, CHR(0), CHR(0), CHR(0), CHR(0), CHR(0)
, CHR(0), CHR(0), CHR(0), CHR(0), CHR(0)
, CHR(0), CHR(0), CHR(0), CHR(0), CHR(0)
, CHR(0), CHR(0), CHR(0), CHR(0), CHR(0)
, CHR(0), CHR(0), CHR(0), CHR(0), CHR(0)
, CHR(0), CHR(0), CHR(0), CHR(0), CHR(0)
, CHR(0), CHR(0), CHR(0), CHR(0), CHR(0)
, CHR(0), CHR(0), CHR(0), CHR(0), CHR(0)
, CHR(0), CHR(0), CHR(0), CHR(0), CHR(0)
, CHR(0), CHR(0), CHR(0), CHR(0), CHR(0)
DBMS_OUTPUT.PUT_LINE(Wv_conc_req_id);
COMMIT;
end;
<em>4.The concurrent program code.</em>
create or replace package body CALLTEST is
PROCEDURE T1(PvO_errbuf OUT VARCHAR2
,PvO_retcode OUT VARCHAR2)
IS
BEGIN
FND_FILE.PUT_LINE(fnd_file.log, 'TEST');
END;
end CALLTEST;
</p>Can you check from which schema you are executing FND_REQUEST? You can try as follows;
Connect to your required schema, create a synonym on apps.fnd_request, connect from apps and finally execute grant all on apps.fnd_request to all.
You can check for relevance from Doc ID: Note:147495.1
Please do keep in the mind the soultion above should be applied to a test/dev EBS instance first.
I hope this would be of help.
Saad -
SQL question - please help!
Hi,
I am working on a SQL, please help ms with the question
below .... thanks
(1)Increase by 10% salary of these captain pilots who have
traveled more than 800,000 miles.
Routes | | Flights | |Pilots |
| | | | |
#routeID | | #flightNO | |#pilotID |
depAirportID | | airplaneNO| |*name |
arrAirportID |_______/| pilotID |\___________|*hours_in_air|
length | \| routeID |/ |*grade |
______________| |_____________| |*salary |
|____________|If the length column in routes is in hours, and it represents
additional hours to those shown in hours_in_air in pilots, then
the following should work:
UPDATE pilots
SET salary = salary * 1.1
WHERE pilotid in (SELECT a.pilotid
FROM pilots a,
(SELECT b.pilotid,sum(c.length) new_hours
FROM flights b, routes c
WHERE b.routeid = c.routeid
GROUP BY b.pilotid) d
WHERE a.pilotid = d.pilotid and
new_hours + hours_in_air >= 80000)I suspect that you probably need to add additional criteria to
the sub-query from flights and routes to take into account only
flights since the hours_in_air column from pilots was last
updated. However, your table structures do not indicate any
date sensitivity. If the table flights is emptied every time
hours_in_air is updated, then the query above will work. -
Passing parameter to a SQL query - Please help
Hi All,
I am new to JDBC. I have been trying to pass an external variable to an SQL Query.
The query is
String username1="le";
PreparedStatement pstmt = null;
pstmt = c.prepareStatement("select * from users where USER_NAME like '%?%'");
pstmt.setString(1, username1);
pstmt.executeQuery();
ResultSet rs = pstmt.getResultSet();
I am trying to retrieve values from the users table where the USER_NAME column value that is a String contains the supplied value username1.
I am using the question mark (?) character to pass the value from the variable username1. I am also using the '%' substitution character which matches for any number of characters. So, the above query should retrieve rows where the USER_NAME is something like "charles","leander","Elena" etc.( that contains "le")
I am getting the error:
SQLException: java.sql.SQLException: ORA-01006: bind variable does not exist
I changed the query to
PreparedStatement pstmt = null;
pstmt = c.prepareStatement("select * from users where USER_NAME like '% " + username1 + "%'");
//pstmt.setString(1, username1);
pstmt.executeQuery();
This time , it is not giving the error and retrieving properly.
But I want to use the original query and use the "pstmt.setString(1, username1); " . Is there any way of achieving this?
Please help.
Cheers,
charles_amhi,
try this...
String username1="%le%";
pstmt = c.prepareStatement("select * from users where USER_NAME like ?")
pstmt.setString(1,username1);
cheers,
rpk -
Experts please help me.......
Hi,
i want to create table script in oracle as table name is in other database and i have to create same table with TEMP prefix in table name. So please help me.
For example :
Create table 'Temp_'||table_name as select * from users_table@database
But its not working....
Surenderthere are 1083 tables ,So for every table i have write a DDL.So please tell some other logic.
Write a dynmic sql to rename all the tables.
declare
msg varchar2(200);
begin
for s in (select table_name from user_tables order by table_name) loop
msg := 'rename '||s.table_name||' to '||s.table_name||'_TEMP';
-- dbms_output.put_line(msg);
execute immediate (msg);
end loop;
end;
Jaffar -
Hello Experts,
I have added key listener to frame and textfield. If I don't implement KeyEventDispatcher interface,
only event for textfield get notified and if I implement the interface, only event for frame get notified
I want both to work simultaniously. Is it possible? Please help me in this regard.
Here is my code :
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
class KeyTest extends JFrame implements KeyEventDispatcher
Container cont = getContentPane();
JTextField jt;
public KeyTest()
cont.setLayout(null);
setBounds(100,100,400,400);
jt = new JTextField();
jt.setBounds(100,100,200,20);
cont.add(jt);
jt.addKeyListener(new KeyAdapter()
public void keyPressed(KeyEvent ke)
System.out.println("Key pressed event of textfield....");
addKeyListener(new KeyAdapter()
public void keyPressed(KeyEvent ke)
System.out.println("Key pressed event of window....");
DefaultKeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventDispatcher(this);
public boolean dispatchKeyEvent(KeyEvent e)
processKeyEvent(e);
return true ;
public static void main(String[] args)
KeyTest kt = new KeyTest();
kt.show();
Regards,
Sachin Dare.My mistake - sorry. Not a cross-post.
-
Calling SQL experts to help write a query
Trying to find some help from some sql experts.
I was asked to help write a query showing each Dialed_Number, the associated Call_Type, and Script(s) in an ICM configuration.
All the data I’m looking for seems to be in the following tables:
Dialed_Number (DialedNumberString, EnterpriseName, DialedNumberID)
Call_Type (CallTypeID, EnterpriseName)
Dialed_Number_Map (DialedNumberID, CallTypeID)
Call_Type_Map (CallTypeID, MasterScriptID)
Master_Script (MasterScriptID, EnterpriseName)
Thus far, my query looks like this:
SELECT distinct Dialed_Number.DialedNumberString, Dialed_Number.EnterpriseName AS DN_Name, Call_Type.EnterpriseName AS Call_Type_Name,
Master_Script.EnterpriseName AS ScriptName
FROM Call_Type_Map CROSS JOIN
Call_Type CROSS JOIN
Dialed_Number CROSS JOIN
Dialed_Number_Map CROSS JOIN
Master_Script
However, it’s returning every possible combination (it was 10x worse before adding the word ‘distinct’)
Ideally, I’d like the results to just show one row for each Dialed_Number (assumes 1:1 ratio of DN to CallType).
e.g.:
DN_Name DialedNumberString CallType_Name ScriptName
Can anyone offer any guidance or suggestion?Thanks Geoff,
I'd put this out on a couple different channels, and while yours is pretty good (I did remove the RoutingClientID from the where clause), I got another version that works just as well, and also includes DNs without CallTypes, and those which may have a CallType, but no script.
SELECT dn.DialedNumberString, dn.EnterpriseName AS Dialed_Number_Name, ct.EnterpriseName AS Call_Type_Name, ms.EnterpriseName AS Script_Name
FROM Dialed_Number dn
LEFT OUTER JOIN Dialed_Number_Map dnm ON dn.DialedNumberID = dnm.DialedNumberID
LEFT OUTER JOIN Call_Type ct ON dnm.CallTypeID = ct.CallTypeID
LEFT OUTER JOIN Call_Type_Map ctm ON ct.CallTypeID = ctm.CallTypeID
LEFT OUTER JOIN Master_Script ms ON ctm.MasterScriptID = ms.MasterScriptID
I believe the "joins" are supposedly more efficient, too.
Thanks for your contribution! -
Hello,
i bought a blackberry 9220 after a week it broke.. i usually put it in my pocket. one time i want to check my bbm's but somehow i can't turn it on, i tried charging it but it only shows a battery with a red "X" mark on it.. i tried charging it for hours but no use, i used my friends battery no use, my friend used my battery but it worked.. can someone please help me with my problem ASAP! thank you!Hi gerardedwards4
Welcome to BlackBerry Support Forums
I am not the Expert Our expert will look into your post , but for the time can you tell what happen when you connect your device to a PC ? Do you hear any sound for anything !
let us know.
Click " Like " if you want to Thank someone.
If Problem Resolves mark the post(s) as " Solution ", so that other can make use of it. -
NO Sound; experts please help
I currently have no sound on my HP Spectre XT Ultrabook PC!!! Upon buying the laptop it had Beats audio on the laptop. That stopped working recently, but I still had the normal reduced audio, until that stopped completely soon after. I have tried multiple things to fix this problem, all without success; I tried troubleshooting the problem, I tried updating the audio driver (it said I already had the most current version), I tried uninstalling and reinstalling the driver, I tried updating the BIOS on my computer and NONE of these have worked; I still have no sound! Please help to fix this problem!
The product number is B6V42PA#ABG and it currently has Windows 7 Home Premium installed on it!Hi
Please try doing a system restore to the date where unit was working fine. In case this does not work last option is to run a recovery please back up your data. This does not work please call HP technical support & get the Speaker replaced.
Let us know how it goes!
"I work for HP."
****Click the (purple thumbs up icon in the lower right corner of a post) to say thanks****
****Please mark Accept As Solution if it solves your problem****
Regards
Manjunath -
Is this BUG or Feature of APEX 4.0.1 - Any expert please help to answer
Try this to stimulate the BUG or Feature
- Development -
1. Create Basic Master Detail with tabular form
2. Create a basic LOV and display NULL -> RETURN NULL
- Run -
1. Run the Page click "ADD ROW"
2. Do not enter any data into the tabular
3. Click on Apply Changes
Apex smart enough to know user do not want to add anything very nice....
now... observe this
- Development -
1. Modify the LOV, remove the display NULL, so it will show first value of the LOV
- Run -
1. Run the Page click "ADD ROW"
2. Do not enter any data into the tabular
3. Click on Apply Changes
Apex don't bother to test all validations straight to GIGO and end user see those ORA-.
I have a page that the tabular form has a default value (not LOV but default value) the validation is not working, GIGO....
Any expert please explain is this suppose how Apex work? or do we need to handle those default value.
I try to debug the page with good one and bad one, I think I still have a lot to learn I don't understand the debug message. I guess is something about Branching....
SiereHi,
Unfortunately there isn't really much that could be done to work around this issue in 4.0.x. The validation logic treats these new rows as not having been touched by the user, hence they are ignored. But the DML (update/insert) logic thinks the data did change due to that default value, and thus attempts an insert for the new row. There might be a way to trick APEX into doing the right thing with some JavaScript, but I would advice against that, considering that this might break after a future upgrade.
Regards,
Marc -
Table1
QTE_ID SEQ_NO
1435177 2
1435177 5
1435177 7
1435177 8
1435177 12
1435177 14
Table2
QTE_ID SEQ_NO CMMT_CURR_AMT
1435177 1 98500
1435177 2 98500
1435177 3 0
1435177 4 98500
1435177 5 98500
1435177 7 98500
1435177 8 98500
1435177 11 59300
1435177 12 59300
1435177 14 59300
The result should be
QTE_ID SEQ_NO CMMT_CURR_AMT
1435177 2 0 (where 0 = cmmt_curr_amt of seq 2 - cmmt_curr_amt of seq 1 from table 2)
1435177 5 0 (where 0 = cmmt_curr_amt of seq 5 - cmmt_curr_amt of seq 4 from table 2)
1435177 7 0 (where 0 = cmmt_curr_amt of seq 7 - cmmt_curr_amt of seq 5 from table 2)
1435177 8 0 (where 0 = cmmt_curr_amt of seq 8 - cmmt_curr_amt of seq 7 from table 2)
1435177 12 0 (where 0 = cmmt_curr_amt of seq 12 - cmmt_curr_amt of seq 11 from table 2)
1435177 14 0 (where 0 = cmmt_curr_amt of seq 14 - cmmt_curr_amt of seq 12 from table 2)
I have to get the difference of cmmt_curr_amt from the table2 from seq 14 to seq 12 for seq14 in table 1.
Please help me in writing the query.
Thanks in advance.
SrinivasWITH table1 AS
(SELECT 1435177 qte_id, 2 seq_no
FROM dual
UNION ALL
SELECT 1435177 qte_id, 5 seq_no
FROM dual
UNION ALL
SELECT 1435177 qte_id, 7 seq_no
FROM dual
UNION ALL
SELECT 1435177 qte_id, 8 seq_no
FROM dual
UNION ALL
SELECT 1435177 qte_id, 12 seq_no
FROM dual
UNION ALL
SELECT 1435177 qte_id, 14 seq_no
FROM dual
table2 AS
SELECT 1435177 qte_id, 1 seq_no, 98500 cmmt_curr_amt
FROM dual
UNION ALL
SELECT 1435177 qte_id, 2 seq_no, 98500 cmmt_curr_amt
FROM dual
UNION ALL
SELECT 1435177 qte_id, 3 seq_no, 0 cmmt_curr_amt
FROM dual
UNION ALL
SELECT 1435177 qte_id, 4 seq_no, 98500 cmmt_curr_amt
FROM dual
UNION ALL
SELECT 1435177 qte_id, 5 seq_no, 98500 cmmt_curr_amt
FROM dual
UNION ALL
SELECT 1435177 qte_id, 7 seq_no, 98500 cmmt_curr_amt
FROM dual
UNION ALL
SELECT 1435177 qte_id, 8 seq_no, 98500 cmmt_curr_amt
FROM dual
UNION ALL
SELECT 1435177 qte_id, 11 seq_no, 59300 cmmt_curr_amt
FROM dual
UNION ALL
SELECT 1435177 qte_id, 12 seq_no, 59300 cmmt_curr_amt
FROM dual
UNION ALL
SELECT 1435177 qte_id, 14 seq_no, 59300 cmmt_curr_amt
FROM dual
SELECT qte_id, t2_seq_no, cmmt_curr_amt - cmmt_curr_lag diff
FROM
(SELECT t2.qte_id, t2.seq_no t2_seq_no, t1.seq_no t1_seq_no, cmmt_curr_amt, LAG(cmmt_curr_amt,1,0) OVER (PARTITION BY t2.qte_id ORDER BY t2.seq_no) cmmt_curr_lag
FROM table1 t1, table2 t2
WHERE t2.qte_id = t1.qte_id (+)
AND t2.seq_no = t1.seq_no(+)
ORDER BY 1,2
WHERE t1_seq_no IS NOT NULL
ORDER BY 1,2
QTE_ID T2_SEQ_NO DIFF
1435177 2 0
1435177 5 0
1435177 7 0
1435177 8 0
1435177 12 0
1435177 14 0
Maybe you are looking for
-
Seeking help and advice ... My project has a high traffic load where image uploading is a key feature for our users. We process images that the user has either resized already, or that came directly off a camera in the camera's image format and size.
-
Hi, what is business content cube for GL line items? is there is any corresponding cube for data source 0FI_GL_4 or its just ODS and we have to develop custom cube. Thank you, sam
-
OBIEE 11g level based hierarchy
Hi everyone, here is my problem in brief I made a level based hierarchy for Products, and I need to show the product name beside the product code in the last level in the hierarchy, the steps i made to reach this is as follows: 1- making the name and
-
How to set users level security profiles and auditing?
hi, We are using EBS 12( 12.0.6 ) with database 10g (10.2.0.3) on Linux redhat 4. I want to set the all user level and site level security profiles like user login attempts, password attempts, case sensitivity, and all these infos and attempts should
-
Creating Photo Collages with Automator
Hi. I'd like to use automator to create a photo collage from a set of pictures. Let's say I have four pictures, each of varying dimensions. They're named sequentially in the order I'd like them to appear. I'd like an automator script that would take