BLOCK BASED ON TWO TABLES
I've created a block based on two tables.
Querying records works fine.
However, when I try to amend a column in the master table I get an error message 'Record has already been updated by another user.'
I have set the dml target property to to the master table and set the primary key on the correct columns.
What else could there be??!!
Block1 will be----- enter_query Sku :123 then from dropdown select Level 1 which will show data like this
in two different rows.
Sku : 123 Price : $100 Qty : 10 (Primary)
Sub Sku : 345 Price : $110 Qty : 8 (Level 1)then from dropdown selected Level 2 which will show data like this in two different rows.
Sku : 123 Price : $100 Qty : 10 (Primary)
Sub Sku : 456 Price : $90 Qty : 12 (Level 2)There are two more blocks which will display more information based on either Level 1 is selected or Level2 selected.
Regards
Sandy
Similar Messages
-
One block based on two table when update/insert result in FRM-40654
Hi,
I ahve a multi line block based on two tables.
Customers - AFCUSTOMER
Maintenance - AFMAINT
Some customers exist when maintenance doesnt so in my where clause i have
AFCUSTOMER.CUSTID=AFMAINT.MAINT_CUSTID(+) AND AFCUSTOMER.CUSTBRANCHID=1 AND AFCUSTOMER.CUSTSTATUSID=2
I have primary key set as the AFMAINT table primary key and have set DML data targetr name as AFMAINT.
I am displaying customer name (from AFCUSTOMER) and type of payment (from AFMAINT) on screen and i want to change the type of payment which then uses pre update trigger to fil in the primary key of AFMAINT.
Querying works fine and displays all records. But when i try to insert a record into the AFMAINT table by changing the type of payment list item i get FRM-40654 Record updated by another user. I have checked and block status is QUERY right before the list item is changed.
Any ideas on where i am going wrong.But when i try to insert a record into the AFMAINT table by changing the type of payment list item i get FRM-40654 Record updated by another userWhen you start editing a record which is already stores in the database forms "rereads" the record from the database and check id all values in the database are the same as in the form. If there is some difference, forms assumes that someone else changed the record after you did the query.
The main causes for that are:
-Some database-trigger which changes the value of a column which is included in the form
-numeric column with a higher precision in forms, than in the database
-a block based on a view or "select from clause" which does not return the same values as inserted/updated through forms.
I guess you run into the third issue. Check all the values in the forms-items after your dml and compare them to the values saved to the database, there will be some difference. If you find it, correct the error, if one, or re-read the data in the POST-UPDATE-trigger. -
Detail tabular form based on two tables
db11gxe , apex 4.0 , firefox 24 ,
hi all ,
i have a master detail form based on two tables , the detail form ofcourse based on one table , the problem is i want to include a column of another
table into the tabular form , so i have changed the query of the tabular form and included the column in it correctly ,
but the problem is about saving data , i can not save the data , i think
because the "mru" process is based on one table , that is because i face an error talking about "mru" process when i try to save the data ,
Error in mru internal routine: ORA-20001: no data found in tabular form Unable to process update.
so
what should i do to save the data ? should i create another "mru" process based on the other table or what ?
thanksAnything beyond "simple" requires that you do it yourself. I believe that what you want is "beyond simple"
As far as I know, you can only use the 'mru' on one table.
(I could be wrong)
If the conditions are right, you might be able to simplify things such that you can use the 'mru'.
ie CREATE VIEW on the two tables.
However, you need to understand how Oracle treats DML operations on views, what type of views can be updated, etc., etc.
If just creating the view doesn't work, creating an INSTEAD OF trigger on the view come to mind...
(lol) - at that point, you have already started down the 'dark path' of creating your own 'MRU'
personal note: triggers have a really baaaddd habit of hiding code from other developers. you are better off, in the long run, creating your own 'mru'..
ie a package with procedures to handle INSERT, UPDATE, and DELETES
MK -
Does adding a field to a table affect a data block based on the table?
If I make a change to a table like adding a field does it affect data data blocks based on the table?
The other place I have seen where adding a new column to a table causes problems is when a programmer codes: Select * from table.
If that is coded in a form, the form will need to be recompiled before it will work properly. -
Can I create a view based on two tables that have the same column name?
I have two tables A and B. Each table has 50+ columns.
I want to create a view that includes all the columns in A and all the columns in B. I created a view with a select statement that says
Select A.*, B.*
From A, B
where A.id = B.id
It returns an error because in each table I have a column that keeps track if a record has been changed called Modified_By. That's where it chokes up on I figure. I would like to write the view without explicitly writing each column name from A and B as part of the select statement. The actual select statement works fine and only bombs when trying to turn the select statement into a view.You will have to type the full column list at least once. You can save a few keystrokes (i.e. alias. on every column) by providing the column names to the CREATE part instead of in the SELECT part. Something like:
SQL> desc t
Name Null? Type
ID NUMBER
NAME VARCHAR2(10)
SQL> desc t1
Name Null? Type
T_ID NUMBER
LOC_ID NUMBER
NAME VARCHAR2(15)
SQL> CREATE VIEW t_v (id, t_name, t_id, loc_id, t1_name) AS
2 SELECT t.*, t1.*
3 FROM t, t1
4 WHERE t.id = t1.t_id;
View created.HTH
John -
Defining a Recordset Set based on two tables
I am having difficulty displaying records for a "membership"
page. I have set up a simple database in PHPMyAdmin with two main
tables: instructors and membership. Instructors are given a
temporary username and password to enter a restricted area. If they
decide to become a member, they go to a page with a
Pre-registration
form and fill that in. If their credentials check out, they are
sent a registration form.
The pre-registration form populates the instructors table.
I set up three pages in the Admin area: Contact_info,
Addresses, and Membership.
The Contact_info has the instructors' email and phone
numbers. This is based on some of the fields in the instructors
table. This page works fine.
The Addresses page also is populated fields from the
Instructors table and also works well.
The membership page is not working. I want this page to
display fields from the Instructors and the Membership tables.
Here's the SQL statement that I am using in the Recordset
dialog box in DW:
SELECT instructors.instructor_id, instructors.first_name,
instructors.last_name, membership.instructor_id,
membership.username, membership.pwd, membership.type
FROM instructors INNER JOIN membership ON
instructors.instructor_id = membership.instructor_id
ORDER BY instructors.last_name
It seems to me to be correct but its not displaying any
records. I don't know if the sql statement is bad or I have my
instructor_id field in my Membership table set up incorrectly in
PHPMyAdmin. I don't know how to indicate that its a foreign field
or how to relate it to the other table, other than indication the
relationship with sql. By the way, did I mention that I am new to
php and sql?
I appreciate any help.Just and idea.
Try to create one dimension like this:
Id
type
Category
1
juice
drink
2
milk
drink
3
alcohol
drink
4
beer
liquor
5
wine
liquor
Hope this helps.
Reeves
Denver, CO -
Please help with two tables...
I've created form based on two tables - two blocks with relationship. One table have fields ID and DESCRIPTION and there is LOV based on it. LOV returns value to textbox. I want that user see in textbox value DESCRIPTION, but when user save changes to main table there is update on ID field. How can I do that?
PS Sorry my english is not perfect.see this link , i guess you are looking for same thing
Copying value from updated block to newly created bolck -
Error in Abap code when combining data from two tables
Hi,
I got error in my code when i try to select data based on two tables
error message Unknown column name "(" field list. field list. field list. field list.
select ( WLK1~ARTNR )
into ZOXE1D0041-ZZPROMO
from WLK1 INNER JOIN T001W
ON WLK1FILIA = T001WKUNNR.
where WLK1-PFLKN NE 'P' AND
WLK1-QUELL NE '2'.
Table 1 WLK1
ARTNR FILIA PFLKN QUELL
001 C001 P 2
002 C001 A 1
Table 2 T001W
KUNNR WERKS
C001 P001
My requirement is to extract from article number from table WLK1 where the customer number (FILIA) matches with Customer number from (T001W) and plant (WERKS).
In conclusion I like to have this only this row
ARTNR FILIA PFLKN QUELL
002 C001 A 1Hi
You need to append every article number after each select is performed
is this an intermal table ZOXE1D0041 with header line ? if yes
then do this way
select WLK1~ARTNR
into ZZARTICLE
from WLK1 INNER JOIN T001W
ON WLK1FILIA = T001WKUNNR
where WLK1~PFLKN NE 'P' AND
WLK1~PFLKN NE 'S' AND
WLK1~QUELL NE '2'.
ZOXE1D0041-ZZLISTARTICLE = ZZARTICLE.
Append ZOXE1D0041. " <edited>
endselect.
then ZOXE1D0041 will have all article numbers.
Edited by: Sonal Patel on Sep 5, 2009 10:27 AM -
Question - View with a join based on two unequal strings.
Hello -
First my apologies for the likely novice question.
I'm creating a view based on two tables as such:
SELECT *
FROM table1 LEFT OUTER JOIN table2 ON table1.string = table2.string AND table1.number = table2.number
Problem: table1.string looks like "A00A01%%%" and table2.string looks like "A1" (which would correspond to "A00A01%%%".
Question: Can I create the join based on the 4th and 6th character of the string = the other string, or should I create a view with a formula creating a new field and then create a second view? (Note: creating or changing the field in the original table is not an option).
Thank you.Hi,
Yes, you can do that. Join conditions don't have to be as simple as "ON a.col1 = b.col2"; they can involve functions, like CONCAT and SUBSTR.
For example:
FROM table1
LEFT OUTER JOIN table2
ON SUBSTR (table1.string, 4, 1)
||
SUBSTR (table1.string, 6, 1) = table2.string
...The query might be faster if you create a function-based index on the join condition from table1. This does not require changing table1 itself. (For a LEFT OUTER JOIN, like this, it probably won't matter.) -
Data Blocks Based on Stored Procedures
Is it possible to to create a data block based on a stored procedure, and create a dynamic list as a drop down box?
I have a form that runs successfully that has a data block based on a stored procedure. I add my trigger to create and populate the record group. Then in the Property Palette, when I change ITEM TYPE from TEXT ITEM to LIST ITEM, I receive the following runtime error:
FRM-40350: Query caused no records to be retrived.
Note: the tlist/list item runs successfully on a data block based on a table.1) go to the block property to remove the same item column, then re-add the item; Since the property may remember the old text type;
make sure the record value for the list tiem from stored procedure is among the list elements!
Last sort is to do:
2) you may re-create your gui based on the table by setting the list type this time, then set the block property to be based on the stored procedure. -
Joining Two Tables by Database View
HI There,
I'm trying to join two tables BNKA and LFBK to get the Bank details according to the requirement.
Now, I wanted to go head and create a Generic datasource and bring the fields from these two tables by Vew.
Can someone please explain me step by step to create the database view?
One more thing, do we need to have anything in common between two tables BNKA and LFBK ?
I really appreciate if someone can guide me through step by step method to create Database Table view?
Thanks
MadhuriHi Madhuri,
With out having common fields, we can not create data base view based on two tables.
1) goto SE11
2) select data base view and give the name and create.
3) in left side give the tables names
4) In left side define the relation
check the below article
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/10a89c00-7dd7-2d10-6f83-cd24ee6d517c?QuickLink=index&overridelayout=true
Regards,
Venkatesh -
Two Tables in a Single Block!
Is that possible two tables in a single forms block.
actually we can assign one database table in a block
but i like to know is there any possibilities of having 2 tables in a
block?Stalin,
Yes, this is possible. Essentially, you are performing a join on the tables in your block which means you have to fully qualify each column in the block so Forms knows which column belongs to which table. For detailed information take a look at the Oracle White Paper: Basing a Forms Data Block on a Join. This works quite well and the tables your block is based on is fully updatable, whereas if you were to create a view and base your block on the view, most likely your view would not be updatable.
Hope this helps,
Craig B-)
If someone's response is helpful or correct, please mark it accordingly. -
Spliting a table in to two table based on the groups in SSRS
Hi,
I am trying to a split a rows accross two tables based on a group.
So far I have added a list and added a row group and grouped it using lineof business
Inside my list i have two identical tables so i can display the data
for the first table i have set the row visibility as follows: where LineOfbusiness1 is the groupname of my list group
=RowNumber(Nothing) >= (IIf(CountRows("LineOfBusiness1")\2 = 1, CountRows("LineOfBusiness1")/2, (CountRows("LineOfBusiness1")/2)+1))
and for the second table in the i have set the row visibility as follows
=RowNumber(Nothing)< (IIf(CountRows("LineOfBusiness1")\2 = 1,CountRows("LineOfBusiness1")/2, (CountRows("LineOfBusiness1")/2)+1))
this set up works fine for the first group but it doesnt display the data the way i want for the subsequent groups.
so how do i have the table start over after each group... plus in my group i have specified to do a page break after everygroup...
Any help will be appreciated.
Thanks
KarenVisakh,
Thanks for answering.... a sample for the data will look like
dataset----
create table #dataset
Code varchar(5),
Name varchar(200),
Lineofbusiness int,
Statename varchar(10),
typed int,
description varchar(2000)
insert into #dataset
select 45111,abc,1,AL,4500,policies
insert into #dataset
select 45111,abc,1,AL,2500,vehiles
insert into #dataset
select 45111,abc,1,AL,3,drivers
insert into #dataset
select 45000,bca,2,AL,4500,policies
insert into #dataset
select 45000,bca,2,AL,500,house
insert into #dataset
select 45000,bca,2,AL,40,theft
When i display the data i want it to be
Line of business 1
policies 4500 drviers 3
vehiles 2500
Line of business 2
Policies 4500 theft 40
House 500
but right now the for lineofbusiness 1 its showing the correct way for but the line 2 everything is being displayed in the right.
Thanks
Karen -
Can we create a hierarchy based on two logical table in 10g RPD
Hi,
I have a question, please give me some clarity, about creating hierarchy,
I know we can create a hierarchy based on one logical table which is form by two physical table...
Can we create a hierarchy based on two logical table? If yes, and how?
Thanks in advance!
anneUse preffered drill paths...
-suman -
Sum the value of look up table based on two filter criteria
Hello Everyone
I am new to Powerpivot and would appreciate if someone could help me on the following problem.
You can download the example of this excel file form the following DropBox link:
Dropbox Link
The first table is tOrders
Week number
Work center
order number
Production time in minutes
2
a
111
60
2
a
112
70
2
b
113
60
3
b
114
50
3
a
115
40
3
b
116
60
4
a
117
90
4
b
118
40
The second is dLookupList
Week number
Work center
mantenace in minutes per week
Break dows in minutes per week
2
a
10
10
2
b
20
5
3
a
15
12
3
b
30
10
4
a
20
10
4
b
10
10
I’m trying to create Pivot that has filter on Week number to show the number of orders, Sum of Production time in minutes and the total of the values form the lookup table dLookupList that matches the work center and the selected week
numbers. So that I can calculate the total time for each work center. Filter criteria is Week number and Work center.
For example if someone select all weeks numbers the result sould look like this
Week number
(All)
Work center
Count of order number
Sum of Production time in minutes
mantenace in minutes per week
Break dows in minutes per week
Total time
a
4
260
45
32
337
b
4
210
60
25
295
Grand Total
8
470
Result for week 2
Week number
2
Work center
Count of order number
Sum of Production time in minutes
mantenace in minutes per week
Break dows in minutes per week
Total time
a
2
130
10
10
150
b
1
60
20
5
85
Grand Total
3
190
How can I relate these two tables to get the above result?
Any help is highly appreciated.
Regards
PriyanHi Recio
Thank you very much for the swift response. I was able to get it work.
I got two questions:
How do you add a total time column to the pivot table like you did? Because there are no calculated field in power pivot.
I prefer that the filter is based on the Orders table. So that if you select all Week numbers in the filter, that pivot will show result for all orders and relevant sums from the lookup list.
Link download the example file
For example: I add Week number 5 to the work center “a”
Week number
Work center
WNandWC
mantenace in minutes per week
Break dows in minutes per week
2
a
WN2WCa
10
10
2
b
WN2WCb
20
5
3
a
WN3WCa
15
12
3
b
WN3WCb
30
10
4
a
WN4WCa
20
10
4
b
WN4WCb
10
10
5
a
WN5WCa
1
1
In the orders table there are no records for week number 5
Week number
Work center
WNandWC
order number
Production time in minutes
2
a
WN2WCa
111
60
2
a
WN2WCa
112
70
2
b
WN2WCb
113
60
3
b
WN3WCb
114
50
3
a
WN3WCa
115
40
3
b
WN3WCb
116
60
4
a
WN4WCa
117
90
4
b
WN4WCb
118
40
4
a
WN4WCa
119
50
But the pivot sums up the week number 5 also.
Do you have any idea how to solve it?
Thank you very much.
Regards
Priyan
Maybe you are looking for
-
Java and Partner Applications - EXTREMELY URGENT
gurus, i'm trying to register a single sign on servlet application as a partner application. i followed ths steps as mentioned in the SSO SDK version 307 and when i try to run the application i get the following error - ******* START ERROR ******** E
-
Internet Explorer will not open a password-protected webpage
I've asked this question in the General Discussion forum but did not find a solution. I am using DW8.0.2 / MySQL 4.1 / PHP5.1 to create PHP login and restricted access webpages. Locally (i.e. Windows XP / IIS5.0), they all function properly no matter
-
MOVED: How do I achieve three displays?
This topic has been moved to Off-Topic Technical. https://forum-en.msi.com/index.php?topic=152771.0
-
Need reset box with flip-flop green LED and reset button
Before I build up a large number of these, is there an off-the-shelf box with flip-flop green LED and reset button?
-
Query to find the list of workbooks and worksheets assiciated to those book
Hi Gurus, Could you help me with the tables / Query to fetch the list of workbooks and associated worksheets names as welll. Thanks in advance!! Rgds, Santosh