Forms 6i update row by row
dear sirs,
i have form with the folllowing items
item1, item2,item_result
100 20 80
80 10 70
70 10 60
you will find that
1- item_result = item1 - item2
2- the value of item_result will go to item1 that is mean item1 is the second row = item_result
i hope when i make update in item2, item1 and item_result change depend on this update for example
if i make this update
item1, item2. item_result
100 25 75
75 10 65
65 5 60
please tell me how to do code this
thanks in advance
i try to change the style of asking and tell the problem maybe anybody help me and answer, but anyhow i solved myself and here is the code for people.
i made button to calculate and this the the code for event when_button_pressed
declare
cursor c is
select num1,NUM2,result
from a;
counter number(2) := 0;
v number(5);
v_net number(5);
begin
for i in c loop
v_net := 0;
counter := counter +1;
exit when c%notfound;
v_net := :num1 - :num2;
go_block('a');
next_record;
if :id is not null then
:num1 := v_net;
end if;
end loop;
end;
Similar Messages
-
Problem: trying to update all detail rows on pre-commit (MASTER DETAIL FORM
Hi:
I got a MASTER DETAIL form... and I need to update every detail row of this form (if the master was updated) before commiting the changes. the problem is that i cannot do that for instance in PRE-COMMIT or ON-COMMIT... it's an "illegal operation". I achieved part of it by coding KEY-COMMIT... but that did not solve the all problem. first take a look of the kind of code i want execute before commiting.
form trigger key-commit code is is somehow like this:
DECLARE
tot_line NUMBER (3);
line NUMBER (3);
begin
IF NAME_IN ('system.form_status') = 'CHANGED'
THEN
GO_BLOCK ('DETAIL');
LAST_RECORD;
tot_line := GET_BLOCK_PROPERTY ('DETAIL', current_record);
FIRST_RECORD;
line:= 1;
LOOP
:detail.quant := :detail.quant + 1;
EXIT WHEN line= tot_line;
next_record;
line:= line+ 1;
END LOOP;
FIRST_RECORD;
GO_BLOCK ('MASTER');
END IF;
COMMIT;
end;
The problem is for instance when the users close form in the "X" button (right top, near minimize form) ... If they do that Forms ask "Do you want to save changes?" ... and with this i do not execute the update of the detail rows...
But there are other situations when this happens... for instance if EXECUTE_QUERY when i change a record...
Anyone help?
Joao OliveiraUse PRE-UPDATE trigger (Master block).
begin
update <detail_table>
set quant + 1
where <detail_table>.<relaition_column1> = :<Master_block>.<relaition_item1>
and <detail_table>.<relaition_columnN> = :<Master_block>.<relaition_itemN>
and <detail_block_WHERE>;
EXCEPTION WHEN OTHERS THEN NULL;
end; -
BLOB column not updating using automated row processing
I have fiddled around with creating a simple application to understand how APEX handles images stored in blobs - did a simple app that stores them, gets them, displays them. it all works great.
so i have this existing table/application that i am trying to add a BLOB column to here's what i did:
it's a pretty simple form on a table with report application. just one table.
I added the BLOB to the table (and the other mimetype etc cols as well).
i added the page items to the form page.
i basically made everything identical in terms of page item settings and such to the working simple application.
so here's the problem... when i run the application and update a row, the BLOB column isn't updating. neither are the mimetype or filename columns. the activity date col is.
and here's another interesting thing. i quickly created another form and report pair on the same table, and when i ran it, it updates the blob col just fine.
why is my original form not updating it? what can i do to remedy this? any ideas? i've gone though setting by setting for the blob page item and the one that works is identical to the one that doesn't.
i'm using the automatic row processing to update the table.
Edited by: moo on Jun 23, 2011 5:33 AMGary,
The DML processes (and the creation wizards for them) are for use with items having source type Database Column. If your page items don't use this source type, then neither the Automated Row Fetch nor the Automatic Row Processesing (DML) process types will work.
Scott -
Results not updating for every row in BIpublisher
Hi all I have a Bi publisher report that is updating the results for the first row and in the second row to update the results it is picking the values from the first column itself and using the same values for all the other rows.
Here is my report format
Month saves Total, for 30,60,90,120
Jan
feb
Mar
Total are the enrolls by each month and days shows after 30,60,90,120 how many are still active. Following eg should give an idea of exactly whats happening
Eg:
Total 30days 60days 90days 120days 150days 180days 210days
------------------------------------------------------------------------------------------------------------------------------------------------------------ Jan saves 330 287 274 270 263 262 259 257
Feb saves 298 255 242 238 231 230 227 225
Mar saves 291 248 235 231 224 223 220 218
So what is happening is lets say for example there are a total of 330 enrolls in january and after 30days 287 are still active and after 60days 274 are still active after 90 270...... etc
Am getting the January active values correctly.
BUt going forward when I see the values for february The total enrolls for february is 298 and after 30 days which are active is not giving me the correct.
It is substracting the same amount as jan. looking at the numbers it is substracting
-43, -13,-4,-7,-1,-3,-2 for Jan which are the cancels after the consecutive days
It is substracting the same amount for feb also but my actual cancels for feb are different it should be 45,12,8,9,2,2,
It is doing the same for all the months.
There should be a change in the code. Following is the XSL code am using in
<?xdoxslt:set_variable($_XDOCTX, 'v_SavesCanceled', SAVES_CANCELED_COUNT)?>
<?xdoxslt:set_variable($_XDOCTX, 'v_RtSaves', xdoxslt:get_variable($_XDOCTX, 'v_RtSaves') - xdoxslt:get_variable($_XDOCTX, 'v_SavesCanceled'))?>
<?xdoxslt:get_variable($_XDOCTX, 'v_RtSaves')?>
Actually the cancels should be updated for each row but its picking the same cancels for every month.
Hope it is clear let me know if you need any further info
Any help is appreciated.
ThanksThank you very much for your help. The rtf file sent worked and updating results as required.Thank you
Thanks -
Flex updates at a row level in a grid
I needs to updates row level in a grid for frequent basis, Also i don't want to Refresh the Grid.
Is there any method i can use ?
Using flex Grid -> updates at a row level in a gridI mean DataGrid. I am trying to change the data rows based on realtime data feed.
First time i'll add all the Employees in the Grid. Later i'll get indivual request will change only Status column.
Is there is any other way i can update with out refresh in datagrid.
<mx:DataGrid
id="dg" height="260" width="900" x="0" y="20">
<mx:columns>
<mx:DataGridColumn headerText="EmpID" dataField="EmpID" width="10" visible="false"/>
<mx:DataGridColumn headerText="Emp Name" dataField="Emp Name" width="110"/>
<mx:DataGridColumn headerText="Status" dataField="Status" width="80"/>
</mx:columns>
</mx:DataGrid> -
How to update a single row of data table
How we can update a single row of the data table by clicking the button in the same row.
Thanks in Advance.Hi!
What do You mean 'update'? Get fresh data from DB or change data and commit it in DB?
If commit, try to read here:
http://developers.sun.com/jscreator/learning/tutorials/2/inserts_updates_deletes.html
Thanks,
Roman. -
Hi experts,
I still cant figure out how oracle handles multiple updates to the same row. For instance I have 3 update statements:
update supplier set supp_type = 'k' where supp_code = '1';
update supplier set supp_type = 'j' where supp_code = '1';
update supplier set supp_type = 'm' where supp_code = '1';
I keep getting the final result to be supp_type = 'k' where it should actually be 'm', but when i execute the mapping it shows 3 update operations, which baffled me as to how oracle handles simultaneous updates to same row. I even tried disabling parallel dml on the table object, but am unsure whether this actually helps. I try putting a sorter operator and then a key lookup operator after the sorter operator in my mapping to compare the supp_code field in the sorter with the target table's supp_code field to retrieve the relevant row to update, but instead of 3 update operations, it now updates all supp_type in all my records to NULL. Can anyone explain to me how i should go about dealing with this?Hi experts,
I just took a look at the code section generated for the key lookup operator named SUPPLIER_WH_SURRKEY01 and I feel something is wrong with the generated code. I have pasted the code section on the key lookup operator below.
ORDER BY
"SUPPLIER_CV"."RSID$" ASC ) *"SORTER" ON ( ( ( "SUPPLIER_WH_SURRKEY01"."EXPIRATION_DATE" = "SPIDERWEB2"."GET_EXPIRATI_0_EXPIRATI" ) ) AND ( ( "SUPPLIER_WH_SURRKEY01"."SUPPCODE" = "SORTER"."SUPP_CODE$1" ) ) )*
WHERE
( ( "SUPPLIER_WH_SURRKEY01"."SUPPKEY" IS NULL ) OR ( "SUPPLIER_WH_SURRKEY01"."SUPPKEY" = "SUPPLIER_WH_SURRKEY01"."SUPPKEY" ) );
Can anyone explain to me the codes in bold? I have no clue as to what it means? Furthermore, those bold-ed codes look similar to what I have expected to find in the where clause, except that instead of SUPPLIER_WH_SURRKEY01"."EXPIRATION_DATE" = "SPIDERWEB2"."GET_EXPIRATI_0_EXPIRATI", I expected to find
SUPPLIER_WH_SURRKEY01"."EXPIRATION_DATE" = '31-dec-4000', because my key lookup operator checks upon a constant with the value '31-dec-4000'. And the constant name is CONSTANT itself, while my mapping's name is SPIDERWEB2(not too sure why the generated code refers to my mapping name instead of my constant)
Edited by: user8915380 on 17-Mar-2010 00:52 -
How to update row by row in Jdbc Adapter sender ?
Hi friends ,
No i am reading data from a table using select query and resulting data i am keeping in the FTP folder as XML File.
I want to
1. to know how many rows i read ?
2. Update the read completed time in each row of the sender side table .
( I am using <b>select * from a table where tag='n' </b> . I am giving this in <b>Query SQL Statement</b> of JDBC Sender adapter processing parameter .
I am writing update query as update table set tag='y' where tag='n' .
Will it perform row by row ?
3. Insert in to another R3 System table the rows which i read as a log .
Can you please give procedure to do that .
Expecting your reply asap .
Thank you
Best Regards.,
V.RangarajanHi raj ,
Thanks for ur reply . I am new to xi . Just i am doing a scenario . I can able to read the ms-sql server table data using jdbc Sender adapter .
Can i use RFC Adapter to insert the values to R3 table ?
If i have mapped to rfc fields will it store into the table once we read the data from ms_sql server table using select query of JDBC Sender Adapter ?
Best Regards
V.Rangarajan -
Sql server if the row exist it update if the row new won't update
I am
working with Asp.net and C# and using SQl Server, I insert a row in one plase and works fine but when I try to update the same row it woudn't do anything, I
try to update an existing row it works with the same code but not if I just
insert new row.
my code as
below:
String companyName = txCompany.Text.ToString();
SqlConnection con =
new
SqlConnection(conString);
SqlCommand cmd =
new
SqlCommand("INSERT
INTO DocUp (CompanyName)VALUES (@CompanyName)", con);
cmd.Parameters.AddWithValue("@CompanyName", companyName);
try
con.Open();
cmd.ExecuteNonQuery();
catch (Exception
er)
Response.Write("<script language='javascript'>alert('Connection Problem On Insert');</script>");
finally
con.Close();
string strQuery =
"UPDATE DocUp SET
QuoteFileName=@QuoteFileName, ContentType=@ContentType, QuoteFileData=@Data WHERE CompanyName=@Company";
SqlCommand cmd =
new
SqlCommand(strQuery);
cmd.Parameters.Add("@QuoteFileName",
SqlDbType.VarChar).Value = filename;
cmd.Parameters.Add("@ContentType",
SqlDbType.VarChar).Value =
"application/pdf";
cmd.Parameters.Add("@Data",
SqlDbType.Binary).Value = bytes;
cmd.Parameters.Add("@Company",
SqlDbType.VarChar).Value = companyName;
InsertUpdateData(cmd);
private
Boolean InsertUpdateData(SqlCommand
cmd)
String strConnString = System.Configuration.ConfigurationManager
.ConnectionStrings["S7V001_11022014ConnectionString1"].ConnectionString;
SqlConnection con =
new
SqlConnection(strConnString);
cmd.CommandType = CommandType.Text;
cmd.Connection = con;
try
con.Open();
cmd.ExecuteNonQuery();
return
true;
catch (Exception
ex)
Response.Write(ex.Message);
return
false;
finally
con.Close();
con.Dispose();Please use the "Insert code block" button to insert *readable* code blocks
try{
con.Open();
cmd.ExecuteNonQuery();
return true;
You have not shared what query/functions that you are using to insert data. Please share.
Also it looks like more like a .Net related questions, (and if you agree, ) I would recommend posting the question in .Net forum
http://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=csharpgeneral
Also I would recommend you to read "How to ask questions in Technical Forums" from the below link
Satheesh
My Blog |
How to ask questions in technical forum -
I want a user to only be able to update/delete the rows they inserted
hi guys,
I have a table 2 users are inserting into. They can also update/delete the rows in the table. However, I do not want them to be able to update/delete the others users row. I only want them to have update/delete at the row level.
how can this be achieved?
thanksAnother idea if you really have just two (or a fixed set of N) users.
Does your table have a generic primary key (PK)?
You could use two (N) sequences having two (N) distinct sets of numbers as e.g user a is using sequences less than 1000000000, the other one values larger or equal to 1000000000.
create sequence <user_a>.pk_seq start with 0;
create sequence <user_b>.pk_seq start with 1000000000;An insert trigger uses <user_a>.pk_seq or <user_b>.pk_seq for generating the PK depending upon the current user for new records.
An update trigger allows updates only, if the PK of the record to be updated is in the range of sequences belonging to the current user. -
Tabular form - Different LOV for different rows
In a tabular form column, is it possible to have a select list whose values depend on some other column in the row? There doesn't appear to be a way to use #COL# notation to refer to current row values in the LOV query definition.
Ideas? ThanksHi Scott,
Thanks ..I formed some idea about APEX_UTIL.KEYVAL_NUM. I have a problem where I am not able to decide if I can make use of this package and solve..
Can you please have a look at this thread.. Re: Tabular form - Different LOV for different rows
I have a SQL which populates a tabular form on the page.Coulmn1 some text, Column 2 is to show a drop down as YES and NO. i am trying to freeze the option for rows 2,3,4 as NO, if the Option choosen in first is NO.
So, what I am trying to ask is..can I save my first selection in a global variable and use it in where clause of [select list query] the second drop down..Not sure how I can do this..Appreciate if you can show me a direction.
Thanks,
Chaitu. -
Updating billions of rows from historical data
Hi,
we have a task of updating billions of rows from some tables ( one at a time ) for some past DATE's.
Could you please suggest what would be the best approach to follow in such cases where simple UPDATE statements would take dont know how much time.
The scenario is something like this..
TEST table.
col1 col2 col3
Now we added one more column col4.
Now all the records in this table needs to be updated for col3=col4 values for past data ( past in the sense the time when this will be executed in the Prodn DB, the sysdate-1 will be past data)
I thought of using FORALL kind of clause but still I dont know if that is going to be useful completely or not.
I am using Oracle 10g rel 2 version
Plase give me your expert opinions on this scenario so that the script to update such a voluminous data can execute successfully with better performance.
Thanks,
AashishHi Mohamed,
thanks for your help.
However, in my case, its not possible to drop and recreate the table only to update single column for values in another column.
I am trying to do some POC for this using BULK UPDATE but I am not able to do so...
I did something like this to check for 50,00,000 records.
create table test
( col1 varchar2(100),
col2 varchar2(100));
inserted 50,00,000 records to col1 column of this table.Now when I tried to do something like
declare
CURSOR s_cur IS
SELECT col1
FROM test;
TYPE fetch_array IS TABLE OF s_cur%ROWTYPE;
s_array fetch_array;
begin
OPEN s_cur;
LOOP
FETCH s_cur BULK COLLECT INTO s_array LIMIT 10000;
FORALL i IN 1..s_array.COUNT
UPDATE TEST
SET col2 = s_array(i); -- dont know if this is correct
EXIT WHEN s_cur%NOTFOUND;
END LOOP;
CLOSE s_cur;
COMMIT;
END;It gives me some error.
Can you please correct me in this?
Still I am looking for better way...
Rgds,
Aashish -
How to update the restricted rows that were selcted using fetch
Hi
I have to fetch one row at a time from my staging table using JDBC Sender Adapter, which is configured against AS400 DB2 and push it to R/3.
The select SQL looks like this in JDBC Sender Adapter
<b>select jedata, oxruns from fxjrnep2 where oxsts=' ' fetch first 1 rows only</b>
and
update sql is
<b>update suplib.FXJRNEP2 set OXSTS='SUC' where OXSTS=' ' </b>
The problem here is my select gets one row, which is what i want, but my update actually updates all the rows that satisfied the where condition oxsts=' ' instead of one.
I couldn't use <b>fetch first 1 rows only</b> at the end of the update sql to update the selected row. DB2 does not allow fetch in update sql.
Can anyone suggest solution here or recommend alternative?
Best Regards
Venkatcheck for update query where u can club the select stmt u had used with udpate like:
update suplib.FXJRNEP2 set OXSTS='SUC' where OXSTS = (select jedata, oxruns from fxjrnep2 where oxsts=' ' fetch first 1 rows only
just need to try combinations of this type.
if still this is not working use a bpm and get all the records where OXSTS is null and process record one by one within a block -
Insert a field and update the same row.
Hi,
I am inserting a value in a row.
And later within a cursor loop I am trying to update the same row. But it is not working....
CREATE OR REPLACE procedure Del_Note_stage
Is
v_delNote Delivery_Note.Delivery_Note_id%type;
Cursor C1 is Select Heading_Name,File_Data from Sqlload_Stage;
Begin
dbms_output.put_line('i am here a ');
Select Delivery_Note_Id_Seq.nextval into v_delNote from dual;
Insert into DELIVERY_NOTE_STAGING(Delivery_Note_ID,LUT,LUB,PROCESSED) Values(v_delNote,sysdate,'Config','N');
commit;
dbms_output.put_line('i am here b'||v_delNote);
For sqlload_rec in C1
Loop
dbms_output.put_line(sqlload_rec.Heading_Name);
dbms_output.put_line('Del Note Id is :'||v_delNote);
update DELIVERY_NOTE_STAGING set deployed_by='TOM' where delivery_note_id=v_delNote;
End loop;
End;But it is not working....Why not?
Please read: http://tkyte.blogspot.com/2005/06/how-to-ask-questions.html
Why are you updating after inserting?
Just add deployed_by to the insert statement, or use a default value for that column.
Also you don't need to select your Delivery_Note_Id_Seq.nextval from dual, just use it in your insert statement.
Something like:
Insert into DELIVERY_NOTE_STAGING(Delivery_Note_ID,LUT,LUB,PROCESSED,deployed_by )
Values( Delivery_Note_Id_Seq.nextval,sysdate,'Config','N', 'TOM' /*or USER*/); -
Master detail forms..increase the detail rows by clicking a button
hi all,
i have a problem, in my master detail form i have set the details rows as 8. can i give an option to the user such as a button, on clicking which he can increase the number of detail rows by say 2 or 3.
can any one help me out on this???
Thanks in Advance
RajeshHi Rajesh,
This is not posible in the current model of the portal forms , the no of detail rows can be set only at the design time.
rahul -
Select for update returns no rows even though there is no locking thread
I'm using Ibatis library over oracle sql for my query. The select for update statement returns no rows. This happens intermittently. When this was happening last time, I executed the select statement on sqldeveloper (but without the 'for update') and got rows. This situation is not easily reproducible so I've not yet been able to ascertain whether rows are returned on sqldeveloper with the 'for update' clause. But I know for sure that there was no other thread locking the rows. How could this be happening?
The select for update statement returns no rowsWhy do you think that a select for update will always return rows?
the for update clause if there not to garantee the presence of rows but to lock the row when it is present
sql> select * from t;
A B C
1 1 step1
2 2 step2
3 3 step3Then session 1 issues the following select
SELECT *
FROM t
WHERE a = 1
FOR UPDATE NOWAIT;If session 2 issues the same select before session 1 commits or rolls back
SELECT *
FROM t
WHERE a = 1
FOR UPDATE NOWAIT;It will get the following error
ERROR at line 1:
ORA-00054: resource busy and acquire with NOWAIT specifiedBut if session 2 issue such a kind of select
sql> SELECT *
2 FROM t
3 WHERE a = 99
4 FOR UPDATE NOWAIT;
no rows selectedYou see then that a select for update can return no rows
Best Regards
Mohamed Houri
Maybe you are looking for
-
Will not retrieve incoming emails. When I try to send one, error message appears: "Sending of message failed. The message could not be sent using SMTP server smtp.ullisart.com for an unknown reason. Please verify that your SMTP server settings are co
-
Okay, so I am NOT the most tech-savvy girl so please excuse me if I'm sounding really stupid... I have a mac book pro (2 years old). I like to download podcasts on my iphone and I guess they then sync via iTunes cos they appear on my mac book pro as
-
Hi All, I am trying to do the client proxy scenario, my scenario is to fetch the material data from R/3 and place it in a file. from material master i am taking 4 fields data matnr,mbrsh,mtart,meins and created a program to fetch the data for those f
-
Setting focus in JOptionPane.showInputDialog
Hi! For usability I want to set the focus to the dialog that pops up if i call JOptionPane.showInputDialog(...). Someone an idea how this works? cu
-
Expresscard 34 e-sata + Snow Leopard+My book
Expresscard 34 e-sata+Snow Leopard+My book...anyone know of a express card that is working in the configuation? Thanks!