sql >> Database teknologi >  >> RDS >> Oracle

ORA-00922:manglende eller ugyldig indstilling ved execution set long 100000 statement i oracle

Set long 10000 er en SQL*PLUS-kommando, ikke en standard SQL, det er derfor du rammer fejlen.

Eksempel

ResultSet rs = stmt.executeQuery("SELECT DBMS_METADATA.GET_DDL('TABLE','YOUR_OBJECTS','JAY') as ddl FROM dual");

              while(rs.next()){
                  System.out.println(rs.getString(1));
              }

Output

CREATE TABLE "JAY"."YOUR_OBJECTS" 
   (    "OWNER" VARCHAR2(128) NOT NULL ENABLE, 
    "OBJECT_NAME" VARCHAR2(128) NOT NULL ENABLE, 
    "SUBOBJECT_NAME" VARCHAR2(128), 
    "OBJECT_ID" NUMBER NOT NULL ENABLE, 
    "DATA_OBJECT_ID" NUMBER, 
    "OBJECT_TYPE" VARCHAR2(23), 
    "CREATED" DATE NOT NULL ENABLE, 
    "LAST_DDL_TIME" DATE NOT NULL ENABLE, 
    "TIMESTAMP" VARCHAR2(19), 
    "STATUS" VARCHAR2(7), 
    "TEMPORARY" VARCHAR2(1), 
    "GENERATED" VARCHAR2(1), 
    "SECONDARY" VARCHAR2(1), 
    "NAMESPACE" NUMBER NOT NULL ENABLE, 
    "EDITION_NAME" VARCHAR2(128), 
    "SHARING" VARCHAR2(13), 
    "EDITIONABLE" VARCHAR2(1), 
    "ORACLE_MAINTAINED" VARCHAR2(1)
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "ORAPDB1_TBS1" 

Jeg fik delvis DDL, mens jeg kørte den samme sætning på SQL*PLUS.

SQL> SELECT DBMS_METADATA.GET_DDL('INDEX','SYS_IL0000092981C00086$$','JAY') as ddl FROM dual;

DDL
--------------------------------------------------------------------------------

  CREATE UNIQUE INDEX "JAY"."SYS_IL0000092981C00086$$" ON "JAY"."SYS_EXPORT_SCH

Her kan jeg få hele DDL ved at indstille SET LONG MEN jeg får komplet output på Java Application.

Output (Eclipse)

  CREATE UNIQUE INDEX "JAY"."SYS_IL0000092981C00086$$" ON "JAY"."SYS_EXPORT_SCHEMA_01" (
  PCTFREE 10 INITRANS 2 MAXTRANS 255 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "ORAPDB1_TBS1" 
  PARALLEL (DEGREE 0 INSTANCES 0) 



  1. Sammenligning af store og små bogstaver i SQL

  2. Implementering af trinvise klientopdateringer med rækkeversioner i Postgres

  3. Er det muligt at få relationen mellem en pivottabel og en anden tabel i Laravel?

  4. MySQL:transaktion inden for en lagret procedure