Nochmal utf8



Hallo, da bin ich schon wieder.
Ich hatte mich leider zu früh gefreut. Mit Varchar klappt zwar alles, aber
ich habe zu wenig Zeichen zur Verfügung. Kein Problem, hab ich mir gedacht,
wird das Feld eben wieder Longtext. Es gibt ja die Änderung des character
sets nach utf8. Aber leider falsch gedacht.

Folgendermaßen erstellte Tabelle funktioniert prima. Nur das die Spalte utf
zu wenig Zeichen besitzt.

CREATE TABLE `test_utf8` (
`id` INT( 4 ) NOT NULL AUTO_INCREMENT ,
`utf` Varchar(255) CHARACTER SET utf8 NOT NULL ,
PRIMARY KEY ( `id` )
)
Hier klappt dann auch das Ein- und Auslesen.

Folgende Eingabe funktioniert aber nicht. Hier meckert mysql schon beim
Erstellen der Tabelle. Warum?

CREATE TABLE `test_utf8` (
`id` INT( 4 ) NOT NULL AUTO_INCREMENT ,
`utf` LONGTEXT CHARACTER SET utf8 NOT NULL ,
PRIMARY KEY ( `id` )
)

Was ist an zweiter Syntax falsch? Oder anders, wenn ich longtext nicht auf
utf-8 bekomme, was muß ich dann nehmen?

Ich spring gleich im Dreieck. Kaum denkt man mal, es funktioniert, kommt
der nächste Stein ins rollen.

Fehlermeldung:

#1064 - You have an error in your SQL syntax. Check the manual that
corresponds to your MySQL server version for the right syntax to use near
'character set utf8 NOT NULL ,
PRIMARY KEY ( `id` )
)' at lin
.



Relevant Pages

  • text editor component (seeking design advice)
    ... TEXT FOLDING ... i do not know how to store the character data. ... i'll have to parse even the folded text - for syntax highlighting ...
    (alt.comp.lang.borland-delphi)
  • Re: Nochmal utf8
    ... `utf` LONGTEXT CHARACTER SET utf8 NOT NULL, ... Was ist an zweiter Syntax falsch? ... mysql> create table utf; ... Dito mit Deiner Query. ...
    (de.comp.datenbanken.mysql)
  • Re: The fallacy of strengthened liars paradox.
    ... have the same syntax. ... However, in English, the same expression, character ... no real difference. ... What does it mean to me to have contradictory ...
    (sci.logic)
  • Re: Again: Please hear my plea: print without softspace
    ... >> character instead of a ',' to alter the behavior of print. ... Changing the behavior of print when a syntax ... print statement is a sort of magic syntax as it is; ... it could be some other character. ...
    (comp.lang.python)
  • Re: Triggers, truncate field, how to
    ... The lenfunction is the correct function to find the length of a character ... But I am wondering why you would want to truncate the column to only ... know where to find the wright syntax code for it. ... trigger to do logically. ...
    (microsoft.public.sqlserver.server)