Hi to all,

I need to create a temporary table to enter data into a form and validate
some PK, FK rules.

This command work fine:
CREATE TABLE tdexpara_cambios (momento DATETIME, codpais INT NOT NULL
+
       ('ESPECIFIQUE A QUE PAIS CORRESPONDE'), material_anterior INT NOT
NULL  +
       ('INGRESE CODIGO DE MATERIAL ANTERIOR'), material_actual INT NOT NULL
+
       ('INGRESE CODIGO DE MATERIAL ACTUAL'), artdes_anterior TEXT 40,
+
       artdes_actual TEXT 40, PRIMARY KEY (codpais, material_anterior)
+
       ('MATERIAL ANTERIOR DUPLICADO EN LA LISTA'), FOREIGN KEY
+
       (material_anterior) REFERENCES sap_material
+
       ('MATERIAL ANTERIOR NO EXISTE EN SAP'), FOREIGN KEY (material_actual)
+
       REFERENCES sap_material ('MATERIAL ACTUAL NO EXISTE EN SAP'), CHECK
+
       (material_actual <> material_anterior))
It is a regular table.

But this do not work:
CREATE TEMPORARY TABLE tdexpara_cambios (momento DATETIME, codpais INT NOT
NULL+
       ('ESPECIFIQUE A QUE PAIS CORRESPONDE'), material_anterior INT NOT
NULL  +
       ('INGRESE CODIGO DE MATERIAL ANTERIOR'), material_actual INT NOT NULL
+
       ('INGRESE CODIGO DE MATERIAL ACTUAL'), artdes_anterior TEXT 40,
+
       artdes_actual TEXT 40, PRIMARY KEY (codpais, material_anterior)
+
       ('MATERIAL ANTERIOR DUPLICADO EN LA LISTA'), FOREIGN KEY
+
       (material_anterior) REFERENCES sap_material
+
       ('MATERIAL ANTERIOR NO EXISTE EN SAP'), FOREIGN KEY (material_actual)
+
       REFERENCES sap_material ('MATERIAL ACTUAL NO EXISTE EN SAP'), CHECK
+
       (material_actual <> material_anterior))

The message say: -ERROR- The referenced table does not exist. (2801)
Do not create the temporary table.

The only one change has been add "temporary" to line 1.

Some issues to connect temporary FK to regular PK ?

Thanks in advance.
R:egards
Juan Otazú
R:Base 9.5 (32)

--- RBASE-L
=======================3D=======================3
D=
TO POST A MESSAGE TO ALL MEMBERS:
Send a plain text email to [email protected]

(Don't use any of these words as your Subject:
INTRO, SUBSCRIBE, UNSUBSCRIBE, SEARCH,
REMOVE, SUSPEND, RESUME, DIGEST, RESEND, HELP)
=======================3D=======================3
D=
TO SEE MESSAGE POSTING GUIDELINES:
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: INTRO
=======================3D=======================3
D=
TO UNSUBSCRIBE:
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: UNSUBSCRIBE
=======================3D=======================3
D=
TO SEARCH ARCHIVES:
Send a plain text email to [email protected]
In the message SUBJECT, put just one word: SEARCH-n
(where n is the number of days). In the message body,
place any
text to search for.
=======================3D=======================3
D=


Reply via email to