0

El error me aparece al intentar crear tablas en Oracle SQL 11g no se por que sucede ya intente cambiar de todo sin embargo no logro encontrar el problema.

Error starting at line : 1 in command -
CREATE TABLE SPC_UL_box(
box_id NUMBER PRIMARY KEY,
box_name VARCHAR2(150) NOT NULL,
active BOOLEAN DEFAULT TRUE,
created DATE DEFAULT SYSDATE,
last_update DATE DEFAULT NULL,
deleted DATE DEFAULT NULL
);

Error report -
ORA-00984: column not allowed here
00984. 00000 -  "column not allowed here"
*Cause:    
*Action:

1 respuesta 1

0

PL/SQL no acepta los nombres sin comillas: requieres especificar que es una cadena (interesante ya que esto no pasa en MySQL o MS SQL Server). Esto fue lo que me funcionó; por cierto tampoco tiene booleanos:

CREATE TABLE "SPC"."SPC_UL_BOX" 
(   "BOX_ID" NUMBER NOT NULL ENABLE, 
"BOX_NAME" VARCHAR2(150 BYTE) NOT NULL ENABLE, 
"ACTIVE" NUMBER(1,0) DEFAULT 1, 
"CREATED" DATE DEFAULT SYSDATE, 
"LAST_UPDATED" DATE DEFAULT null, 
"DELETED" DATE DEFAULT NULL, 
 CONSTRAINT "SPC_UL_BOX_PK" PRIMARY KEY ("BOX_ID")
 );
1
  • No olvides aceptar tu respuesta cuando transcurra el tiempo mínimo.
    – padaleiana
    el 15 nov. 2022 a las 10:38

Tu Respuesta

By clicking “Publica tu respuesta”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

¿No es la respuesta que buscas? Examina otras preguntas con la etiqueta o formula tu propia pregunta.