OVH Cloud OVH Cloud

Creation de table

1 réponse
Avatar
idcsarl
Bonjour =E0 tous...

Je recherche la syntaxe exacte pour cr=E9er une table=20
dbs.execute ("CREATE TABLE etc.... qui remplit les=20
conditions suivantes :


8 champs (Zone1, Zone2,....Zone8) ayant chacun un index
et pouvant accepter les valeurs nulles.

Merci

1 réponse

Avatar
Jean-Marc
"" a écrit dans le
message de news:1a6b01c3fbec$779e1bd0$
Bonjour à tous...

Je recherche la syntaxe exacte pour créer une table
dbs.execute ("CREATE TABLE etc.... qui remplit les
conditions suivantes :

8 champs (Zone1, Zone2,....Zone8) ayant chacun un index
et pouvant accepter les valeurs nulles.



Hello,
voici la doc in extenso:

CREATE TABLE table (field1 type [(size)] [NOT NULL] [index1] [, field2 type
[(size)] [NOT NULL] [index2] [, ...]] [, CONSTRAINT multifieldindex [,
...]])

The CREATE TABLE statement has these parts:

Part Description
table The name of the table to be created.
field1, field2 The name of field or fields to be created in the new table.
You must create at least one field.
type The data type of field in the new table.
size The field size in characters (Text and Binary fields only).
index1, index2 A CONSTRAINT clause defining a single-field index. See the
CONSTRAINT clause topic for more information on how to create this index.
multifieldindex A CONSTRAINT clause defining a multiple-field index. See the
CONSTRAINT clause topic for more information on how to create this index.
Remarks

Use the CREATE TABLE statement to define a new table and its fields and
field constraints. If NOT NULL is specified for a field, then new records
are required to have valid data in that field.
A CONSTRAINT clause establishes various restrictions on a field, and can be
used to establish the primary key. You can also use the CREATE INDEX
statement to create a primary key or additional indexes on existing tables.
You can use NOT NULL on a single field, or within a named CONSTRAINT clause
that applies to either a single field or to a multiple-field named
CONSTRAINT. However, you can apply the NOT NULL restriction only once to a
field, or a run-time error occurs.

Jean-Marc