Testing status of a tabular data block
When displaying a tabular data block, how can I tell if the user entered data into a blank row, so I know if I can issue a "create_record;" or not.
Thanks
Hello,
Entering a new row fires the When-Create-Record trigger.
Francois
Similar Messages
-
How to disable any record in a Tabular Data Block
Hi,
I have a tabular data block having 10 records, every record has a check box(1 check box on each row). I want to disable all items in that particular record where user checks the check box(check box is UNCHECKED by default).
Is this possible in WHEN-CHECK-BOX-CHANGED trigger or any other trigger ?, if so, how, please help.
I hope that, I have illustrated the problem clearly.
Regards.Hi,
You cannot disable a single row in detail block. Instead You can set the UPDATE_ALLOWED property to FALSE. By this the user can't change the contents.
IF :<block_name>.<check_box_name> = '<value_when_checked>' THEN
SET_ITEM_INSTANCE_PROPERTY('<block_name>.<item_name>', CURRENT_RECORD, UPDATE_ALLOWED, PROPERTY_FALSE);
ELSE
SET_ITEM_INSTANCE_PROPERTY('<block_name>.<item_name>', CURRENT_RECORD, UPDATE_ALLOWED, PROPERTY_TRUE);
END IF;Regards,
Manu.
If my response or the response of another was helpful or Correct, please mark it accordingly -
Performing operation on tabular data block
hello guys,
i m designing one tabular data block in orcle 6i form builder form emploee_master table form maintaing the employee personnel details.
i have to perform some operation on this data block like viewing existing records,updatinng the record(s),deleting a purticular record,insrting new record.
is there a shortcut way to perform theses operations so processing shoulg be fast and data shold be updated?
pl tell me and give some demo form to understand these operations if possible.
With Regards
Vishal agrawalHello,
All you have to do is to create a block based on the database table. Forms will, then, do everything for you (insert, update, delete) at commit time.
Francois -
I have a tabular data block (records with a scrollbar). I want to add another field (a checkbox) outside the block so that when clicked, it would change the state of all the activated records within the block (also checkbox's). I tried to get the number of existing records, but I failed and didn't understand the posts on this forum.
Thanks in advanceIs this a question regarding Oracle Forms? If so, you probably want to ask the question in the Forms. Make sure that you specify what version of Forms you're using if you do post the question over there.
If this is a question regarding a GUI developed in some other programming language, you probably want to find the appropriate language/ framework/ development environment forum here on OTN to ask the question.
Justin -
Operate on a Tabular Data Block as a table?
hi
i was wondering if it is possible to query a tabular displayed data block like is done with tables. and do updates and inserts. so just to be clear, i dont want to query/insert/update the database table but the values in the form display items. i'm using oracle forms 9i
the main reason im asking this is because i want to use vaules in different records in the tabular displayed data block to make validations in the same data block... before the form is commited of course
thanks
venom_zxYou cannot query or manipulate blocks like table.
But you can manually navigate to each record in the block and validate before they are commited to the base table. -
Hi,
I have to two blocks on a form (1) CONTROL----------------------------------------->CONTROL BLOCK
(2) DETAIL-------------------------------------------->DATA BLOCK
DETAIL BLOCK has four items referencing DETAIL TABLE COLUMNS namely ROWNUMBER, ITEMNAME, QTY, PRICE.
In BLOCK(1) I have three text items to get input from user, and a push button . In this block(1) user inputs ITEMNAME,QTY & PRICE and presses push button.
In WHEN-BUTTON-PRESS trigger I wrote below mentioned code
BEGIN
go_block('detail');
first_record;
for a in 1..:control.QTY loop
create_record;
:global.rownumber:=:global.rownumber+1; // this :GLOBAL.rownumber variable, I declared & initialized with zero, in WHEN-NEW-FORM-INSTANCE trigger.
:detail.rownumber :=:global.rownumber;
:detail.itemname :=:control.itemname;
:detail.qty :=1;
:detail.price :=:control.price;
end loop;
END;
If usesr enters QTY 4,,,,, four rows are being created in detail block as four records , if user enters QTY 3, three rows are being created, and so on as per number entered in QTY text item........THE PROBLEM IS THAT, ROWS(RECORDS) ARE CREATING BUT FIRST ROW IN DETAIL BLOCK REMAINS EMPTY AND IT STARTS CREATING RECORDS FROM 2ND ROW.
An help please.
Regards,Hello,
Well, if you think that the code you wrote with global variable its working for you then for the problem you mentioned the below code should work.
BEGIN
go_block('detail');
first_record;
clear_block;
for a in 1..:control.QTY loop
:global.rownumber:=:global.rownumber+1;
:detail.rownumber :=:global.rownumber;
-- :detail.rownumber :=:SYSTEM.TRIGGER_RECORD; -- this line should work also. So, no need for global variable
:detail.itemname :=:control.itemname;
:detail.qty :=1;
:detail.price :=:control.price;
create_record;
end loop;
END;-Ammad -
How create data block corruption for test DBMS_REPAIR
Hello to all
I wanna create data block corruption in a table for testing Dbms_repair
is it possible ? if yes please say to me how I can do it ,by example please
thanksthank you so much that link was helpful (specially it's last respond)
I could create data block corruption and I tested DBMS_REPAIR and RMAN for data block recovery
but now I got head spin that if we have rman backup from database so using dbms_repair is what for?
while we can recover corrupted data blocks
please guide me
thanks -
Why my scroll bar of a data block doesn't work?
Hi,
I have a data block that displays a maximum of 9 records at one time. When the query returns more than 9 records i want to use a vertical scroll bar to navigate to the last records.
In some forms it works fine but in others not , i still didn't find why ??
Cheers,
NunoNuno,
Rather than trying to find a needle in a hay stack, I would recommend taking a step backward. This will help to rule out whether the issue is something you caused or if there is an issue with the environment or product.
Create a new module in the Builder. Do not add any of your own code.
In the Builder, connect to a database (File > Connect).
From the Builder menu, select Tools > Data Block Wizard
In the Wizard first screen (after Welcome), select Table or View then click Next
On the next screen, click on Browse to display the tables available to you. Choose one.
All the columns in that table should appear on the left. Click on the double arrow (>>) to select all of them. Then click on Next
Click on Next again
Choose the option to create the data block then open the Layout Wizard. Then click Finish
In the Layout Wizard, click on Next (after the Welcome scree) to choose the default Canvas. Then click on Next
Click on the double arrow (>>) to choose all columns. Then click Next
Click Next again.
Choose Tabular as the layout style. Click on Next
Change Records Displayed to 4 and check the box labeled "Display scroll bar".
Click on Finish
Again, do not make any changes to anything in this form. Run it. Does it reproduce the same problem you experience in your previous form? If this form works correctly, likely the issue is in the design of your other form. If this test form fails in the same manner then you are either exposing a defect or there is an odd configuration issue. -
Table of balance stock split by status stock on posting date
Could you please suggest me for the table of balance stock split by status stock on posting date?
MCHB can not support my requirement because it has current stocks.I give you for exsample data.
Stock on 01.03.2011 (This is a selection date)
Material code || Batch || Base unit || Unrestricted use stock || Stock in quality inspection || Blocked stock
A0001 || 09K1 || EA || 10 || 2 ||
A0002 || 10K1 || EA || || 9 || 3
Stock on 31.03.2011 (This is a selection date)
Material code || Batch || Base unit || Unrestricted use stock || Stock in quality inspection || Blocked stock
A0001 || 09K1 || EA || 5 || 2 || 1
A0002 || 10K1 || EA || 6 || || -
ORA-00607: Internal error occurred while making a change to a data block
hi
i hv use testing purpose oracle 10 Xe in unix
but when today i hv connect database following error occured
SQL> startup
ORACLE instance started.
Total System Global Area 83886080 bytes
Fixed Size 1257284 bytes
Variable Size 75497660 bytes
Database Buffers 4194304 bytes
Redo Buffers 2936832 bytes
Database mounted.
ORA-00607: Internal error occurred while making a change to a data block
ORA-00600: internal error code, arguments: [4193], [625], [640], [], [], [],
I hv check alert log , but no proper solution is given , how can start databaseDuh, and of course I missed the significance of
oracle 10 Xe in unix
XE is only supported for Linux - according to the downloads page that means "Debian, Mandriva, Novell, Red Hat and Ubuntu".
Oracle have not publically stated the reasons why XE is only available on Linux and Windows, but my guess is that it is something to do the Intel chip architecture. If this is so it would be possible for Oracle to port XE to run on Solaris for x86. But they have not done so yet.
Which means, alas, that you are unlikely to get any help for this one, because XE is not supported on any unix platform.
Good luck, APC -
COMMIT_FORM per one DATA BLOCK at a time
Hi,
Please guide for the following:
I have 3 data blocks (tabular) on 3 tables, with three radio buttons on the form. I want to insert records in a table as per the radio button value:
For example
(1) if user has selected rdbtn1 then COMMIT_FORM must insert record in table 1 only.
(2) if user has selected rdbtn2 then COMMIT_FORM must insert record in table 2 only.
(2) if user has selected rdbtn3 then COMMIT_FORM must insert record in table 3 only.
Is it possible with COMMIT_FORM, if so, how, please guide.
Regards.Here is the fundamental problem. The Commit_Form built-in will save all pending transactions in the entire Forms session. Therefore, in order to save incrementally (one block out of many) you have to use autonomous transactions. In essence you have to create a new session, perform your changes and save the changes outside of the current Forms session. This is typically done using Dynamic SQL. However, you can’t use the EXECUTE_IMMEDIATE Native Dynamic SQL (NDS) command in Forms. You could use FORMS_DDL (which allows you to execute dynamic SQL from Forms) but Forms_DDL issues an implicit COMM IT which will COMMI T the entire Forms Session. Therefore, the best way to accomplish this would be to call a database procedure that uses NDS to perform the needed DML and issue the COMM IT.
The other alternative would be to do what I think "user8937305" is suggesting; depending on the Radio Button selected, you clear the other two data blocks so only the data in the selected data block (radio button) is saved through the FORMS_C OMMIT.
Hope this helps,
Craig B-)
If someone's response is helpful or correct, please mark it accordingly. -
Space utilization and optimal row size in Data Blocks in Oracle 11g
Hi,
My main concern till now is to find the Optimal no. of rows/tuples per one oracle data block of size 8192. For that purpose i'm doing different kind of testing.
I created one table:
SQL> create table t5
2 (x char(2000));
Table created.
Inserted 4 rows in it.
Queried to check in which block no's these 4 rows exist.
SQL> SELECT x,DBMS_ROWID.ROWID_BLOCK_NUMBER(rowid) "Block No."
2 from t5;
x Block No.
A 422
B 422
C 422
D 423
SQL> analyze table t5 compute statistics;
Table analyzed.
SQL> select LOGGING,BACKED_UP,NUM_ROWS,BLOCKS,EMPTY_BLOCKS, AVG_SPACE,CHAIN_CNT, AVG_ROW_LEN
2 from user_tables
3 where table_name = 'T5';
LOG B NUM_ROWS BLOCKS EMPTY_BLOCKS AVG_SPACE CHAIN_CNT AVG_ROW_LEN . YES N 4 5 3 6466 0 2006 .
8 data blocks are initially allocated. but my question is that while creating table of even small sizes, every time i'm seeing that it shows BLOCKS (used) are 5.
why 3 block are EMPTY_BLOCKS allocated all the time?
AVG_SPACE is the FREE space in every BLOCK that is used if i'm not wrong?
In this scenerio 3 rows (each of around 2006 bytes) are inserted into into one BLOCK of 8192 i.e. 8192-6006=2186. 2186 is the PCTFREE or what?
How can I see this CHAIN_CNT column value other than 0?
How can actually I find the optimal no. of rows/tuples in 1 data block that will not increase OVERHEAD on the system.
I'll highly appreciate the genuine help and solid suggestions.
Thanks in Advance.
Best Regards,
Kamkamy555 wrote:
If you want to suggest something it'll be nice of yo.I can't disclose my main concern :)If you can't disclose what you mean by "optimal" and you can't disclose what "overhead" you are concerned about, I'm not sure that anyone could answer your question.
In this scenerio 3 rows (each of around 2006 bytes) are inserted into into one BLOCK of 8192 i.e. 8192-6006=2186. 2186 is the PCTFREE or
what?PCTFREE is a percentage. You haven't specified what you set it to, but that decreases the space in a block available for inserts to 8192 * (1 - PCTFREE/100).
How can I see this CHAIN_CNT column value other than 0?Why do you believe there would be chained rows? You would need to use the ANALYZE command to populate the CHAIN_CNT column.
How can actually I find the optimal no. of rows/tuples in 1 data block that will not increase OVERHEAD on the system.Since you can't disclose what "optimal" means or what "overhead" you're concerned with, I don't see how this question could be answered.
Justin -
Query Execution/Elapsed Time and Oracle Data Blocks
Hi,
I have created 3 tables with one column only. As an example Table 1 below:
SQL> create table T1 ( x char(2000));
So 3 tables are created in this way i.e. T1,T2 and T3.
T1 = in the default database tablespace of 8k (11g v11.1.0.6.0 - Production) (O.S=Windows).
T2 = I created in a Tablespace with Blocksize 16k.
T3 = I created in a Tablespace with Blocksize 4k. In the same Instance.
Each table has approx. 500 rows (So, table sizes are same in all the cases to test Query execution time ). As these 3 tables are created under different data block sizes so the ALLOCATED no. of data blocks are different in all cases.
T1 = 8k = 256 Blocks = 00:00:04.76 (query execution time/elapsed time)
T2 = 16k=121 Blocks = 00:00:04.64
T3 = 4k = 490 Blocks = 00:00:04.91
Table Access is FULL i.e. I have used select * from table_name; in all 3 cases. No Index nothing.
My Question is why query execution time is nearly the same in all 3 cases because Oracle has to read all the data blocks in each case to fetch the records and there is a much difference in the allocated no. of blocks ???
In 4k block size example, Oracle has to read just 121 blocks and it's taking nearly the same time as it's taking to read 490 blocks???
This is just 1 example of different data blocks. I have around 40 tables in each block size tablespace and the result are nearly the same. It's very strange for me because there is a much difference in the no. of allocated blocks but execution time is almost the same, only difference in milliseconds.
I'll highly appreciate the expert opinions.
Bundle of thanks in advance.
Best Regards,Hi Chris,
No I'm not using separate databases, it's 8k database with non-standard blocksizes of 16k and 4k.
Actually I wanted to test the Elapsed time of these 3 tables, so for that I tried to create the same size
tables.
And how I equalize these is like I have created one column table with char(2000).
555 MB is the figure I wanted to use for these 3 tables ( no special figure, just to make it bigger than the
RAM used for my db at the db startup to be sure of not retrieving the records from cache).
so row size with overhead is 2006 * 290,000 rows = 581740000(bytes) / 1024 = 568105KB / 1024 = 555MB.
Through this math calculation I thought It will be the total table size. So I Created the same no. of rows in 3 blocksizes.
If it's wrong then what a mes because I was calculating tables sizes in the same way from the last few months.
Can you please explain a little how you found out the tables sizes in different block sizes.Though I understood how you
calculated size in MB from these 3 block sizes
T8K =97177 BLOCKS=759MB *( 97177*8 = 777416KB / 1024 = 759MB )*
T16K=41639 BLOCKS=650MB
BT4K=293656 BLOCKS=1147MB
For me it's new to calculate the size of a table. Can you please tell me then how many rows I can create in each of
these 3 tables to make them equal in MB to test for elapsed time.
Then I'll again run my test and put the results here. Because If I've wrongly calculated table sizes then there is no need to talk about elapsed time. First I must equalize the table sizes properly.
SQL> select sum(bytes)/1024/1024 "Size in MB" from dba_segments> 2 where segment_name = 'T16K';
Size in MB
655
Is above SQL is correct to calculate the size or is it the correct alternative way to your method of calculating the size??
I created the same table again with everything same and the result is :
SQL> select num_rows,blocks from user_tables where table_name = 'T16K';NUM_ROWS BLOCKS
290000 41703
64 more blocks are allocated this time so may be that's y it's showing total size of 655 instead of 650.
Thanks alot for your help.
Best Regards,
KAm
Edited by: kam555 on Nov 20, 2009 5:57 PM -
Data Blocks and the Elapsed Time
Hi,
I have created 3 tables with one column only. As an example Table 1 below:
SQL> create table T8k( x char(2000));
So 3 tables are created in this way i.e. T8k,T16K and T4K
T8 = in the default database tablespace of 8k (11g v11.1.0.6.0 - Production) (O.S=Windows).
T16 = I created in a Tablespace with Blocksize 16k.
T4K = I created in a Tablespace with Blocksize 4k. In the same Instance.
Each table has 290,000 rows and all the 3 tables have equal size of 555MB (2006(rowsize with overhead) * 290,000/1024/1024 = 555MB) to test Elapsed Time (set timing on).
As these 3 tables are created under different block sizes so the allocated no. of data blocks are different as below:
T8K = 97177 BLOCKS= 00:41:20.21 (Elapsed Time)
T16K=41639 BLOCKS= 00:44:11.59
BT4K=293656 BLOCKS=00:37:29.06
Please note the difference. First table i.e. 8k block size, allocated blocks are 97177 and taking around 41 mins. Third table i.e. BT4K (in a 4k block size tablespace), allocated blocks(293656 ) are almost 3 times bigger, taking around 37 mins to execute the query. I mean the difference is only 4 mins hardly and blocks difference is 3 times.
In case of any doubt, I've created these tables bigger than the memory used for my db(memory_max_size 408M) i.e. 555 MB that If Blocks are already in cache then reading the blocks and counting the rows will nearly be the same regardless of the block sizes or the number of blocks.
Need solid suggestions and if possilble, links also which has some serious discussions regarding my issue.
Bundle of thanks.
Best Regards,Because I was not completely satisfied with the things last time. It doesn't seem so simple to me as people said
I thought may some guru have a look today, not just to point out that i have created it again.
And I have compact my question to avoid confusion. -
We have a legacy Forms and Reports application(~750 items combined). I suspect the applications were developed initially under 6i, but they work quite well under 10GR2, and is testing well under 11GR2 (which we plan on migrating to soon). We ran into an issue the other day for Data Query Blocks, and wanted your expert opinion on it.
Due to a change in business requirements, we recently had to increase the length of a database field (from 20 to 30). We went into Forms Developer, made the appropriate changes, and recompiled them all successfully. Everything *seems* to work fine, but we noticed we get failures on any item that tries to utilize that extra 10 characters. Apparently this is because the Query Data Block seems to use a cached/stale copy of the database field sizes, and still expects a size of 20! What we realized now is that we have to go into each of those forms, and REFRESH the Data Block (through the Data Block Wizard) for every one of them.
My question is this: is there anyway to force the Form to refresh those Query Data Blocks absent going into each one and REFRESHING it? We've tried compiling through Forms Developer, and through Batch Compiles, and nothing seems to get those cached copies to update. I'd really prefer to tackle this issue once and for all since we are prepping for migration testing. Frankly I suspect the table space was tweaked a good bit over the years since development (before I ever got here), and if they didn't REFRESH those Data Blocks properly, a great many of the Forms will be suffering this same cached/stale view problem.
Appreciate your thoughts,
DaveQ_Stephenson,
That's an excellent suggestion. I have seen vague hints and allegations of Forms manipulation using that method, but never felt comfortable with my overall knowledge(*) of Forms to look at it that deep. I think it's time to clear some space and dig into the topic for a better look.
Thank you,
Dave
(*) The majority of my programming background is in Java; it's only been recently that I've had to really dig deep into Forms.
Maybe you are looking for
-
Diskpart List volume not working in Windows 7
Hi Im trying to run diskpart-List volume command using System Exec.vi in LabVIEW 2010 in Windows 7 32-bit/64-bit. When i try to run this command through script text file in Windows XP, I could get the Standard Output String with volume informations i
-
apart from XQuery, i know Oracle provided X-Path based search also. can anyone direct me what's wrong with the following statement? it returns "no rows selected". THX~ e.g.1 select extract(value(it),'/Cap/@ctitle').getStringVal() as CTITLE from ord_x
-
AS2 Sender Channel Dynamic Configuration
Hello All, I have an AS2 to Proxy scenario. For this I am using the following UDF and Modules in ESR and ID respectively :- ========================================================================== UDF in ESR :- public String AS2Name(Container conta
-
Tax code for reimbursement Wagetype
Hi All: Which standard wagetype do i use for configuring entertainment expense reimbursement and what tax code should i use for it? Regards, Kamini
-
I'm trying to connect to a web service using the stubs generated by wscompile. Problem is that the call to the web service times out after about 25 seconds. The call can take up to 5 minutes. Where can I specify how long should the web service wait u