How do i Batch Update the table by reading .txt file
HI All,
Suppose we are going to update a database table for a number of records; the record IDs are stored in a text file and may be tens of thousands.
Regards,
Krishna
HI Bajaranglal,
Thanks for your response. I have thousands of records in a text file. Read the file and update the database table.anyhow i resolved the problem.
Hay are you from orissa? if so, please let me know from which place?
Thanks & Regards,
Krishna
Similar Messages
-
How to export from a mysql table into a txt file?
I an trying to export the result of a select query into a txt file, and I used the command:
SELECT * INTO OUTFILE "D:\OUTFILE.TXT" FROM USERS;
It replies: access denied.
Do I need some special privilege to do the operation? Or is there anything wrong with the command? Can anybody please help me?I tried the statement and it worked for me.
SELECT * INTO OUTFILE "C:\OUTFILE.TXT" FROM `certificationtype`
If I did it on the drive MySQL was installed on (C:) and the file ended up in the directory C:\mysql\data.
SELECT * INTO OUTFILE "D:\OUTFILE.TXT" FROM `certificationtype`
If I did it to drive D: it ended up in the root.
Note the command will fail if the output file exists.
Do you have rights to the root of d:?
rykk -
How to update the table value in the valuechange event?
I have an input field in the datatable with the valueChangeListener
<rich:dataTable id="cart" value="#{cart.cartList}" var="item">
<h:inputText value="#{item.cost}" id="qty" valueChangeListener="#{items.updateCost}" onchange="submit()">
<h:outputText value="#{item.errorMsg}"> </h:outputText>
in the backing bean
Item item = (Item) model.getRowData();
// do some update, if the cost too larger, change to max_cost
item.setCost(max_cost);
item.setErrorMsg("Error Msg");
After calling the valuechange method, the screen output doesn't update the cost.
How to update the table value in the valuechange event?As you're misusing the valueChangeListener to set another input field, you need to skip the update model values phase. Otherwise the value set in the valueChangeListener will be overridden by the submitted value. You can do this by calling the FacesContext#renderResponse() inside the valueChangeListener method. This will shift the current phase immediately to the render response phase, hereby skipping the update model values and invoke application phases.
-
How to update the table when change list item in classic report
hi ,
i worked with apex 4.2 and i create normal classic report with one select list(named loved)Column ,now i want to update table when user change the list with new value ,i can't create dynamic action to do this,i create check box with primary key and loop for check item to update the table but i can't get the value of list item. and for more speed the user want to do this when change the list value.
my question
1- how to do this by javascript and get the value from list item and update the table with new value
2- is i must use API to create list item so i can get the value of item in report or what.
Thanks
AhmedI coded the following to give you direction:
1. In the "Element Attributes" section of the DEPTNO column, I call a javascript function as:
onchange = "javascript:updateTable(this);"2. I wrote a simple javascript function that shows an alert when the user changes the select list as:
<script language="JavaScript" type="text/javascript">
function updateTable(pThis)
var vRow = pThis.id.substr(pThis.id.indexOf('_')+1);
alert('Row# - '+ vRow + ' has the value - ' + pThis.value);
</script>Now, you can call a AJAX on-demand process inside the javascript function to update the database value. -
How to write a procedure for update the table
Hi all
can any body please tell me how to write a procedure to update the table......
I have a table with about 10,000 records...........Now I have add a new column and I want to add values for that like
registration Code Creidits
13213 BBA
1232 MCS
I had add the creidit now i want to update the table.........the new value want to get by SQL like
Creidit = select creidit from othere_table...........
Hope u can understand my problem
Thanks in advance
Regards
Shayan
[email protected]Please try the following --
update Program_reg a
set TotalCreidit = ( select tot_cr <Accroding to your logic>
from Program_reg b
where a.Registration = b.Registration
and a.Enrollment = b.Enrollment
and a.code = b.code
where a.Registration in ( select distinct Registration
from Program_reg );
N.B.: Not Tested....
Regards.
Satyaki De. -
How to find program/TCODE which has updated the tables
Hi All,
Is there any way to find out program or transcation which has updated the tables.
BR
Kamalyou can see in the table CDHDR or CDPOS which will give you the transaction code and program names.
Regards,
Krishna -
Code To Update the Table in ECC from Webdynpro
Hi All,
I want to know, the table is dispalyed in the webdynpro browser when we calls the Adaptive RFC Model.
after i want to add one more row in the webdynpro and just clicking on add button the row will be updated in the ECC server(backend) for that how can i write the coding, regarding this issue can you please help me.
ThanX All,Hi Sriram,
Assuming you have a table filled with records by adding one by one, If you want to update a table in SAP ECC, follow these steps.. i think already you are triggering the action for the button in view(for table updation) to method in controller or created a custom controller and mapped the model node.
1. Initialize the main model node and bind the model node with the intialised object like
Zbapi_MainModelNode_Input input = new Zbapi_MainModelNode_Input();
wdContext.nodeZbapi_MainModelNode_Input ().bind(input);
2. Now loop the table node and set the values with corresponding class in the generated model (from webdynpro explorer) and initialize like
IPrivateControllerName.ITableElement myTab = null;
for ( int i = 0; i < wdContext.nodeTable().size();i++)
myTab = this.wdContext.nodeTable().getTableElementAt(i);
Bapi_structname name = new Bapi_structname();
name.setFieldName1(myTab.getFieldName1);
name.setFieldName2(myTab.getFieldName2);
input.addT_Bapi_(name);
Finally execute the BAPI..
wdContext.currentZbapi_MainModelNode_Input tElement().modelObject().execute();
Hope this solves your issue - Update the Table in ECC from Webdynpro.
Regards,
Manjunath
Edited by: Manjunath Subramani on Nov 20, 2009 4:26 PM
Edited by: Manjunath Subramani on Nov 20, 2009 4:27 PM -
FM to update the table HRPAD25
Hi All,
Is there any FM to update the standard table HRPAD25? I need to update the values entered by the user on the LSO Followup screen in this Table. I have enhanced this screen in LSO_PSV2 with an additional field 'Score'. How do i update the table HRPAD25? Is there any BADI or FM to do this. Any input on this will be of great help.
Thanks and regards,
PavithraHi Eric,
I do have some similar kind of requirement where in i am asked to use the IDOC COND_A02. The point where i am stuck is in populating the custom segment field values which we need to be passed with the IDOC. I am able to execute the IDOC from WE19 but both the exits EXIT_SAPLVKOE_001 and EXIT_SAPLVKOE_002 were not getting triggered.
We need this IDOC to be generated whenever there is a change in the Pricing Conditions (PB00 DISC1 DISC2). Please let me know how can i populate the custom segment values and trigger the IDOC.
Good Day,
Thanks & Regards,
Uday S. -
How to compare two table and update the table.
I have table A where i have
Table A
select ssn,lname,fname,dob,cadcode,date... from table A
SQL> /
LNAME FNAME DOB SSN Status SOCKETNO
King Jack 11111877 000000000
Sue PAT 01021867 087543217
Smit john 08061897
Table B
SOCKETNO SSN LNAME FNAME DOB CADCODE
C873 000000000 Sue Pat 03021988 C111
C123 Kate Allen 01011999 V111
D009 123987765 King Jack Y123
K897 678987765 Mike Mellon 01111877 V178
I have to compare two table based on the below conditions and update table A With Status =Y and SOCKETNO from table B if a matching record exists in Table B.
condition If SSN from Table A to table B matches OR
if SSN IS NULL OR ALL zeros then compare with FNAME and LNAME and DOB
How can i achive this in a stored procedure?Hi,
You have to make PROCEDURE anyway, you can use CURSOR as per your requirement.
The sample code can look like this:
CREATE OR REPLACE PROCEDURE UPDATE_A (PARAMS.....) IS
CURSOR Cur_SOCKET IS SELECT B.SOCKETNO, B.FNAME, B.LNAME, B.SSN, B.DOB
FROM A, B
WHERE (NVL(A.SSN,0) != 0
AND NVL(B.SSN,0) != 0
AND A.SSN = B.SSN)
OR ( NVL(A.SSN,0) = 0
AND NVL(B.SSN,0) = 0
AND A.FNAME = B.FNAME
AND A.LNAME = B.LNAME
AND A.DOB = B.DOB)
FOR UPDATE OF A.SOCKETNO, A.STATUS;
Var_SOCKET Cur_SOCKET%ROWTYPE;
Old_Var_SOCKET Cur_SOCKET%ROWTYPE;
BEGIN
OPEN Cur_SOCKET ;
LOOP
FETCH Cur_SOCKET INTO Var_SOCKET ;
EXIT WHEN Cur_SOCKET%NOTFOUND ;
IF Cur_SOCKET%ROWCOUNT = 1 THEN
UPDATE A
SET STATUS = 'Y',
SOCKETNO = Var_SOCKET.SOCKETNO
WHERE CURRENTOF Cur_SOCKET ;
ELSIF (NVL(Old_Var_SOCKET.SSN,'X') = NVL(Var_SOCKET.SSN,'X') AND
NVL(Old_Var_SOCKET.FNAME,'X') = NVL(Var_SOCKET.FNAME,'X') AND
NVL(Old_Var_SOCKET.LNAME,'X') = NVL(Var_SOCKET.LNAME,'X') AND
NVL(Old_Var_SOCKET.DOB,'X') = NVL(Var_SOCKET.DOB,'X')) THEN
INSERT INTO A (....FIELDNAMES...) VALUES (.....VALUES....) ;
END IF ;
Old_Var_SOCKET.SSN = NVL(Var_SOCKET.SSN,'X') ;
Old_Var_SOCKET.FNAME = NVL(Var_SOCKET.FNAME,'X') ;
Old_Var_SOCKET.LNAME = NVL(Var_SOCKET.LNAME,'X') ;
Old_Var_SOCKET.DOB = NVL(Var_SOCKET.DOB,'X') ;
END LOOP;
CLOSE Cur_SOCKET;
END ;Regards,
Arpit -
Doing new JTable doesn't "update" the table on the screen
Hello
I am writing a program in java/swing which has several "layers" of panels. In the constructor method of the frame (using JInternalFrame) I create a new instance of JTable, place it inside JScrollPane which is then inside JSplitPane and then place that as the frame content pane.
In this program I run an sql command and the table is the result from that. Every time I execute a query it should update the table with the new results.
What is bothering me now is that when I execute a query I call new JTable() on the variable that held the JTable() object created on startup. When I create a new instance of JTable() and place it in this variable nothing seems to happen. What I need is some kind of "refresh" button. I tried to construct the whole window again but then the program started behaving odd so I gave up that method.
So, does anyone know how to do this?
The code behind this class can be found at http://www.heilabu.net/kari/Session.java (little commented, sorry :/)
You can see the table being constructed in the constructTable() method.
If I am a bit unclear I apologize, don't know all these technical words in english ;)
Thanks in advance!You really need to use a table model. The table you created is great and once that is in you shouldn't mess with it. Instead, when you create the table be sure to create it sort of like this:
DefaultTableMode dtm = new DefaultTableModel(<various constrcutors use the one suited for you>);
JTable table = new JTable(dtm);
To set different data on the table set it in the table model and then refresh the table, also through the table model. This works perfectly every time.
dtm.setDataVector(---) <- 2 methods, one for vectors and one for arrays...
dtm.fireTableChanged();
the folowing code shows exactly how to use it
import java.awt.*;
import java.awt.event.*;
import java.util.*;
import javax.swing.*;
import javax.swing.table.*;
public class RandomTable extends JFrame
GridBagLayout gbl = new GridBagLayout();
JPanel buttonPanel = new JPanel(gbl);
JTable table = null;
DefaultTableModel dtm = null;
JScrollPane tableSP = new JScrollPane();
JButton randomButton = new JButton("Randomize");
Object[] headers = { "a", "b", "c", "d", "e" };
public RandomTable()
this.getContentPane().setLayout(gbl);
randomButton.addActionListener(new ActionListener()
public void actionPerformed(ActionEvent evt)
dtm.setDataVector(randomStrings(), headers);
this.dtm = new DefaultTableModel();
this.table = new JTable(dtm);
this.dtm.setDataVector(randomStrings(), headers);
this.tableSP.getViewport().add(table);
this.buttonPanel.add(randomButton, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
this.getContentPane().add(buttonPanel, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(3, 6, 6, 6), 0, 0));
this.getContentPane().add(tableSP, new GridBagConstraints(1, 1, 1, 1, 1.0, 1.0,GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(6, 6, 3, 6), 0, 0));
this.setSize(300, 300);
public Object[][] randomStrings()
Random rand = new Random();
int rowCount = Math.abs(rand.nextInt())%50;
int colCount = headers.length;
Object[][] array = new Object[rowCount][colCount];
for(int row = 0; row < rowCount; row++)
for(int col = 0; col < colCount; col++)
array[row][col] = Long.toString(Math.abs(rand.nextLong())%100);
return array;
public static void main(String[] args)
RandomTable rt = new RandomTable();
rt.setVisible(true);
} -
How to delete/drop all the tables from SQL Server Database without using Enterprise Manager?
I tried using DROP Tables, Truncate Database, Delete and many more but it is not working. I want to delete all tables using Query Analyzer, i.e. through SQL Query.
Please help me out in this concern.
Nishith ShahInformative thread indeed. Wish I saw it early enough. Managed to come up with the code below before I saw this thread.
declare @TTName Table
(TableSchemaTableName
varchar
(500),
[status] int
default 0);
with AvailableTables
(TableSchemaTableName)
as
(select
QUOTENAME(TABLE_SCHEMA)
+
+
QUOTENAME(TABLE_NAME)
from
INFORMATION_SCHEMA.TABLES)
insert into @TTName
(TableSchemaTableName)
select *
from AvailableTables
declare @TableSchemaTableName varchar
(500)
declare @sqlstatement nvarchar
(1000)
while 1=1
begin
set @sqlstatement
=
'DROP TABLE '
+ @TableSchemaTableName
exec
sp_executeSQL
@sqlstatement
print
'Dropped Table : '
+ @TableSchemaTableName
update @TTName
set [status]
= 1
where TableSchemaTableName
= @TableSchemaTableName
if
(select
count([Status])
from @TTName
where [Status]
= 0)
= 0
break
end -
i have apps to be updated but when i try to update them a message pops out saying "You have updates for other accounts, please sigh in with the other id". Can some one help me how can i still update the same with the new apple id ive created. As i dont have the access to the earlier id anymore.
You cannot. The apps are assigned to that Apple ID and there is nothing you can do to change that. You could choose to download them again with the new Apple ID, any paid apps will need to be purchased again.
Hope that helps. -
How do i find out the tables (data)effected in a schema after a particular time stamp
how do i find out the tables (data not structure)effected in a schema after a particular time stamp?
pls email in [email protected]You can't do that. That would be a real security risc.
/KAj -
How do i find out the tables effected in a schema after a particular time stamp
how do i find out the tables effected in a schema after a particular time stamp?
pls email in [email protected]If you are doing a reload every time then you can issue following commands to clear data from cube.
lmt name to all
allstat
clear all from <cubename>prttopvar
You can wrap above commands in pl sql procedure using dbms_aw.execute package and execute it before cube load starts. Instead of clearing it from whole cube you can clear only from one partition also. Just take a look at clear command in olap DML 10.2 reference.
Thanks,
Brijesh
Edited by: Brijesh Gaur on Aug 10, 2010 6:47 AM -
Error updating the table condition table 372 in J1IIN
Hello all,
I am facing the problem in the transaction code J1IIN (In CIN).
I have maintained the condition type JEXP ( A/R BED %) as 16% with the Key combination Country/Plant/Control Code (Table 357). While iam saving the Excise invoice the system is throwing the error like Error updating the table condition table 372
I have gone through the post given by Ms. Jyoti few days back and tried to do some changes in the customisation.
I tried to maintain a different access sequence for the condition type JEXP i.e In the access sequence except condition table 372, I have maintained all other condition tables.
Still the error is persisiting. Can anyone put some light on the issue.
I have even traced the values being hit in the tables directly. There is no relation of table 372, then why is it being cause of the error.
Gurus plz give ur suggestions.
Thanks
SrinivasHello Srinivas/Sandeep
Please ensure that access sequence in the condition type JEXC has got the table 372. If it is not there please maintain it.
The standard access sequence used in all duty condition type
is JEXC which has got the table 372 this will get updated once
you save your excise invoice.
If the issue is resolved, kinldy close the message.
Regards
MBS
Maybe you are looking for
-
It's one of these External Hard Drives. I go to the Finder folder and go to the "Seagate Backup Plus Drive" to see what's in there and what I assume is that backups but the only thing that seems to be in there is folders from everything that is Deskt
-
Hi Guys. We are in the process of using BTH add-on and Payment Engine add-on for Bank STatement Processing. While initialising the Set up in House Bank Accounts system is asking to import file name but i didnt find any file format there. Will u guys
-
Function module or BAPI for Project and Partner in PS
Hi, Can anyone tell me is there any function module or BAPI that link with Project/WBS and Partner. Thanks in advance, Krishna
-
Won't recognize my CD burner ...
I was trying to burn a CD from windows media player and just today, after installing Itunes, etc., my computer doesn't recognize that I even have a burner ... Man, this Ipod/tunes stuff has been difficult to use so far ... Any help for me please ?? D
-
SuperDrive Won't Read Discs at all
When i insert a disc into the built-in drive from pioneer, the disc spins, but after a while the drive just ejects the disc and wont read. How do i fix this?