Calculate % using crosstab rows
Hi,
I have a crosstab in my report header just like below. (Group by Country, then by state). I would like to display this as the summary of entire report.
Country 2007 2008 2009
State
Total Issued 100 200 300
Accepted 20 30 40
% accepted 20% 15% 40/300
That is, I want to calculate '% of accepted based on the row values 'Total Issued' and 'Accepted' not based on summary.
I tried couple of ways, it is not calculating properly. any help, really appreciated
Hi,
I have a crosstab in my report header just like below. (Group by Country, then by state). I would like to display this as the summary of entire report.
Country 2007 2008 2009
State
Total Issued 100 200 300
Accepted 20 30 40
% accepted 20% 15% 40/300
That is, I want to calculate '% of accepted based on the row values 'Total Issued' and 'Accepted' not based on summary.
I tried couple of ways, it is not calculating properly. any help, really appreciated
Similar Messages
-
Calculate using previous column and rows
Hello TNO members,
I have a complicated problem I need to solve, how ever I am missing knowledge about calculating using previous rows and columns in current select.
Test data
with t as (
select 1 as box, 1 as box_group, 10 as max_qty from dual union all
select 2, 1, 15 from dual union all
select 3, 1, 40 from dual union all
select 4, 1, 45 from dual union all
select 5, 2, 15 from dual union all
select 6, 2, 20 from dual union all
select 7, 2, 20 from dual union all
select 8, 3, 20 from dual)Expected Output result
box box_group max_qty assigned_from_60
1 1 10 10
2 1 15 15
3 1 40 17
4 1 45 18
5 2 15 0
6 2 20 0
7 2 20 0
8 3 20 0The problem:
In total 60 items are shared among the boxes in the same group, ordered by the lowest max_qty.
10 items can be assign to each box in group 1. (Used items: 40)
The remaining 20 items will be assigned to the other boxes in group 1.
5 more items can be assign to each box in group 1 (Used items: 15)
The remaining 15 items will be assigned to the remaining boxes in group 1.
2 more items can be assign to each box in group 1 (used items: 4)
One item remains. When items cannot be shared equally among the remaining boxes, ordered by the highest max_quantity, assign +1 till no item remains.
My solution in steps:
1. Calculate max_qty difference. How can I calculate the difference between the max_qty from box 1 and 2? Tricky is not to calculate the difference between different groups.
This means output result should be something like
box box_group max_qty qty_dif
1 1 10 10
2 1 15 5
3 1 40 25
4 1 45 5
5 2 15 15
6 2 20 5
7 2 20 0
8 3 20 202. Remaining boxes in the same group. I want to know how many boxes are in the same group. Especially the remaining boxes when the current max_quantity is filled.
Using the following code does not result in the correct output, what is wrong or missing here?
count(*) over(partition by box_group order by max_qty asc range between current row and unbounded following) This means output result should be something like
box box_group max_qty qty_dif rem_boxes
1 1 10 10 4
2 1 15 5 3
3 1 40 25 2
4 1 45 5 1
5 2 15 15 3
6 2 20 5 2
7 2 20 0 1
8 3 20 20 13. Calculate costs. This one is faily easy rem_boxes * qty_dif (*per row*)
This means output result should be something like
box box_group max_qty qty_dif rem_boxes cost
1 1 10 10 4 40
2 1 15 5 3 15
3 1 40 25 2 50
4 1 45 5 1 5
5 2 15 15 3 45
6 2 20 5 2 10
7 2 20 0 1 0
8 3 20 20 1 204. Calculate rem_items. 60 - (rem_boxes * qty_dif of box 1) - (rem_boxes * qty_dif of box 2) - (rem_boxes * qty_dif
of box n). How can I calculate using results of previous rows? (*all, not per group*)
This means output result should be something like
box box_group max_qty qty_dif rem_boxes cost rem_items
1 1 10 10 4 40 20
2 1 15 5 3 15 5
3 1 40 25 2 50 -45
4 1 45 5 1 5 -50
5 2 15 15 3 45 -95
6 2 20 5 2 10 -105
7 2 20 0 1 0 -105
8 3 20 20 1 20 -1255. Assign full quantity. For each row check if rem_items > 0 then 1 else 0
This means output result should be something like
box box_group max_qty qty_dif rem_boxes cost rem_items assign
1 1 10 10 4 40 20 1
2 1 15 5 3 15 5 1
3 1 40 25 2 50 -45 0
4 1 45 5 1 5 -50 0
5 2 15 15 3 45 -95 0
6 2 20 5 2 10 -105 0
7 2 20 0 1 0 -105 0
8 3 20 20 1 20 -125 06. Calculate assign quantity attemp 1. Calculate assign quantity of remaining boxes per group
When assign = 1 then max_qty else pervious a_qty (*within same group*)
This means output result should be something like
box box_group max_qty qty_dif rem_boxes cost rem_items assign a_qty
1 1 10 10 4 40 20 1 10
2 1 15 5 3 15 5 1 15
3 1 40 25 2 50 -45 0 15
4 1 45 5 1 5 -50 0 15
5 2 15 15 3 45 -95 0 0
6 2 20 5 2 10 -105 0 0
7 2 20 0 1 0 -105 0 0
8 3 20 20 1 20 -125 0 0How to solve the rest, I do not know yet. Any other suggestion to solve this problem, is welcome.
Since I'm not really a professional this is what I tried till now
with z as (
select 1 as box, 1 as box_group, 10 as max_qty from dual union all
select 2, 1, 15 from dual union all
select 3, 1, 40 from dual union all
select 4, 1, 45 from dual union all
select 5, 2, 15 from dual union all
select 6, 2, 20 from dual union all
select 7, 2, 20 from dual union all
select 8, 3, 20 from dual)
select u.*,
case
when u.assign = 2 then u.max_qty
when u.assign = 1 then 0
when u.assign = 0 then 0
end as assigned_qty
from
select v.*,
case
when 60 - sum(v.max_qty) over (order by v.box_group, v.max_qty, v.box) >= 0
and v.rem_items_before >= 0 then 2
when 60 - sum(v.max_qty) over (order by v.box_group, v.max_qty, v.box) < 0
and v.rem_items_before > 0 then 1 else 0
end as assign
from
select w.*,
w.rem_items_after + w.max_qty as rem_items_before
from
select x.*,
60 - x.qty_assigned as rem_items_after
from
select y.*,
y.max_qty * y.rem_boxes as total_cost,
sum(y.max_qty) over (order by y.box_group, y.max_qty, y.box) as qty_assigned
from
select z.*,
count(*) over (partition by z.box_group order by z.max_qty, z.box asc range between current row and unbounded following) as rem_boxes
from z
) y
) x
) w
) v
) uKind regards,
Metro
Edited by: 858378 on 30-mei-2011 4:39
Edited by: 858378 on 30-mei-2011 5:05Hi, Metro,
858378 wrote:
Hello, thanks for your help so far.
The course I am in, teaches you how to use the basic pl sql language such are selecting from tables.Is it about PL/SQL or SQL?
I have learned things about
- SELECT
- FROM
- WHERE
- GROUP BY
- ORDER BY
- SUB SELECTION IN SELECT
- SUB SELECTION IN FROM
- SUM, COUNT, MIN, MAX
- CASES
- INNER, OUTER, LEFT, FULL, CROSS JOINSAll of these are parts of the SQL language, not PL/SQL.
We are now at partitioning.Are you specifically at partitioning, or iare you at a point where the book talks about analytic functions, which sometimes, but not always, have a PARTTION BY clause?
It's written in Dutch, I tried to translate it, so it might not be well written English.
Excercise 192
Distribution center 'One by one' wants to automate the distribution process.
Items are distributed to the boxes one by one. Sorry, I can't figure out what Exercise 192 is, based on just that.
It is similar to the next excercise, but this above was a lot more straight to the point.
*Excercise 193*
Distribution center 'All in one box' wants to automate the distribution process.
One of the major changes in this process is to distribute items equally to all boxes in the same group.
This means starting from the lowest quantity, assign the lowest quantity to all boxes in the same group if possible.
If this is not possible distribute the amount of items divided by the number of boxes in the same group. If the amount of items per box is lower than 1 and not 0.
Divide the remaining items per box ordered by the box with the highest quantity, till there are no items left.
When it is possible to distribute the lowest quantity to all boxes, move up to the next box in the same group.
When all boxes in the same group are filled to their maximum quantity, move up to the next group and repeat this process. ...
So Exercise 193 is what you asked yesterday, right?
A) Order the following information by box_group and max_qty as described.
B) Calculate the distribution results for 60, 120, 170 items.
When I have 60 items, the following output result should be
box box_group max_qty assigned_from_60
1 1 10 10
2 1 15 15
3 1 40 17
4 1 45 18
5 2 15 0
6 2 20 0
7 2 20 0
8 3 20 0Box 1 and 2 can be filled completely as you can fill atleast 10 to box 1,2,3,4 and an additional 5 to box 2, 3 and 4.
The last item goes to the box 4.
when I have 120 items
box box_group max_qty assigned_from_120
1 1 10 10
2 1 15 15
3 1 40 40
4 1 45 45
5 2 15 3
6 2 20 3
7 2 20 4
8 3 20 0
Based on what you posted, it seems like the following should be equally acceptable:
box box_group max_qty assigned_from_120
1 1 10 10
2 1 15 15
3 1 40 40
4 1 45 45
5 2 15 3
6 2 20 4
7 2 20 3
8 3 20 0That is, the last 10 items have to be distributed among the 3 boxes in box_group=2 as equally as possible. So one box will get 4 items and the others will get 3. The extra item will go to the box with the highest max_qty, but in this case, there is a tie: box 6 has just as much of a claim to having the highest max_qty as box 7. The line marked "***** Add if needed *****" in the query blow guarantees that, in case of a tie like this, the box with the higher box value will be considered "larger" than another box with the same max_qty.
when I have 170 items
box box_group max_qty assigned_from_170
1 1 10 10
2 1 15 15
3 1 40 40
4 1 45 45
5 2 15 15
6 2 20 20
7 2 20 20
8 3 20 5
I accidentally posted the wrong query yesterday. This is what I should have posted:
WITH cntr AS
SELECT LEVEL AS n
FROM ( SELECT MAX (max_qty) AS max_max_qty
FROM z
-- WHERE box_group = :target_box_group -- ***** Removed *****
CONNECT BY LEVEL <= max_max_qty
, got_r_num AS
SELECT z.box
, c.n
, ROW_NUMBER () OVER ( ORDER BY box_group -- ***** Added *****
, c.n
, z.max_qty DESC
, box DESC -- ***** Add if needed *****
) AS r_num
FROM cntr c
JOIN z ON c.n <= z.max_qty
-- WHERE z.box_group = :target_box_group -- ***** Removed *****
, got_assigned AS
SELECT box
, COUNT (*) AS assigned
FROM got_r_num
WHERE r_num <= :total_items
GROUP BY box
SELECT z.*, NVL (a.assigned, 0) AS assigned
FROM z
LEFT OUTER JOIN got_assigned a ON z.box = a.box
ORDER BY z.box_group
, z.max_qty
;Yesterday, I described how you need to remove 2 lines and add 1, but the code I posted was the unchanged query. The query above is what I should have posted then. Look for comments beginning "*****" above for the changes. I apologize for my mistake.
This query gets the results you posted for all 3 values of :total_items that you posted. If it doesn't work for some other value, or some other data, post the new values and the correct results you want from them, and point out where the query above is wrong.
C) Sum the maximum quantities per group
D) Get the amount of boxes in each group
E) Create a column for remaining boxes per group
F) For each distinct quantity, count the amount of boxes with this quantity
G) Calculate how many items are required to fill all boxes in the same group
H) Create a plan how to solve this distribution problem described in the introduction?
I) Solve this problem using your plan.Are these the steps that the book suggests using?
I don't understand that approach. It might be a good way to solve the problem without using a computer. It might be a good way to solve the problem using a procedural language, such as PL/SQL. It might be one way of solving the problem in SQL, but I think it will be more complicated and less efficient than what I psoted.
The approach above is iterative; that is, you repeat certain steps, with different values. For example, you distribute a certain number of items to all boxes in a box_group. The you remove the smallest box(es) from the group, and repeat, distributing the remaining items among the remianing boxes. That's not hard to do in a language like PL/SQL, where you have loops and variables. In SQL, the closest thing to that is the MODEL clause. I'm sure you could write a MODEL solution to this problem, but, if your book hasn't mentioned MODEL yet, then that's certainly not what it's expecting you to do.
Even using the approach in steps A) trhough G) above, I don't see how a PARTITION BY would help. -
Localization of CrossTab row and column label Crystal Report RPT file
Dear all,
Does anyone know how to support multiple locale texts (English and French) in CrossTab Row and Column Header labels and grand total labels? Is there a way to parameterize text objects CrossTab in one single Crystal Report RPT file to use some sort of locale resource file containing text string for different languages based on the users of RPT at runtime? The idea is to use one single RPT file to generate report for different locale text for CrossTab Row and Column abels and grand total labels instead of creating RPT files per locale?Hi,
Does the database have a column that identifies the language? If it does, then you could create two separate cross-tabs and place them in different sections and conditionally suppress the section depending on the language from the database.
That's the only thing that can be done in my opinion.
-Abhilash -
Calculate profit at row level in Discoverer Plus
HI,
I need to calculate profit at row level in Discoverer Plus as follows.
There are columns
1) Account Name- Contains Expense and revenue account names
2) Account type- Contains Identifier for account (E or R)
3) Amount --- Contains amount
4) Period Name -- Contains Numeric Amount.
Cross Tabular Report Look like as follows
Period Name Feb-2009 Mar-2009
Account Name
Total Revenue 100 90
Total Labor Cost 30 30
Total G&A Cost 20 50
Profit ??? ??
Need to show PROFIT =Total Revenue- (Total Labor Cost- Total G&A Cost)
at bottom for each period.
I am unable to use calculations because it appears column wise…
Would you please suggest solution for this?
Thanks,
Mahesh.Hi
Try dragging the data point headings off the top axis and place them to the right of the Account Name. They will all drag together so just moving one will move them all.
If your profit is already calculated and is a data point as you have commented then it too will come over to the left. For displaying it under the other items, a really cool feature about having data points on the left is that you can drag their heading and place it anywhere you want. I will be including this trick in my free March ask Michael webinar. (By the way, if anyone reading this thread you can sign up for my free webinar by clicking here: http://ascbi.com/question.htm)
You should now be able to display your calculated profit as a row underneath the other items. I tried this on my own system and it worked just fine.
Best wishes
Michael -
Hyperlink to Crosstab Row to Subreport, get parameter frm Rowvalue
hi every one
i am facing very tricky problem, I am trying from past 1 week
i have to show the summery of records in two levels using CROSSTAB
two cross tab has to be displayed at "DrillDownGroupLevel =0"
when i click on group headers of Report has to display detail Records(getting by placing Subreports in Group footer) .
so I am getting Detail Record for two cross tabs
Till then it works fine
Problem
2nd Crosstab in Group level 2 has
row( database field)
summery(count of the rec)
Column(days of the month like 1,2,3.... soon till date)
when 2nd crosstab shows the row( database field) (rows can be more then one, filled dynamically based on distinct filed values )
want to click in the row value(like hyper link to row value) then it should drill down/open_another_subreport to display Detail records
if I can provide the hyperlink at Rowvalue(crosstabu2019s) to open the Subreport(another report object), my problem would solve.
Thanks in advancePlease re-post if this is still an issue or purchase a case and have a dedicated support engineer work with you directly:
http://store.businessobjects.com/store/bobjamer/DisplayProductByTypePage&parentCategoryID=&categoryID=11522300?resid=-Z5tUwoHAiwAAA8@NLgAAAAS&rests=1254701640551 -
Can I use Front Row with my Macbook closed?
I just got a mini-dvi to video cable for my macbook. I love using front row with it but I was wondering if there was a way that you could use front row with the laptop closed. Oh and I'm using tiger, so its not the new version of front row.
With your computer attached to a keyboard you should be able to wake it from sleep and run it properly with the lid closed.
-
How can i use multiple row subquery in update statement
Hai All
I using group function in my update statement.. and i need to update more rows so i need to use multiple row
subquery pls tell me how to use multiple row subquery in update statement
For example
while i am using this like this i got an error
update dail_att set outtime in (select max(r2.ptime) from temp_att where empcode=r2.enpno and
barcode=r2.cardn and attend_date=r2.pdate group by enpno,pdate,cardn);
Pls tell me how to use with example
Thanks & regards
Srikkanth.MHai Man
Thanks for ur response Let me clear what i need
First step Fetch the records as text file and stores into table T1
and the next step is i have seperated the text using substring and stores in different columns of a table
There are two shifts 0815 to 1645 and 1200 and 2000
Here I rep IN and O rep OUT
Empno date time inout
001 01-01-10 0815 I
002 01-01-10 0815 I
003 01-01-10 0818 I
001 01-01-10 1100 0
001 01-01-10 1130 I
002 01-01-10 1145 0
002 01-01-10 1215 I
004 01-01-10 1200 I
005 01-01-10 1215 I
004 01-01-10 1315 O
004 01-01-10 1345 I
001 01-01-10 1645 0
002 01-01-10 1715 0
003 01-01-10 1718 0
004 01-01-10 2010 0
005 01-01-10 2015 0
This is my T1 table i have taken data from text file and stored in this table from this table i need to move data to another table T2
T2 contains like this
Empno Intime Intrin Introut Outtime Date
001 0815 1100 1130 1645 01-01-10
002 0815 1145 1215 1715 01-01-10
003 0818 1718 01-01-10
004 1200 1315 1345 2010 01-01-10
005 1215 2015 01-01-10
This what i am trying to do man but i have little bit problems Pls give some solution with good example
And my coding is
declare
emp_code varchar2(25);
in_time varchar2(25);
out_time varchar2(25);
Cursor P1 is
Select REASON,ECODE,READMODE,EMPD,ENPNO,FILL,PDATE,PTIME,INOUT,CARDN,READERN
From temp_att
group by REASON,ECODE,READMODE,EMPD,ENPNO,FILL,PDATE,PTIME,INOUT,CARDN,READERN
ORDER BY enpno,pdate,ptime;
begin
for r2 in p1 loop
declare
bar_code varchar2(25);
begin
select barcode into bar_code from dail_att where empcode=r2.enpno and attend_date=r2.pdate;
For r3 in (select empcode,empname,barcode,intime,intrin,introut,addin,addout,outtime,attend_date from dail_att)loop
if r2.inout ='O' then
update dail_att set outtime =(select max(r2.ptime) from temp_att where empcode=r2.enpno and barcode=r2.cardn and attend_date=r2.pdate group by r2.cardn,r2.enpno,r2.pdate );
end if;
end loop;
exception
when no_data_found then
if r2.inout ='I' then
insert into dail_att(barcode,empcode,intime,attend_date)(select r2.cardn,r2.enpno,min(r2.ptime),r2.pdate from temp_att group by r2.cardn,r2.enpno,r2.pdate );
end if;
end;
end loop;
commit;
end;
Pls tell me what correction i need to do i the update statement i have used a subquery with group function but when i used it will return only one row but my need is to return many rows and i need to use multiple row subquery
and how can i use it in the update statement
Thanks In Advance
Srikkanth.M -
How can I use multiple row insert or update into DB in JSP?
Hi all,
pls help for my question.
"How can I use multiple rows insert or update into DB in JSP?"
I mean I will insert or update the multiple records like grid component. All the data I enter will go into the DB.
With thanks,That isn't true. Different SQL databases have
different capabilities and use different syntax, That's true - every database has its own quirks and extensions. No disagreement there. But they all follow ANSI SQL for CRUD operations. Since the OP said they wanted to do INSERTs and UPDATEs in batches, I assumed that ANSI SQL was sufficient.
I'd argue that it's best to use ANSI SQL as much as possible, especially if you want your JDBC code to be portable between databases.
and there are also a lot of different ways of talking to
SQL databases that are possible in JSP, from using
plain old java.sql.* in scriptlets to using the
jstlsql taglib. I've done maintenance on both, and
they are as different as night and day.Right, because you don't maintain JSP and Java classes the same way. No news there. Both java.sql and JSTL sql taglib are both based on SQL and JDBC. Same difference, except that one uses tags and the other doesn't. Both are Java JDBC code in the end.
Well, sure. As long as you only want to update rows
with the same value in column 2. I had the impression
he wanted to update a whole table. If he only meant
update all rows with the same value in a given column
with the same value, that's trivial. All updates do
that. But as far as I know there's know way to update
more than one row where the values are different.I used this as an example to demonstrate that it's possible to UPDATE more than one row at a time. If I have 1,000 rows, and each one is a separate UPDATE statement that's unique from all the others, I guess I'd have to write 1,000 UPDATE statements. It's possible to have them all either succeed or fail as a single unit of work. I'm pointing out transaction, because they weren't coming up in the discussion.
Unless you're using MySQL, for instance. I only have
experience with MySQL and M$ SQL Server, so I don't
know what PostgreSQL, Oracle, Sybase, DB2 and all the
rest are capable of, but I know for sure that MySQL
can insert multiple rows while SQL Server can't (or at
least I've never seen the syntax for doing it if it
does).Right, but this syntax seems to be specific to MySQL The moment you use it, you're locked into MySQL. There are other ways to accomplish the same thing with ANSI SQL.
Don't assume that all SQL databases are the same.
They're not, and it can really screw you up badly if
you assume you can deploy a project you've developed
with one database in an environment where you have to
use a different one. Even different versions of the
same database can have huge differences. I recommend
you get a copy of the O'Reilly book, SQL in a
Nutshell. It covers the most common DBMSes and does a
good job of pointing out the differences.Yes, I understand that.
It's funny that you're telling me not to assume that all SQL databases are the same. You're the one who's proposing that the OP use a MySQL-specific extension.
I haven't looked at the MySQL docs to find out how the syntax you're suggesting works. What if one value set INSERT succeeds and the next one fails? Does MySQL roll back the successful INSERT? Is the unit of work under the JDBC driver's control with autoCommit?
The OP is free to follow your suggestion. I'm pointing out that there are transactions for units of work and ANSI SQL ways to accomplish the same thing. -
How to calculate number of rows for perticular characterstic in SAP BI Bex
Hi experts,
Please let me know how to calculate ' number of rows ' for perticular characterstic in Bex query.
Thanks & Regards,
Babu..Hello,
You can try this
Create a CKF and assign the vale 1 to it. Open the query and select Character where you want to display ' number of rows ', go to properties windows, select 'display', in the results row drop down box, select 'always display'.
Thanks.
With regards,
Anand Kumar -
How to get all rows in table to red using alternate rows properties option
How to get all rows in table to red using alternate rows properties option
Hi Khrisna,
You can get all rows red by selecting the color red in the "Color" and "frequency" to 1 under the "Alternate Row/Column colors".
I tried doing it and the colors freaked me out (all red) :-D
Kindly tell me if im missing something.
Regards,
John Vincent -
Unable to set default date for Date Picker item using Auto Row Processing
Okay, I have searched through the forum for an answer, and have not found a thing to account for my problem.
First, does anyone know if using Auto Row Processing has problems updating an item/field in a record where the Source is defined as Database Column if the 'Display As' is defined as 'Date Picker (MM/DD/YYYY)'?
I ask this only because I found out the hard way that Auto Row Processing does NOT fetch the value for an item where the field is defined as TIMESTAMP in the database.
My problem is as follows: I have a form that will CREATE a new record, allowing the user to select dates from Date Pickers, text from Select Lists, and entering in text into a Textarea item. The information is saved using a standard (created through the Auto Row Processing wizared) CREATE page level button. After the record is created the user is able to go into it and update the information. At that time, or later, they will click on one of two buttons, 'ACCEPT' or 'DECLINE'. These are Item level buttons, which set the REQUEST value to 'APPLY' (Accept) and 'UPDATE' (Decline). The Accept button executes a Process that changes the Status Code from 'Initiated' to 'Accepted', and sets the Declined_Accepted_Date to SYSDATE, then another Process SAVEs the record. The Declined button runs a Process that changes the Status Code from 'Initiated' to 'Declined', and sets the Declined_Accepted_Date to SYSDATE, then another Process SAVEs the record.
However, even though the Status Code field is updated in the database record in both Accepted and Declined processing, the Declined_Accepted_Date field remains NULL in the database record (by looking at the records via SQL Developer). WHY??? I looked at the Session State values for both the Status Code and the Declined_Accepted_Date fields and saw that the fields (items) had the expected values after the process that SAVEs the record.
The following is the code from the Accept button Page Process Source/Process:
BEGIN
:P205_STATUS_CD := 'A';
:P205_REF_DECLINE_ACCEPT_DT := SYSDATE;
END;
As can be seen, the Status Code and Declined_Accepted_Date items are set one right after the other.
As an aside, just what is the difference between Temporary Session State vs Permanent Session State? And what is the sequence of events to differentiate the two?Here's yet another thing that I just looked into, further information...
One other difference between the date field I am having problems with (Accepted_Declined_Date), and other dates (with Date Pickers) in the record is that the Accepted_Declined_Date never gets displayed until after it is set with a default date when the Accept and Decline buttons are pressed.
One of the other dates that works, the Received Date, is able to write a default date to the record that is never typed into the box or selected from the calendar. That date is placed into the box via a Post Calculation Computation in the Source, which I set up as: NVL(:P205_REF_RECEIVED_DT,TO_CHAR(SYSDATE,'MM/DD/YYYY'))
However, I do remember actually trying this also with the Accepted_Declined_Date, and setting the Post Calculation Computation did not work for the Accept_Decline_Date. Could this be because the Accept_Decline_Date is never rendered until the Status Code is set to Declined (in other words, there is no need to display the date and allow the user to change it until the record is actually declined)???
The control of the displaying (rendering) of the date is set via the Conditions / Condition Type: Value of Item in Expression 1 = Expression 2
Expression 1 = P205_STATUS_CD and Expression 2 = L
Does this shed any light??? -
ORA-01403: no data found Problem when using AUTOMATIC ROW FETCH to populate
ORA-01403: no data found Problem when using AUTOMATIC ROW FETCH to populate a form.
1) Created a FORM on EMP using the wizards. This creates an AUTOMATIC ROW FETCH
TABLE NAME - EMP
Item Containing PRIMARY KEY - P2099_EMPNO
Primary key column - EMPNO
By default the automatic fetch has a ‘Process Error Message’ of ‘Unable to fetch row.’
2) Created a HTML region. Within this region add
text item P2099_FIND_EMPNO
Button GET_EMP to submit
Branch Modified the conditional branch created during button creation to set P2099_EMPNO with &P2099_FIND_EMPNO.
If I then run the page, enter an existing employee number into P2099_EMPNO and press the GET_EMP button the form is populated correctly. But if I enter an employee that does not exist then I get the oracle error ORA-01403: no data found and no form displayed but a message at the top of the page ‘Action Processed’.I was expecting a blank form to be displayed with the message ‘Unable to fetch row.’
I can work around this by making the automated fetch conditional so that it checks the row exists first. Modify the Fetch row from EMP automated fetch so that it is conditional
EXIST (SQL query returns at least one row)
select 'x'
from EMP
where EMPNO = :P2099_EMPNO
But this means that when the employee exists I must be fetching from the DB twice, once for the condition and then again for the actual row fetch.
Rather than the above work around is there something I can change so I don’t get the Oracle error? I’m now wondering if the automatic row fetch is only supposed to be used when linking a report to a form and that I should be writing the fetch process manually. The reason I haven’t at the moment is I’m trying to stick with the automatic wizard generation as much as I can.
Any ideas?
Thanks PeteHi Mike,
I've tried doing that but it doesn't seem to make any difference. If I turn debug on it shows below.
0.05: Computation point: AFTER_HEADER
0.05: Processing point: AFTER_HEADER
0.05: ...Process "Fetch Row from EMP": DML_FETCH_ROW (AFTER_HEADER) F|#OWNER#:EMP:P2099_EMPNO:EMPNO
0.05: Show ERROR page...
0.05: Performing rollback...
0.05: Processing point: AFTER_ERROR_HEADER
I don't really wan't the error page, either nothing with the form not being populated or a message at the top of the page.
Thanks Pete -
Can I use Front Row with macMini (PowerPC)?
Is Front Row compatible with macMini PowerPC version and Tiger? Or does it need Intel?
Do you think that I can successfully emulate an Apple TV by setting up my MacMini (PowerPC) with a third party (someone suggested Keyspan) remote, Front Row application, and using Front Row to access iTunes music, TV shows, and videos (same as APple TV),and using Safari to access .mac web gallery (now available on Apple TV2)? The interface on the AppleTV is probably more elegant and seamless, but really, I could access the same content with the macMini, right? Also YouTube videos and Picasa photos can also be accessed via Safari. It will just look and feel more like a computer if I use Safari, vs a Media Centre! Do you think it's worth giving a try?
-
Using Front Row w/ Macbook in closed lid position (w/ Cinema Display) ?
Using Front Row w/ Macbook in closed lid position (w/ Cinema Display) -
Is it possible if I buy a remote, to use Front Row on a Macbook that is in the closed position?
I use a Macbook linked to an external cinema display (a brushed alum, slightly older 23" model - doesn't have built in iSight) - wondering if I can get some of the same functionality via remote and Front Row.
Do Macbooks even support the remotes? I would assume since they have a built in webcam/iSight they can accept infrared, or no?
Thanks!I am using the IR remote with my MacBook Pro. That remote operates my LED Display when I do it thus:
Shut down Mac, connect display, and restart.
Close lid. Mac goes to sleep and display goes black.
Point IR remote at Mac (not too far away or too oblique an angle - see instructions for Remote) and click "Menu" button.
Mac wakes up, launches Front Row, and displays it on my 24 inch.
EZ Jim
Mac Pro Quad Core (Early 2009) 2.93Ghz w/Mac OS X (10.6.2) MacBook Pro (13 inch, Mid 2009) 2.26GHz (10.6.2)
LED Cinema Display G4 PowerBook 1.67GHz (10.4.11) iBookSE 366MHz (10.3.9) External iSight -
Calculate no.of rows in block/blocks in schema
Hi,
Database :10.2.0.4 RAC ASM
OS: AIX 5.2/5.3
I want to calculate no. of rows exists in a block or in all blocks.
I went to google and found some calculation to get ,but not able to understand in analyzing with minextens,etc.,
Here i am giving my schema dba_segments output for analysis.
SQL>select segment_type,bytes,blocks,extents,initial_extent,min_extents,max_extents from * dba_segments * where owner='SUNAND';
segment_type bytes blocks extents initial_extent min_extents max_extents
INDEX 65536 *8* 1 *65536* 1 *2147483645*
INDEX 65536 *8* 1 *65536* 1 *2147483645*
TABLE 65536 *8* 1 *65536* 1 *2147483645*
TABLE 65536 *8* 1 *65536* 1 *2147483645*
INDEX 84934656 *10368* 82 *65536* 1 *2147483645*
I have separated the output with bold identification.
Could you tell me , * how do i have to find the no. of rows in a table or rows in blocks * ?.
Please tell me , if you need any further information for analysis.
Thanks & Regards,
SunandI've found an answer in "Ask Tom" site:
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:707430700346624722
create table t ( x int ) pctfree 0;
insert into t select null from all_objects where rownum <= 10000;
select count(*)
from t
where dbms_rowid.rowid_block_number(rowid) = (select min(dbms_rowid.rowid_block_number(rowid)) from t);
COUNT(*)
734
Hope it helps.
Roni.
Maybe you are looking for
-
IPhone syncs Voice Memos after unchecking sync box in iTunes
I do not want to sync my voice memos from my iphone to itunes so i have unchecked the sync voice memos option and they still continue to sync over and itunes creates a playlist for voice memos. I have tried this numerous times and even after a restor
-
How to get rid of the large slideshow images in Web gallery (CS4)
Here is the deal. I've created a flash web gallery/ But the new CS4 has the option for slideshow with this flash stuff. CS3 use to create thumbnail and large images folders. The new one creates 3 folders: 1. thumbnails, 2, medium images, 3 large imag
-
Export multiple images with random layers
I have this texture file that has many different variations to it. (3 different kinds of pants, different hairpieces, some optional items, etc...) What i want to do, is export it with random layers selected. (there are also folders inside, it's fine
-
OIM 11gr2 On-behalf removal of accounts/entitlements
Hi, We have a requirement with our client where a user can request for removal of accounts/entitlements on behalf of other user. We understand add request process onbehalf of some user but not sure about onbehalf removal process. Please let me know i
-
Had to remove itunes from my computer to reset the computer. Now I'm having problems syncing my iphone with the computer. Computer is saying it wants to download updates to the phone but that will delete things I downloaded straight from the phone. H