CodePudding user response:
Insert into table2 (qy_code, qy_name zsxm_ds, SFSSQQ, SFSSQZ, ynse)The select qy_code qy_name, zsxm_ds SFSSQQ, SFSSQZ, ynse from table2 where qy_cod in (' 1 ', '2')
'1', '2' for you need to import the data
CodePudding user response:
Still did not understand to the 1, 2, I, for example, the following graph: according to the 1, 2 and what is theCodePudding user response:
Write a loop,,CodePudding user response:
CodePudding user response:
Please grant instruction!!!!!!!!!!!CodePudding user response:
Using database triggers,Business logic is also problematic,
Why keep two copies?
CodePudding user response:
Table_2 do chart analysis is established, it wants to put all the summary together, table_1 table_2 just part of the data sources, no matter how much I make, can only save above is shown in the third row, the other two rows of data can't saveCodePudding user response:
It is recommended to use triggers,CodePudding user response:
Insert data in the data window, can only be one line insertion, if so, save can only be saved when the latest row data, lz can try one line of the input data.CodePudding user response:
You can make two dw on the interface, a dw1 data link table_1, another table_2 dw2 connection, in this way, you are in the preservation, after all records in the dw1 convenience, insert dw2, finally, two dw update together,CodePudding user response:
I do is a tax return system, its different taxpayers to pay taxes is not the same, the rights of taxpayers itself is no input data, the only thing that can enter only ynse, SFSSQQ, SFSSQZ, as pictured above other system of these items are automatically according to the information of the taxpayers, so can't a a input or build two DW as upstairs said, after can only fill in the data directly to save,CodePudding user response:
I'd like to ask, what is upstairs said database triggers, and I heard that pointer can also be used to solve this problem, pointer, pleaseCodePudding user response:
Trigger is a special stored procedure, it is binding on the table, the execution of it is not by the program calls, nor the manual start, but by the event to trigger, such as when a table for operations (insert, delete, update) will activate itCodePudding user response:
If you want to set up database triggers, where should be createdCodePudding user response:
Now I use a for loop, the code is as follows (g_id g_name for global variables, q, z for local variables) :Dw_grid. Accepttext ()
R_row_count=dw_grid. Rowcount ()
For I=1 to r_row_count
R_xm=dw_grid. Getitemstring (I, 'zsxm_ds')
R_ynse=dw_grid. Getitemdecimal (I, 'ynse')
Insert into ywxxb_sz (qy_code, qy_name SFSSQQ, SFSSQZ, zsxm_ds, ynse) values (: g_id, : g_name, : q, : z, : r_xm, : r_ynse);
Next
Why or just to save a row, and this time saved is not the last line, become the first line, but when I was in the debugger found r_xm, r_ynse may due to the change of the number of rows into different content, or what my code is almost
CodePudding user response:
Establish database triggers,CodePudding user response:
Rowscopy, line between two DW copy, this is very simple, just what are you doing dw_2 try to define the field name and dw_1,,Such as dw_1 query is a select qy_code qy_name, zsxm_ds, SFSSQQ, SFSSQZ, sl, ynse from table1, the query is selectqy_code dw_2, qy_name, zsxm_ds, SFSSQQ, SFSSQZ, '0' as sl, ynse from talbe2
Dw_2 need not include in the update sl columns can be...
The use of the following is rowscopy
Datawindowchild DWC
Dw_3. GetChild (" state_id, "DWC)
Dw_1. RowsCopy (dw_1. GetRow (), & amp;
Dw_1. RowCount (), Primary! DWC, 1, Primary!)
CodePudding user response:
Now I use a for loop, the code is as follows (g_id g_name for global variables, q, z for local variables) :Dw_grid. Accepttext ()
R_row_count=dw_grid. Rowcount ()
For I=1 to r_row_count
R_xm=dw_grid. Getitemstring (I, 'zsxm_ds')
R_ynse=dw_grid. Getitemdecimal (I, 'ynse')
Insert into ywxxb_sz (qy_code, qy_name SFSSQQ, SFSSQZ, zsxm_ds, ynse) values (: g_id, : g_name, : q, : z, : r_xm, : r_ynse);
Next
Why or just to save a row, and this time saved is not the last line, become the first line, but when I was in the debugger found r_xm, r_ynse may due to the change of the number of rows into different content, or what my code is almost
/////////////////////////////////////////////////////////
Every time after insert, all seem to want to commit the, you give it a try, I also forgot,
CodePudding user response: