MySQL Variablen
Ich wollte mal fragen ob es in MySQL eine möglichkeit gibt zu einer Tabelle Variablen zu definieren, um z.B. ein "letztes Update Datum" oder andere Zusatzinformationen zu speichern. Mit einer extra Tabelle tu ich mir schwer weil es immer unterschiedliche Datentypen sind.
Please also mark the comments that contributed to the solution of the article
Content-Key: 108449
Url: https://administrator.de/contentid/108449
Printed on: April 20, 2024 at 03:04 o'clock
1 Comment
SET @varname = 1;
oder auch
SET @varname = (SELECT feld FROM tabelle WHERE feld = @andere_var LIMIT 1);
Den Datentyp bzw. das Format des Datentyps (speziell beim Datum) musst du schon beachten.
Evtl. kannst du dir eine Art '__system' Tabelle anlegen mit 2 Feldern (tabelle, variable) - und diese in einer Funktion immer ein-/auslesen.