Update a table from a view
I'm a newbie and I would like any suggestions and help with my problem.
I have a view, m_jobs, that is based on the view, sys.dba_jobs. I want to add a two fields, user_id and update, to keep track of user who is adding and modifying scheduled jobs. So I decided to create a table which has the two new fields and the same fields from m_jobs. I populated my new table with the values from m_jobs, but since I created a table, the values aren't always updated. How can I update the table whenever the values in my view change? Do I create a trigger for that and how would that go? Thanks in advance.
-Kristine
I interpret the question differently:
A view is nothing more than a select statement on other tables. you cannot put triggers on it since it does not contain data (with the exception of 'instead of'-triggers, but they have a different meaning). What you should do is put a trigger on the underlying table(s) that dba_jobs is querying. That trigger should then populate your table.
However, this is not recommended since it might interfere with Oracle normal operation (if your trigger fails (e.g. when your table is dropped), the original insert into the underlying dba_jobs table by Oracle will also fail potentially resulting in nasty problems with Oracle.
Alternatively, you could make a job that checks for changes in the data and maintains the table. Or see if auditing can help (don't know if that is possible on Oracle internal tables).
Hope this helps,
L.
Similar Messages
-
Update a table from a view (WITH)
Hello,
Is the below valid? Can I update table1 from table2 (view)?
Oracle is 9i
UPDATE
WITH t2 AS (
SELECT....................
SELECT t1.name n1, t2.name n2
FROM cell_info t1, t2
WHERE t1.cell = t2.cell
AND t1.name IS NULL
SET n1 = n2;
SQL Error: ORA-01732: data manipulation operation not legal on this view
01732. 00000 - "data manipulation operation not legal on this view"Hi,
there are cases where you can update an inline view :Scott@my10g SQL>create table t1 as select level id, chr(96+level) val
2 from dual
3 connect by level <= 6
4 /
Table created.
Scott@my10g SQL>create table t2 as select level id, cast(null as varchar2(30)) val
2 from dual
3 connect by level <= 6
4 /
Table created.
Scott@my10g SQL>alter table t1 add constraint t1_pk primary key (id);
Table altered.
Scott@my10g SQL>alter table t2 add constraint t2_pk primary key (id);
Table altered.
Scott@my10g SQL>select * from t1;
ID VAL
1 a
2 b
3 c
4 d
5 e
6 f
6 rows selected.
Scott@my10g SQL>select * from t2;
ID VAL
1
2
3
4
5
6
6 rows selected.
Scott@my10g SQL>update (
2 select t1.id, t1.val t1val, t2.val t2val
3 from t1
4 join t2
5 on t1.id=t2.id
6 )
7 set t2val=t1val
8 /
6 rows updated.
Scott@my10g SQL>select * from t2;
ID VAL
1 a
2 b
3 c
4 d
5 e
6 f
6 rows selected. -
Is it possible to update internal table from database table
Hello All:
I know how to update database table from internal table in one shot (batch) but is the reverse possible? Can I update some fields in an internal table from a database table in one shot (without looping) because my internal table is huge? Could you please provide me any ideas how to acheive something like this? Thanks in advance and answers will be rewarded.
thanks.
MithunHello my friend,
You can do it MAYBE , i think you can reverse the update doing a ROLLBACK, but only after you update....not after the program finishes..
To update some fields at once use:
UPDATE DBTABLE FROM TABLE IT_TABLE
Hope this helps!!
Gabriel -
Hi, Bapi or function module to update RBCO table from an internal table.
I have a requirement to update RBCO table from an internal table. is there any Bapi or function module or any other method other than update, modify statements.
Moderator message: Welcome to SCN!
Moderator message: please do more research before asking, show what you have done yourself when asking.
[Rules of engagement|http://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement]
[Asking Good Questions in the Forums to get Good Answers|/people/rob.burbank/blog/2010/05/12/asking-good-questions-in-the-forums-to-get-good-answers]
Edited by: Thomas Zloch on Jul 12, 2011 12:28 PMI don't know if any FM exists for your requirement. But you may like to copy it into a custom table and modify it according to your enterprise needs.
-
Need to update table from Maintenance view (Very Urgent !!!)
Hi Abap Guru's,
I got a requirement where in I need to create a new Zprog so that it shld give a call to view v_abc and thru this view I need to update the table abc if any duplicate entries are entered then I shld popup a message.
Cld u plz help me out how to go further with this requirement and any suggestions...
if we create a table maintenance generator for the table abc then it will check for the duplicate entries are not ? if it checks for the duplicate entries then my job is done esaily but how to assign the zt-code to the table maintenance ?
awaiting for u r answer's and realyy appreciated with lots of points.
Regards,
Ravi V GanjiHi,
table generator will check duplicate entries as any
other table .
table maintanance Generator is used to manually
input values using transaction sm30
follow below steps
1) go to se11 check table maintanance check box under
attributes tab
2) utilities-table maintanance Generator->
create function group and assign it under
function group input box.
also assign authorization group default &NC& .
3)
select standard recording routine radio in table
table mainitainence generator to move table
contents to quality and production by assigning
it to request.
4) select maintaience type as single step.
5) maintainence screen as system generated numbers
this dialog box appears when you click on create
button
6) save and activate table
using sm30 you can create entries manually.
also check below thread to assign transaction code to
table generator
Re: Table Maintanance Generator
create transaction use se93
select parameter transaction and give below attributes
Transaction code ZTX1
Transaction text Maintain View ZSDCZTVIEW
Transaction SM30 Screen 0
From module pool
Name of screen field Value
VIEWNAME ZSDCZTVIEW
UPDATE X -
Updating base table with Materialized View's data
Hi,
In order to update base table with MVs data, I am trying real time data transfer between two databases. One is Oracle 8i and other is Oracle 9i. I have created an updatable MV in 9i on a base table using database link. The base table is in 8i. Materialized View log is created in 8i on base table. MV has to be associated to some replication group, but I am not able to create replication group in 9i to which MV has to be associated. The required packages are not installed.
Replication packages are to be used to create replication group are :
/*Create Materialized View replication group*/
BEGIN
DBMS_REPCAT.CREATE_MVIEW_REPGROUP (
gname => 'TEST_MV_GRP',
master => 'TEST_DATA_LINK',
propagation_mode => 'ASYNCHRONOUS');
END;
But above block is giving error.
Can anyone suggest how to resolve this, or are there any other approaches (by not using replication packages) to update base table with MVs data ?
Thanks,
ShaileshYes, I created link between two databases and was able to update tables on 8i from 9i database using that link.
The error I am getting while creating replication group is :
ORA-06550
PLS-00201 : identifier 'SYS.DBMS_REPCAT_UTL2@'TEST_DATA_LINK' must be declared
ORA-06550
PLS-00201 : identifier 'SYS.DBMS_REPCAT_UNTRUSTED@'TEST_DATA_LINK' must be declared
ORA-06512 : at "SYS.DBMS_REPCAT_UTL", line 2394
ORA-06512 : at "SYS.DBMS_REPCAT_SNA_UTL", line 1699
ORA-06512 : at "SYS.DBMS_REPCAT_SNA", line 64
ORA-06512 : at "SYS.DBMS_REPCAT", line 1262
Is there any other approach which can be used to update base table with MVs data instead of using replication packages ?
Thanks,
Shailesh -
How to update one table from another table?
Hi,
Please go through the case I am mentioning below and if possible try to provide with a solution.
I am working on a report to generate cash flow forecast, where in one of the fields is "Payroll", in which its being mentioned as:
In the selection screen: I am entering Project ID, profit Center and Period(in MM/YYYY format).
Selection of all entries in table COSP for selected cost elements above, value type 1, version , all periods and for all selected WBS elements and all objects underneath.
From this, update table COFP with information from COSP with value type 62 and same period.
For updation of various fields the following information is being given.
How should we update COFP?
New entries per OBJNR/PERIO and HKONT are required via using the information from COSP:
COFP-MANDT = SY-MANDT
COFP-KOKRS = if COSP-OBJNR begins with PR
Check table PRPS with COSP-OBJNR = PRPS-OBJNR and enter PRPS-PKOKR
If COSP-OBJNR begins with NV
Check table AFVC with COSP-OBJNR = AFVC-OBJNR,
go to Table AFKO with AFVC-AUFPL,
go to table AUFK with AFKO-AUFNR and enter AUFK-KOKRS
If COSP-OBJNR begins with OR
Check table AUFK with COSP-OBJNR = AUFK-OBJNR
and enter AUFK-KOKRS
COFP-BELNR = Check table NRIV, CLIENT = SY-MANDT, OBJECT = RK_BELEG,
SUBOBJECT = COFP-KOKRS, NRRANGENR = 05,
Add 1 to NRLEVEL and begin with 500000000
Use same BELNR for one update-run
COFP-BUZEI = 1 + and 1 in next entry but same update-run
COFP-TWAER = COSP-TWAER
COFP-ZHLDT = always last day of month in field COFP-PERIO
COFP-GJAHR = COSP-GJAHR
COFP-PERIO = if entry in field WKG001 à PERIO = 001
If entry in field WKG006 à PERIO = 006
COFP-WRTTP = 62
COFP-VRGNG = FIPL
COFP-POSIT = Check table SKB1 where SAKNR = COSP-KSTAR and use SKB1-FIPOS
for going to table FMCI-FIPOS and enter FMCI-POSIT
COFP-OBJNR = COSP-OBJNR
COFP-HKONT = COSP-KSTAR
COFP-WKGBTR = WKGXXX
COFP-WKGBTRO = -
COFP-WTGBTR = WTGXXX
COFP-WTGBTRO = -
COFP-WOGBTR = WTGXXX
COFP-WOGBTRO = -
COFP-BUKRS1 = -
COFP-GJAHR1 = -
COFP-BELNR1 = -
COFP-BUZEI1 = -
COFP-BUKRS2 = -
COFP-GJAHR2 = -
COFP-BELNR2 = -
COFP-BUZEI2 = -
COFP-EBELN = -
COFP-EBELP = -
COFP-ZEKKN = -
COFP-ETENRM = -
COFP-STUNR = -
COFP-LIFNR = -
COFP-KUNNR = -
COFP-GSBER = -
COFP-BUKRS = (nearly same as COFP-KOKRS!)
if COSP-OBJNR begins with PR
Check table PRPS with COSP-OBJNR = PRPS-OBJNR and enter PRPS-PBUKR
If COSP-OBJNR begins with NV
Check table AFVC with COSP-OBJNR = AFVC-OBJNR,
go to Table AFKO with AFVC-AUFPL,
go to table AUFK with AFKO-AUFNR and enter AUFK-BUKRS
If COSP-OBJNR begins with OR
Check table AUFK with COSP-OBJNR = AUFK-OBJNR
and enter AUFK-BUKRS
COFP-EINDT = -
COFP-SGTXT = -
COFP-GEBER = -
COFP-KURSF = -
COFP-KUFIX = -
COFP-GBETR = -
COFP-KURSR = -
COFP-KURSFIKRS = -
COFP-KZKRS = -
COFP-UMBKZ = -
COFP-KBLNR = -
COFP-KBLPOS = -
COFP-HI FIVOR = -
COFP-LO FIVOR = -
COFP-HI ACCOUNT = -
COFP-LO ACCOUNT = -
COFP-HI LIFNR = -
COFP-LO LIFNR = -
COFP-HI KUNNR = -
COFP-LO KUNNR = -
COFP-XDELETE = -
COFP-HI XOPVW = -
COFP-LO XOPVW = -
COFP-ZAEHK = -
COFP-CHAINBELNR = -
COFP-MWSKZ = -
COFP-LEDNR = -
COFP-BELTP = 1
COFP-VERSN = 0
COFP-OWAER = COSP-TWAER
COFP-CPUDT = SY-DATUM
COFP-CPUTM = SY-TIME
after doing updation, its again saying Selection of all entries in table COFP with value type 51 to 62, selected year, selected cost elements above and for all selected WBS elements and all objects underneath. Summarisation by period.
Now, can someone help me as how to proceed with the entire thing? An elaborate and illustrative answer would be highly appreciable.
If you require any other information....then get back to me ..asap.
Its bit urgent.
Thanks & Regards,
RaviHi
update <table> from <i_tab>
for different conditions.
loop at i_cosp.
if cosp-mandt eq sy-mandt and cosp-objnr eq 'PR'.
Read table i_PRPS with key i_PRPS-OBJNR = i_COSP-OBJNR.
if sy-subrc eq 0.
update PRPS set PKOKR = ? where objnr = i_prpr-objnr.
endif.
endif.
similarly for all the conditions
Regards
Message was edited by: Harikishore Sreenivasulu -
How to update one table from another
I am creating scripts in Oracle 10g. I have a table that has data corruption on three date fields.
I created a table with the following sql of all the affected rows:
CREATE TABLE LSU_INTER_FIX_DATE AS
select request_id,received_date,planned_start_date, actual_start_date
from lsu_inter2_requests_t
where received_date < to_date('01-JAN-1900')
OR planned_start_date < to_date('01-JAN-1900')
OR actual_start_date < to_date('01-JAN-1900')
I then repaired all of the rows with three data fixes
UPDATE LSU_INTER_FIX_DATE
SET received_date = TO_CHAR(received_date,'YY-MON') ||'-'||(TO_CHAR(received_date,'RRRR') + 2000)
where received_date < to_date('01-JAN-1900')
UPDATE LSU_INTER_FIX_DATE
SET planned_start_date = TO_CHAR(planned_start_date,'YY-MON') ||'-'||(TO_CHAR(planned_start_date,'RRRR') + 2000)
where planned_start_date < to_date('01-JAN-1900')
UPDATE LSU_INTER_FIX_DATE
SET actual_start_date = TO_CHAR(actual_start_date,'YY-MON') ||'-'||(TO_CHAR(actual_start_date,'RRRR') + 2000)
where actual_start_date < to_date('01-JAN-1900')
I now want to update the original base table with the corrected data so I wrote the following SQL UPDATE command:
UPDATE lsu_inter2_requests_t aaa
SET aaa.received_date = bbb.received_date
FROM LSU_INTER_FIX_DATE bbb WHERE aaa.request_id = bbb.request_id
When I run this sql Oracle returns the error “ORA-00933 SQL command not properly ended.” How do I update multiple rows in one table from another table that share the same primary key?Comet wrote:
I am creating scripts in Oracle 10g. I have a table that has data corruption on three date fields.
I created a table with the following sql of all the affected rows:
CREATE TABLE LSU_INTER_FIX_DATE AS
select request_id,received_date,planned_start_date, actual_start_date
from lsu_inter2_requests_t
where received_date < to_date('01-JAN-1900')
OR planned_start_date < to_date('01-JAN-1900')
OR actual_start_date < to_date('01-JAN-1900')
I then repaired all of the rows with three data fixes
UPDATE LSU_INTER_FIX_DATE
SET received_date = TO_CHAR(received_date,'YY-MON') ||'-'||(TO_CHAR(received_date,'RRRR') + 2000)
where received_date < to_date('01-JAN-1900')
UPDATE LSU_INTER_FIX_DATE
SET planned_start_date = TO_CHAR(planned_start_date,'YY-MON') ||'-'||(TO_CHAR(planned_start_date,'RRRR') + 2000)
where planned_start_date < to_date('01-JAN-1900')
UPDATE LSU_INTER_FIX_DATE
SET actual_start_date = TO_CHAR(actual_start_date,'YY-MON') ||'-'||(TO_CHAR(actual_start_date,'RRRR') + 2000)
where actual_start_date < to_date('01-JAN-1900')
I now want to update the original base table with the corrected data so I wrote the following SQL UPDATE command:
UPDATE lsu_inter2_requests_t aaa
SET aaa.received_date = bbb.received_date
FROM LSU_INTER_FIX_DATE bbb WHERE aaa.request_id = bbb.request_id
When I run this sql Oracle returns the error “ORA-00933 SQL command not properly ended.” How do I update multiple rows in one table from another table that share the same primary key?I am not convinced you have what you think you have
>
UPDATE LSU_INTER_FIX_DATE
SET received_date = TO_CHAR(received_date,'YY-MON') ||'-'||(TO_CHAR(received_date,'RRRR') + 2000)
where received_date < to_date('01-JAN-1900')
When you want to produce a DATE datatype when starting with a string,
you must use TO_DATE() on the SET line!
(TO_CHAR(received_date,'RRRR') + 2000)since when do you do add characters (from TO_CHAR) with a constant number (2000)?
You should NEVER EVER rely on implicit datatype conversion
Edited by: sb92075 on Jul 27, 2011 7:09 PM -
How to pass field symbol or table from one view to another view in abap web dynpro?
I am creating an Inbound Outbound ALV report in ABAP Web Dynpro. However at selection-screen I have select options and fetching is done at view2. Problem is we can pass parameter using inbound outbound parameters but how to pass internal table or field-symbols from one view to another view? I made use of Assistance Class too but its not very clear to me. Please give me some example or code to sort this problem out.
I am creating an Inbound Outbound ALV report in ABAP Web Dynpro. However at selection-screen I have select options and fetching is done at view2. Problem is we can pass parameter using inbound outbound parameters but how to pass internal table or field-symbols from one view to another view? I made use of Assistance Class too but its not very clear to me. Please give me some example or code to sort this problem out.
-
Updating a table from tabular form using a process
Hi
I have a tabular from creating using wizard
I've a field called Last_updated_by in the table
the username is assigned to an item P2_user based on the user who logs in.
What I need is,when any row is updated, I need to update the last_updated column with value in p2_user.
Need help on this
I'm using apex 3.2 with 11g
tried the below
declare
idx number:=1;
begin
FOR i in 1 .. wwv_flow.g_f01.COUNT
LOOP
for j in idx .. wwv_flow.g_f02.count
loop
update table_name set last_updated_by=:p2_user where ID=APEX_APPLICATION.G_F02(j);
idx:=j+1;
end loop;
END LOOP;
end;
Its updating the table,but all the rows are getting updated,just not the selected rows.
Not sure what I'm doing wrong here
thanks
Archana
Edited by: Agowda on Jan 12, 2012 1:55 AMI am looking for the same... can you please share how did you got this working
thanks -
Updating a table from a collection
I have some data in a collection that is meant to update a table
I have a string of colon delimited column names like
pk:age:height:weight
The table contains the PK and the data for column names as per the string above.
So,
c001=pk
c002=age
c003=height
c004=weight
How can I loop thru the table and create/execute a UPDATE statement that updates
those columns in a pre-specified table?
Of course using bind variables as much as possible?
Thanksthought you may do it easier by loop through collection in a process as ...
for c in (select c001 pk, c002 age, c003 height, c004 weight
from yur_collectioin
where c.pk = c001) loop
update yur_tbl set age = c.age ....
where pk = c.pk
end loop;
Or you may "loop thru the table" and update in a process as ...
for c in (select * from tbl) loop
for cc in (select c001 pk, c002 age, c003 height, c004 weight
from yur_collectioin
where c.pk = cc.pk) loop
update tbl set age = cc.age ....
where pk = cc.pk
end loop;
end loop;
Should not have mutation problem but I am not sure. Good luck.
DC -
I've a scenerio where i've to updated LIKP table, when user save the HUPAST. I've created the BDC program which update the likp table using VL02N transacton. but when i'm calling the BDC from a BADI its giving a error, as i'm trying to update the same delivery number. (Delivery already updated by user).
I'm now trying using events, i've traced an event CHANGED in object type LIKP , which is fired when HUPAST is saved.
How do i update the event changed ??? and call the bdc program from the event.
pls share .
Sanjuhi,
You can do it PAI under module USER_COMMAND. and you can use standard UPDATE/MODIFY/DELETE statements to update ur database table and make sure u use a commit work after the use of ablove mentioned statements.
kindly check this.
PROCESS BEFORE OUTPUT.
MODULE status_9010.
LOOP WITH CONTROL tab_control.
MODULE move_data_to_table.
ENDLOOP.
PROCESS AFTER INPUT.
LOOP WITH CONTROL tab_control.
MODULE move_data_from_table.
ENDLOOP.
*& Module move_data_to_table OUTPUT
This is to move the data from the internal table to the table control
MODULE move_data_to_table OUTPUT.
This is to move the data from the internal table to the table control
zmpets_mode-modecode,zmpets_range-rangeid,zmpets_servfacto-factor are column name of table control
READ TABLE int_factor INDEX tab_control-current_line.
IF sy-subrc = 0.
zmpets_mode-modecode = int_factor-modecode.
zmpets_range-rangeid = int_factor-rangeid.
zmpets_servfacto-factor = int_factor-factor.
ENDIF.
ENDMODULE. " move_data_to_table OUTPUT
*& Module move_data_from_table INPUT
Date is moved from the table control to the Internal Table
MODULE move_data_from_table INPUT.
To move the data from the table control to internal table 'INT_FACTOR'.
int_factor-modecode = zmpets_mode-modecode.
int_factor-rangeid = zmpets_range-rangeid.
int_factor-factor = zmpets_servfacto-factor.
*here if the data is there, it will modify
MODIFY int_factor INDEX tab_control-current_line.
IF sy-subrc NE 0. "data not exixting in table control . ie new data, then append it
APPEND int_factor.
CLEAR int_factor.
ENDIF.
ENDMODULE. " move_data_from_table INPUT
Also refer to this link:
http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/dbac5e35c111d1829f0000e829fbfe/content.htm
<b>Reward points if found helpful ..
Cheers,
Chandra Sekhar.</b> -
Update USR table from Java Code outside OIM
Hi,
I want to update a particular field in the USR table using the update query specifically from the java code. I dont want use updateUser api.
I have written the code which works fine for some userids. But for some user ids it gets the tcUtility object successfully but when trying to execute the update query, it throws the tcDatasetException with message as Data Access Error.
Please let me know how can i achieve this.
Also let me know the groups the userid should be member to execute a update query on OIM DB from external java code..
TIA...You are performing an unsupported process. I suggest you correctly code a connection to OIM, and perform the update correctly.
If you need to update the database directly, use jdbc java connection and run the update. You can do a google search for jdbc and java to find plenty of samples.
-Kevin -
Update cluster table from Web dynpro
Hi
I am trying to export data to a cluster table from web dynpro using this statement:
EXPORT zhr_sanct_st100 FROM zhr_sanct_st100 TO DATABASE zhr_clrm(ep) ID zhr_clrm-srtfd.
same piece of code work well if I include it in a report program through se38, but If I use it in Web dynpro, it doesnt update the cluster table and there is no error shown.
please reply ASAP.
Vishal kapoorThanks for your immediate reply. it worked this way:
IMPORT structure name TO structure name
FROM DATABASE cluster table name
TO wa_zhr_clrm
ID zhr_clrm-srtfd.
initially i missed to insert a work area wa_zhr_clrm, which has all the key fields of the cluster table.
Regards
Vishal Kapoor -
Hi I've created a matrix in a new tab on the Item Master data form. It loads data from a user table called @Test. This table has 2 udf U_Model and U_Engine. The matrix uses a datatable to query the table. Is there a way to update the table? this is my code:
// Adding a Matrix item
oNewItem = oForm.Items.Add( "Matrix1", SAPbouiCOM.BoFormItemTypes.it_MATRIX );
oNewItem.Left = 5;
oNewItem.Width = 400;
oNewItem.Top = 200;
oNewItem.Height = 150;
oNewItem.FromPane = 8;
oNewItem.ToPane = 8;
oMatrix = ( ( SAPbouiCOM.Matrix )( oNewItem.Specific ) );
oColumns = oMatrix.Columns;
// Adding Culomn items to the matrix
oColumn = oColumns.Add( "#", SAPbouiCOM.BoFormItemTypes.it_EDIT );
oColumn.TitleObject.Caption = "#";
oColumn.Width = 30;
oColumn.Editable = false;
oColumn = oColumns.Add("Code", SAPbouiCOM.BoFormItemTypes.it_EDIT);
oColumn.TitleObject.Caption = "Code";
oColumn.Width = 20;
oColumn.Editable = true;
oColumn = oColumns.Add("Name", SAPbouiCOM.BoFormItemTypes.it_EDIT);
oColumn.TitleObject.Caption = "Name";
oColumn.Width = 20;
oColumn.Editable = true;
oColumn = oColumns.Add("Model", SAPbouiCOM.BoFormItemTypes.it_EDIT);
oColumn.TitleObject.Caption = "Model";
oColumn.Width = 20;
oColumn.Editable = true;
// Add a column for Name
oColumn = oColumns.Add( "Engine", SAPbouiCOM.BoFormItemTypes.it_COMBO_BOX );
oColumn.TitleObject.Caption = "Engine";
oColumn.Width = 20;
//Add Valid Values
oColumn.ValidValues.Add("10", "");
oColumn.ValidValues.Add("12", "");
oColumn.ValidValues.Add("32", "");
oColumn.ValidValues.Add("42", "");
oColumn.ValidValues.Add("52", "");
oColumn.ValidValues.Add("62", "");
dbDatasource = (oForm.DataSources.DBDataSources.Add("@Test"));
DBTable = (oForm.DataSources.DataTables.Add("MyDataTable"));
oMatrix.SelectionMode = SAPbouiCOM.BoMatrixSelect.ms_Single;
oItem = oForm.Items.Item("5");
oEdit = ((SAPbouiCOM.EditText)(oItem.Specific));
string item = oEdit.Value.ToString();
oForm.DataSources.DataTables.Item( 0 ).ExecuteQuery( "SELECT Code, Name, U_Model, U_Engine from [@Test] where U_ItemCd = '" + item +"' ");
oColumn = oColumns.Item("Code");
oColumn.DataBind.Bind("MyDataTable", "Code");
oColumn = oColumns.Item("Name");
oColumn.DataBind.Bind("MyDataTable", "Name");
oColumn = oColumns.Item( "Model" );
oColumn.DataBind.Bind("MyDataTable", "U_Model");
oColumn = oColumns.Item("Engine");
oColumn.DataBind.Bind("MyDataTable", "U_Engine");
oMatrix.Clear();
oMatrix.AutoResizeColumns();
oMatrix.LoadFromDataSource();Hi Costas,
You can use Matrix.FlushToDataSource() to save the data in the Matrix into the datasource.
But if you want to update the data in the DB, you have to use DI API.
Regards,
Jay.
Maybe you are looking for
-
Windows Crashes with JRE 1.4.2 When Moving around JDialog
Hi! I work on a Java Applet/application that was originally written to run on java 1.1 -- only AWT that too. Recently I managed to convince my manager (and his manager and his manager) to migrate from the AWT framework on java 1.1 (Microsoft JVM that
-
How to get mail to open to newest message in mailbox
Whenever I open Mail, it defaults to showing messages from March of this year instead of the newest message. So I have to spend time scrolling down to the newest message. Is there a way to get it to open mail to the newest messages by default? Thanks
-
Converting swatches from RGB to TCX
Is there an easy way to convery the RGB colors downloaded from Kuler into TCX swatches?
-
Folder names opt at root level
May I safely delete a folder named opt, which has suddenly appeared in the root level of my drive? I know it is required by some open source applications (VPNs, for example), but I don't recall installing any software that placed it there. None of my
-
Swtich with 2 wireless routers (configuration for best practice/advice?)
HI folks, I have a gigabit switch, and 2 wireless G routers. I'll leave the model numbers out as it's fairly irrelevant - all linksys. Router 1 is used as a router only (due to location in basement) Router 2 is used for wireless only My current netw