How to update two tables at the same time using jdbc
Plz will anybody tell me what is the code or query in jdbc by which you insert entry in one table and simultaneously it goes in another table?
Thanks in advance
You might be
able to design a trigger to do what you're talking
about, but that would be a database thing, not a java
thingAnother option would be an updatable view (google for usage), but it has limitations and should be used with caution. And yes, its a database thinggy and not java.
cheers,
ram.
Similar Messages
-
Updating two tables at the same time
Please,
Does someone have an idea on how to update two tables at the same times?
Thanks a lot in advanceI was thinking about a single session and single update command.
That's why I thougth someone else could have a clue.
Thank you -
How to update two tables in a single call using JDBC Sender adapter
Hello All,
The scenario is, database entries have to be selected from two tables and at the same time those tables have to be udpated with the flag.
We are using JDBC sender adapter and in Select Query, we are fetching the data by joinin the two tables.
Update Statemtent: We can only update one table using this statement.
Is it possible to update two tables using the Update Statement without using Stored Procedures.
Let me know.
Regards,
Sreenivas.Hi Sreenivas,
> Is it possible to update two tables using the Update Statement without using Stored Procedures.
Yes its possible through join statement
Check this links
Update in JDBC Sender adapter for more than one table
data from 2 tables for jdbc sender adapter
Regards
Ramesh -
How to process two files at the same time using BPM
Hi experts,
I have a Integration Process it takes two files one Header xml and one Lines xml. These files shoudl be processed at the same time because them will be mappend in a Idoc.
The realy trouble is that these inbound xmls never are executed at the same time. Then a IP is executed for each inbound xml.
This is the IP:
http://picasaweb.google.com/hose86/SapXi#5377539387476591346
This is related documentation:
http://help.sap.com/saphelp_nwpi71/helpdata/en/cb/15163ff8519a06e10000000a114084/frameset.htm
I try to do all what I know, but It don't work fine :S
Thanks in advance and Regards,
Jose Antonio.Hi Jose,
Don't specify any end condition for fork step and check the start process check box in both the receive step.
Also put all steps inside the block.. so that the control step in deadline branch can throw exception and after that the BPM ends. As per the design now, if a deadline exception is raised (it will b handled) but after that the transformation step and send step is executed. There the BPM fails.
Regards
Suraj
Edited by: S.R.Suraj on Sep 4, 2009 5:39 AM -
Delete from two tables at the same time
Hi,
Is there way to delete from many tables at the same time ?
delete from tbl1, tbl2;
Thank you953402 wrote:
Hi,
Is there way to delete from many tables at the same time ?
delete from tbl1, tbl2;
Thank youNO
Consider to actually Read The Fine Manual below
http://docs.oracle.com/cd/E11882_01/server.112/e26088/toc.htm -
How to play two videos at the same time
Hi everyone!
Ok, so what I'm trying to do is basically play two videos, which are already saved on the computer, at the same time. I can get one video to play, but when i try to start another it just displays a blank screen.
import javax.swing.*;
import javax.media.*;
import java.awt.*;
import javax.media.protocol.*;
public class TwoVideoTest {
public static void main(String[]args) {
MediaLocator locator1 = null;
MediaLocator locator2 = null;
try {
locator1 = new MediaLocator("file:/C:/truck1.mpg");
locator2 = new MediaLocator("file:/C:/truck2.mpg");
} catch(Exception e) {
System.out.println("COULNDT CREATE LOCATORS IN MAIN TEST CLASS");
System.exit(-1);
Player player1 = null;
Player player2 = null;
try {
player1 = Manager.createRealizedPlayer(locator1);
player2 = Manager.createRealizedPlayer(locator2);
} catch(Exception e) {
System.exit(0);
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel panel1 = new JPanel();
JPanel panel2 = new JPanel();
panel1.add(player1.getVisualComponent());
frame.getContentPane().add(panel1);
frame.setSize(new Dimension(500,500));
frame.setVisible(true);
player1.start();
player2.start();
}HELLO AGAIN! I guess i post too soon....
So i modified my code and now the videos play together. Threads, sigh.
But the audio that comes with the video doesn't appear to be starting at the same time. And this problem I ASSURE you i have no clue how to handle. And yes i know, the two video audios will overlap, but this a test for heavens sake!
Anyways, heres the modified code in case it will help anyone
import javax.swing.*;
import javax.media.*;
import java.awt.*;
import javax.media.protocol.*;
public class Video implements Runnable{
String url;
MediaLocator locator;
Player player;
JPanel panel;
public Video (String url,JPanel panel) {
this.url = url;
try {
locator = new MediaLocator(url);
player = Manager.createRealizedPlayer(locator);
panel.add(player.getVisualComponent());
player.start();
} catch (Exception e) {
System.out.println("ERROR CREATING MEDIALOCATOR");
System.exit(-1);
public void run() {
try {
Thread.sleep(100);
} catch(Exception e) {}
public static void main(String[]args) {
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanel panel1 = new JPanel();
JPanel panel2 = new JPanel();
panel1.setPreferredSize(new Dimension(100,100));
panel2.setPreferredSize(new Dimension(100,100));
Thread thread1 = new Thread(new Video("file:/C:/truck1.mpg",panel1));
Thread thread2 = new Thread(new Video("file:/C:/truck2.mpg",panel2));
frame.getContentPane().add(panel1);
frame.getContentPane().add(panel2);
frame.setSize(new Dimension(500,500));
frame.setVisible(true);
thread1.start();
thread2.start();
-
How to select two things at the same time ?
Hey guys, i'm French and I need your help !
I'm working everyday on iWork and especially Pages.
How to select two parts of a text at the same time ?
Before we only need to select one, to press the "cmd" button and then to select another part. It doesn't work anymore!
Thanks for you help
and sorry for the mistakes !Hey guys, i'm French and I need your help !
I'm working everyday on iWork and especially Pages.
How to select two parts of a text at the same time ?
Before we only need to select one, to press the "cmd" button and then to select another part. It doesn't work anymore!
Thanks for you help
and sorry for the mistakes ! -
Changing the same column in two tables at the same time
Hi,
Oracle 10g2
I have 2 tables:
1. tab1 : Stores people info
2. tab2 : Stores people insurance info
Both have an address field.
What I need to do is when tab1.address is updated I want the tab2.address to update automatically and
when tab2.address is updated I want tab1.address to update.
Is there a way to do this using triggers without having these triggers mutate?
Thanks,
Oleg
Edited by: user635344 on Oct 8, 2009 11:04 AMHi, Oleg,
Centinul, Toon, Hoek and Peter are right. (It would be unusual if any one of them were wrong.)
The addresses really ought to be in one table.
If you really must have them in two (or more) tables, then don't INSERT or UPDATE addresses direectly into the tables; use a separate stored procedure, not a trigger.
If you really must use a trigger (and this means a trigger on each table), then before each trigger updates the other table, check a flag to see if the current table is being updated because of DML on the other, and, if so, do nothing. If the current table is not being updated because of DML on the other, then set the flag before doing the update.
In the example below, I used a package variable as the flag. You could also use a SYS_CONTEXT or a Global Temporary Table.
CREATE TABLE tab1
( id NUMBER
, addr VARCHAR2 (25)
DROP TABLE tab2;
CREATE TABLE tab2
( id NUMBER
, addr VARCHAR2 (25)
CREATE OR REPLACE PACKAGE pk_x
AS
-- This package contains no functions or procedures, only 1 variable:
table_of_origin varchar2 (30);
END pk_x;
CREATE OR REPLACE TRIGGER tab1_aiu
AFTER INSERT OR UPDATE OF addr on tab1
FOR EACH ROW
BEGIN
IF pk_x.table_of_origin IS NULL
THEN
pk_x.table_of_origin := 'TAB1';
UPDATE tab2
SET addr = :NEW.addr
WHERE id = :NEW.id;
pk_x.table_of_origin := NULL;
END IF;
END tab1_aiu;
CREATE OR REPLACE TRIGGER tab2_aiu
AFTER INSERT OR UPDATE OF addr on tab2
FOR EACH ROW
BEGIN
IF pk_x.table_of_origin IS NULL
THEN
pk_x.table_of_origin := 'TAB2';
UPDATE tab1
SET addr = :NEW.addr
WHERE id = :NEW.id;
pk_x.table_of_origin := NULL;
END IF;
END tab1_aiu;
/I made this example as simple as possible. Production code would be a lot more complicated (e.g., checking to see if id was changed).
I tested this using the DML statements below.
The contents of both tables is shown after each statement.
INSERT INTO tab1 (id, addr) VALUES (1, '1 First St.');
ID_1 ADDR_1 ID_2 ADDR_2
1 1 First St.
INSERT INTO tab2 (id, addr) VALUES (1, 'Forstagatan 1');
ID_1 ADDR_1 ID_2 ADDR_2
1 Forstagatan 1 1 Forstagatan 1
UPDATE tab1
SET addr = 'Primo Place'
WHERE id = 1;
ID_1 ADDR_1 ID_2 ADDR_2
1 Primo Place 1 Primo PlaceThe query that displayed the contents is:
SELECT tab1.id AS id_1
, tab1.addr AS addr_1
, tab2.id AS id_2
, tab2.addr AS addr_2
FROM tab1
FULL OUTER JOIN tab2 ON tab1.id = tab2.id
ORDER BY NVL (tab1.id, tab2.id); -
How to print two PLD at the same time
Dear Expert,
I have made two PLD on the purchase order (Page 1 & Page 2 both are the saperate PLD's)
Is there any shortcut or function available in the SBO that when I print the PLD 1 system has to print the 2 nd PLD without any cammand.
Regards,
Datta KharatHi Datta Kharat,
I think, It is not possible in SAP B1.
so, Try to Create Single PLD and Use Number of Layout Pages -> 2 in PLD.
->> Open the Require PLD.
->> Right Click in PLD and Choose the Display Document Properties.
->> Assign the Number of Layout Pages = 2 in Paper Format Tab on Document Properties Window.
Regards,
Madhan. -
How to see multiple tables on the same screen using Mac Numbers?
I'm working with a spreadsheet on Numbers (iWork '08) on my Mac. I have three worksheets that each have one table in them. I'd like to be able to see two of the tables simultaneously. Similar to the "Tile" function that I used to use in Microsoft Word. Does anyone know if something like this exists? Googled for it until I was blue in the face and went back at least 500 threads here!!!
Jon,
This will seem so easy once you get it. In the Sheets Pane, drag tables from one sheet to another until you have all three in one sheet. Then go to that sheet and arrange the tables to your liking.
I should note that you will need to make sure that the Sheet icons are expanded: click on the triangle next to the Sheet icon until it points downward and reveals the sheet content.
Regards,
Jerry
Message was edited by: Jerrold Green1 -
How to start two threads at the same time
Hi there,
I want to include multithreading in the CVI program. I have two tasks which has no dependence between them, so I would like to start two threads for perform the tasks. I follow the introduction http://www.ni.com/white-paper/3663/en/ to start my code. In my code, I add a command button, when it is pressed, I create two threads to perform the tasks. In each task, I have a big loop and in each iteration, I use ProcessSystemEvents to avoid no response on system message. But it doesn't work actually, the program suspended. I wonder must I initialize the threads in main. I am looking for a way to start the threads in the callback function for a button since I am not starting those threads at the beginning but while it is triggered.
the main frame of the code looks
int CVICALLBACK Test1(void *functionData)
{ int i=0;
for (i = 0; i<100000; i++) {ProcessSystemEvents();}
return 0;
int CVICALLBACK Test2(void *functionData)
int i = 0;
for (i = 0; i<100000; i++) {ProcessSystemEvents();}
return 0;
int CVICALLBACK cmdcb(int panel, int control, int event, void *callbackData, int eventData1, int eventData2)
{ int threadID1, threadID2;
if (event==EVENT_COMMIT)
SetPanelAttribute(panelHandle, ATTR_DIMMED, 1);
CmtScheduleThreadPoolFunction(DEFAULT_THREAD_POOL_HANDLE, Test1, NULL, &threadID1);
CmtScheduleThreadPoolFunction(DEFAULT_THREAD_POOL_HANDLE, Test2, NULL, &threadID2);
CmtWaitForThreadPoolFunctionCompletion (DEFAULT_THREAD_POOL_HANDLE, threadID1, 0);
CmtWaitForThreadPoolFunctionCompletion (DEFAULT_THREAD_POOL_HANDLE, threadID2, 0);
return 0;
Attachments:
TestThread.zip 239 KBIn my opinion your threads may be simply lasting longer than expected due to an incorrect sleep policy of threads paired with with ProcessSystemEvents () in the loop.
I made up a quick example that shows this behaviour: playing with "Do not sleep" and "Call ProcessSystemEvents" options you can see how threads execute.
BTW: do not forget to release the thread function IDs at the end of functions.
Proud to use LW/CVI from 3.1 on.
My contributions to the Developer Zone Community
If I have helped you, why not giving me a kudos?
Attachments:
thread.zip 7 KB -
How to open two projects in the same time?
I have over 40 file project. Stadium.
I am in finish of my work, but I forgot about something. I didn't notice that I lost a few keyfreme animation. I didn't realize that in 30 project and I am more over 40 right now. I made a lot of work and I can't go back to 30 project. I don't want to do this from the beginning, so I would like to COPY my keyfremes from project 3o to project 40. To do that I need to have 2 programs opens (to copy keyfremes from 30 project to 40 project). But I can't open two After Effects.
How Can I copy my keyframes on timeline?
To copy ALL of this in one turn and paste also:By FILE - IMPORT - FILE? It's just simple?
Thank you! -
How to insert into two differents tables at the same time
Hi
I'm newer using JDev, (version 3.1.1.2 cause the OAS seems to support just the JSP 1.0)
and I want to insert into two differents tables at the same time using one view.
How can I do that ?
TIA
EdgarOracle 8i supports 'INSTEAD OF' triggers on object views so you could use a process similar to the following:
1. Create an object view that joins your two tables. 'CREATE OR REPLACE VIEW test AS SELECT d.deptno, d.deptname, e.empname FROM DEPT d, EMP E'.
2. Create an INSTEAD OF trigger on the view.
3. Put code in the trigger that looks at the :NEW values being processed and determines which columns should be used to INSERT or UPDATE for each table. Crude pseudo-code might be:
IF :NEW.deptno NOT IN (SELECT deptno FROM DEPT) THEN
INSERT INTO dept VALUES(:NEW.deptno, :NEW.deptname);
INSERT INTO emp VALUES (:NEW.deptno, :NEW.empname);
ELSE
IF :NEW.deptname IS NOT NULL THEN
UPDATE dept SET deptname = :NEW.deptname
WHERE deptno = :NEW.deptno;
END IF;
IF :NEW.empname IS NOT NULL THEN
UPDATE emp SET empname = :NEW.empname
WHERE deptno = :NEW.deptno;
Try something along those lines.
null -
Drag two items at the same time
I need to drag two items at the same time using the jqueryUI draggable widget; as in I'll drag one of the items, and the other one should stick to it.
Is this possible ?Thanks for your reply. I fond a way to do this although this is not copy/paste.
1. Open "iMovie Projects" folder and find the project that contains voiceover file
2. Right click and select "Show Package Contents"
3. Drag and drop "Voiceover Recording.aiff" file to a project I want to copy/paste
In this way you don't need to use iTunes or other software to move around audio files. -
How to use the TableSorter for two tables at the same view?
Hello,
I am using the TableSorter object in order to sort Dynpro tables.
Suppose I have two tables at the same view, is it possible to use it seperatly for both of them?
I assume that at the wdModifyView method I will need to catch the table that the user clicked on, yet I don't have an idea of how to do it...Hi Roy,
Constructor of TableSorter
public TableSorter(IWDTable table, IWDAction sortAction, Comparator[] comparators)
So, you have to create instance of TableSorter class for each table on the view.
best regards, Maksim Rashchynski.
Maybe you are looking for
-
Is it possible to RESET Fixed Asset Module to the first day we installed it
Hi All, We setup our Fixed Assets module months ago and now realised that we need to have a clean FA Module, so that we can restructure it the way we need. (New categories, new assets, etc.) I was wondering if there is a concurrent program or another
-
My account got cancelled because I got a new card.. Please help
So I got a new debit card a few weeks ago, and now today I went to use my spotify, and it said I didn't have an acct, and then I realized I had got an email today saying that PayPal charged back my charge because obviously the one I had on there is n
-
Repaint() in java3d?
Hey, is there a methods in java3d who works like repaint() and paintComponent() methods? I have to draw something after click the button (points in 3D) and i have to repaint screen (first i have only axis on screen). How should I do this? this is met
-
RoboHelp 10 Compile Error: Cannot find xml definition file Template Error
Does anyone know how to resolve this error? I'm exhausted googling. I generated Webhelp and got the error below. When I View the Help, nothing displays; IE browser does not open the Help. Initializing compiler... Generating WebHelp 5.50 (10.0.0.287).
-
MV45AFZZ : GETWA_NOT_ASSIGNED
Hi, I'm getting error while sales order creation. select MANDT VBELV POSNV VBELN POSNN VBTYP_N RFMNG MEINS RFWRT WAERS VBTYP_V PLMIN