Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Kopiertool Java, Oracle DB brauche Hilfe!

Empfohlene Antworten

Veröffentlicht

Hallo!

Ich stell grad ein Tool im JBuilder her, was Tabellen von einer Oracle DB in eine andere Oracle DB kopieren kann. Da ich micht mit SQL Befehlen noch weniger als mit Java auskenne, brauch ich ma Hilfe. Also:

Kopieren lass ich mit folgendem Befehl:

updSQL = "INSERT INTO scott.LANGUAGE2 (ID, MENU, DEUTSCH, ENGLISCH) VALUES(" + rs.getInt("ID") + ",'" + rs.getString("MENU") + "','" + rs.getString("Deutsch") + "','" + rs.getString("Englisch") + "')";

funktioniert wunderbar, nur bei mehrfach Ausführung, werden die alten IDs etc. nicht überschreiben, sondern alles hinten dran gehängt. Ist ja auch logisch nur so solls halt nicht sein. Dann hab ich mir gedacht, da müsste es was geben, was nachschaut, ob der Eintrag schon da ist und wenn nicht gegebenfalls updatet.

Folgender Befehl:

updSQL = "UPDATE scott.LANGUAGE2 SET ID = '"+rs.getInt("ID")+"', MENU = '"+rs.getString("MENU")+"', DEUTSCH ='"+rs.getString("Deutsch")+"', ENGLISCH = '"+rs.getString("Englisch")+"'";

Nun jetzt überschreibt er alles und zum Schluss steht in der hier 256 Zeilen langen Tabelle 256 der letzte Eintrag. Auch nicht so recht das gewünschte Ergebnis.

Kann jemand helfen? Hab ich genug Infos gegeben?

Danke im voraus!

Dann häng´ doch einfach mal eine WHERE-Clausel an deinen Update-Befehl an....

Bevor du so ein Projekt angehst, solltest du aber wohl erst ein bisschen SQL pauken....

Snowghost

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.