Supportnet / Forum / Datenbanken
SQL +Textdateien dorthin importieren
Frage
Tja, wie kann ich ne Textdatei (.doc oder .txt) in meine Datenbank importieren ?? Muß ich bei der DB-Erstellung irgendetwas besonderes beachten ?? Tja, Hilfe ist von Nöten ;)
Antwort 1 von abc123
Was für Datenbanksystem verwendest Du?
Was ist der Inhalt der Textdatei?
Sind die Einträge in dieser Datei irgendwie strukturiert, z.B, CSV o.ä?
Was ist der Inhalt der Textdatei?
Sind die Einträge in dieser Datei irgendwie strukturiert, z.B, CSV o.ä?
Antwort 2 von hagenstamm
mySQL
ein schlichtes unstrukturiertes word document
ein schlichtes unstrukturiertes word document
Antwort 3 von abc123
Stecke das Dokument in ein BLOB-Feld.
(BLOB = Binary Large Object)
Lese mySQL-Manual für Details und evtl. Einschränkungen von Blobs.
(BLOB = Binary Large Object)
Lese mySQL-Manual für Details und evtl. Einschränkungen von Blobs.
Antwort 4 von hagenstamm
mercyful,
werde es testen....
werde es testen....
Antwort 5 von abc123
Beachte vor allem, dass Du für viele Zeichen in einem Blob-Feld Escape-Sequenzen verwenden mußt.
Hier kleiner Auszug aus mySQL-Manual
If you write C code, you can use the C API function
`mysql_escape_string() to escape characters for the `INSERT
statement. *Note C API function overview::. In Perl, you can use the
`quote method of the `DBI package to convert special characters to
the proper escape sequences. *Note Perl `DBI Class: Perl DBI Class.
You should use an escape function on any string that might contain any
of the special characters listed above!
Viel Erfolg!
Hier kleiner Auszug aus mySQL-Manual
If you write C code, you can use the C API function
`mysql_escape_string() to escape characters for the `INSERT
statement. *Note C API function overview::. In Perl, you can use the
`quote method of the `DBI package to convert special characters to
the proper escape sequences. *Note Perl `DBI Class: Perl DBI Class.
You should use an escape function on any string that might contain any
of the special characters listed above!
Viel Erfolg!