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.

MySQL Datum - Formatänderung

Empfohlene Antworten

Ich möchte aus einer Textdatei (sehr viele Datensätze) in

meine Tabelle importieren.

Dabei besteht folgendes Problem:

Datumformat in der Textdatei: dd.mm.yyyy hh:mm:ss

MySQL akzeptiert aber nur folgendes Format yyyy.mm.dd hh:mm:ss

wie kann ich das Problem lösen???

Mit welcher Sprache willst du es denn lösen?

In der Sprache Deiner Wahl musst Du die Strings, die Du bekommst, zerteilen (bei Java z.B. StringTokenizer) und stellst die Tokens um, damit sie ins Format von MySQL passen.

Alternativ könntest Du schauen, ob man MySQL ein anderes Format beibringen kann. Da kann ich Dir aber leider nicht helfen.

Peter

Hi,

kommt die Datei aus einer anderen Datenbank?

Falls ja, würde ich mir das Datum von da vernünftig ausgeben lassen.

Dann kannst du mit LOAD DATA INFILE arbeiten.

http://www.mysql.com/doc/en/LOAD_DATA.html

Ansonsten musst du das imho selbst programmieren.

Was meinst du mit "sehr viele Datensätze"?

Für mich wären das > 10 Mio. :D

Gruß Jaraz

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Konto

Navigation

Suchen

Suchen

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.