Date: prev next · Thread: first prev next last
2015 Archives by date, by thread · List index


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hallo *,


Eigentlich sollte das mit dem Setzen eines Defaultwertes möglich
sein:

ALTER TABLE "Tabellenname" ALTER "Boolscherfeldname" SET DEFAULT
FALSE;

Mir ist jetzt klar geworden, warum das nicht greift: Die
Standardeinstellung eines boolschen Feldes ist bereits ein leeres
Feld, das aber 'FALSE' entspricht. Setze ich dieses Feld bewusst auf
NULL, so wird ein entsprechender INSERT-Befehl von Base losgeschickt,
in dem eben NULL für das Feld weitergegeben wird.
- -----------------
Beispiel:
INSERT INTO "Tabelle" ("Ware","Preis","Kaufen") VALUES ('Kaffee',
8.79,NULL);
Das wird als Befehl abgesetzt, wenn das Feld "Kaufen" ein boolsches
Feld ist, weil eben die Checkbox "Kaufen" geändert wurde (von FALSE
auf NULL).
Die Checkbox gibt so immer wieder einen Inhalt weiter.
- -----------------
Anders ist das, wenn ich z.B. ein Zahlenfeld mit einem Defaultwert
vorbelege. Das leere Zahlenfeld wird bei der INSERT-Anweisung nicht
erwähnt, da es keinen Inhalt hat. Nur wenn das Feld nicht erwähnt wird
greift die Zuweisung des Defaultwertes der Datenbank.
- -----------------
Beispiel:
INSERT INTO "Tabelle" ("Ware","Preis") VALUES ('Kaffee', 8.79);
Dieser Befehl enthält das Feld "Kaufen" nicht. Jetzt wird
gegebenenfalls der Default-Wert der Tabelle für das Feld "Kaufen"
hinzugefügt. Es könnte also ohne weiteres von der Datenbank in dem
Feld "Kaufen" automatisch z.B. eine '1' eingefügt werden.
Ein Zahlenfeld oder ein Textfeld sind standardmäßig erst einmal leer.
Wird dort also keine Eingabe gemacht, so fehlen die Felder beim
INSERT-Befehl.

Gruß

Robert
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBAgAGBQJWB5JEAAoJELDKYwaoS9AIinYP/0nX13SMAwCKKFWn96HOEln1
u/m4D9aY6BD14hNP9/7NIGyy6y256CCXERFIxfVUa+K9DMBqmxEF4UhlUDrk3M3b
DaBfrBGQgNvltf8q1XzbseZ2StfbwyerMGXXKeBEmAHLDZGPYHIfgGmzI9EA/7B0
P+a7bz/qZysMXgrZVl+rOel2mc/B7vXxm1Wk8J1ceGU38iLV82WsTZQ9xM30QBXD
xlT2SrGij9OkchqctvRZp5/WhOjd9ikDk9tj1b3KcTQqG7+kCvtBL8HRZ/ctszAX
DSujkG3Z20gatQFX9ukeJy77Lx42HuHA28hcPGHRcDGSbChwMFfOI9SNUv8cKj53
ta5/b1Ri2PAuGJJeh0QSgnmZDDcXj4Zjfip4vzeg9T28UhKPvBipIQfukxUSGNh1
Gk2CE0RsnS0rO2z6stTxX5zbpK+7PP4366x2wGlhgwu/w5WWT0M9kJ2jouMqaT4Q
2Hnc0/BEa8bUWOpGqmXmejqn4tsTH4XhsRSdfNy38NAuxqWYEa3YSXnXxsVj4AUw
tVRoJithIC2FwGur09GAIQo/K8KTr3cUc0JvXtVzeWmPJep8ryPEaaWHyhSHSUJZ
Du1bnFiXCbKzkJsz4zRDH3xrvYvLM51is+vrzsBVXmyl17oa0F0dHIITiBuZ8npw
VKT/b02+PQQdZX5uJ+l4
=5tWu
-----END PGP SIGNATURE-----

-- 
Liste abmelden mit E-Mail an: users+unsubscribe@de.libreoffice.org
Probleme? http://de.libreoffice.org/hilfe-kontakt/mailing-listen/abmeldung-liste/
Tipps zu Listenmails: http://wiki.documentfoundation.org/Netiquette/de
Listenarchiv: http://listarchives.libreoffice.org/de/users/
Alle E-Mails an diese Liste werden unlöschbar öffentlich archiviert

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.