clave foranea
Publicado por facundo (10 intervenciones) el 29/06/2010 03:15:54
hola, al crear la base de datos, fallo en la sentencia par hacer una clave foranea, desearia que me digan como se declara algun campo foraneo que es clave principal en otro aca les dejo la sentencia para que me digan
'creacion tabla pacientes
SQL = "create table pacientes (ci integer constraint PRIMARIO primary key, nombre text (20) not Null, direccion text (30) not Null, telefono integer not Null, apellido text (40) not Null, soc_medica text (40), lug_residencia text (20) not Null, fecha_nac text (15) not Null, lug_nac text (20) not Null, sexo text (10) not Null);"
database.Execute (SQL)
'creacion tabla inmunidad
SQL = "create table inmunidad (id_v integer constraint PRIMARIO primary key, ci integer not Null, foreign key (ci) references pacientes (ci), lug_vac text (20) not Null, hora date, fecha date not Null, especif_vacu text (255) not Null, laboratorio text (40), vencimiento date not Null, dosis integer not Null);"
database.Execute (SQL)
les agradezo si me ayudan de corazon
'creacion tabla pacientes
SQL = "create table pacientes (ci integer constraint PRIMARIO primary key, nombre text (20) not Null, direccion text (30) not Null, telefono integer not Null, apellido text (40) not Null, soc_medica text (40), lug_residencia text (20) not Null, fecha_nac text (15) not Null, lug_nac text (20) not Null, sexo text (10) not Null);"
database.Execute (SQL)
'creacion tabla inmunidad
SQL = "create table inmunidad (id_v integer constraint PRIMARIO primary key, ci integer not Null, foreign key (ci) references pacientes (ci), lug_vac text (20) not Null, hora date, fecha date not Null, especif_vacu text (255) not Null, laboratorio text (40), vencimiento date not Null, dosis integer not Null);"
database.Execute (SQL)
les agradezo si me ayudan de corazon
Valora esta pregunta


0