Mostly Making oracle easy, mostly:
  • JSON Relational Duality view & API for an ‘EMPLOYEES’ entity
  • ORDS installs & upgrades, the TNS edition
  • Oracle SQL Developer Extension for VS Code 24.1.1 is here!
  • Searching JSON Arrays with JSON_EXISTS and REST APIs
  • Oracle REST Data Services Installer Improvements for 24.1
  • Retrieve DISTINCT list of values from JSON arrays via SQL
  • On REST APIs and Oracle Database 23ai JSON native types
  • New Video: SQL Developer for VS Code Overview & Demo
Search for:

You want the create script for a table.

AND you want the create script for ALL of your tables.

BUT also I want want the tablespace.

Forget the constraints.

How do you configure this in our tools?

SQL Developer: The Preferences & the Wizards

Go to the preferences.

Database, utilities, export.

This will also set the defaults for the Database Export wizard.
This will also set the defaults for the Database Export wizard.

SQLcl: SET DDL

HELP SET DDL

SET DDL

Might need to add more options, let us know!
Might need to add more options, let us know!

And now run the DDL command.

You could add these to your login.sql or do up an alias command to toggle things on and off...
You could add these to your login.sql or do up an alias command to toggle things on and off…
HR@orcl >help set ddl
SET DDL
  SET DDL [[ PRETTY | SQLTERMINATOR | CONSTRAINTS | REF_CONSTRAINTS |
          CONSTRAINTS_AS_ALTER|OID | SIZE_BYTE_KEYWORD | PARTITIONING |
          SEGMENT_ATTRIBUTES | STORAGE | TABLESPACE | SPECIFICATION |
          BODY | FORCE | INSERT | |INHERIT | RESET] {on|off}
         ]| OFF ]

HR@orcl >set ddl constraints off
DDL Option CONSTRAINTS off
HR@orcl >set ddl ref_constraints off
DDL Option REF_CONSTRAINTS off
HR@orcl >set ddl tablespace off
DDL Option TABLESPACE off
HR@orcl >set ddl segment_attributes off
DDL Option SEGMENT_ATTRIBUTES off
HR@orcl >ddl locations
  CREATE TABLE "HR"."LOCATIONS" 
   (	"LOCATION_ID" NUMBER(4,0), 
	"STREET_ADDRESS" VARCHAR2(40), 
	"POSTAL_CODE" VARCHAR2(12), 
	"CITY" VARCHAR2(30), 
	"STATE_PROVINCE" VARCHAR2(25), 
	"COUNTRY_ID" CHAR(2)
   ) ;
   COMMENT ON COLUMN "HR"."LOCATIONS"."LOCATION_ID" IS 'Primary key of locations table';
   COMMENT ON COLUMN "HR"."LOCATIONS"."STREET_ADDRESS" IS 'Street address of an office, warehouse, or production site of a company.
Contains building number and street name';
   COMMENT ON COLUMN "HR"."LOCATIONS"."POSTAL_CODE" IS 'Postal code of the location of an office, warehouse, or production site
of a company. ';
   COMMENT ON COLUMN "HR"."LOCATIONS"."CITY" IS 'A not null column that shows city where an office, warehouse, or
production site of a company is located. ';
   COMMENT ON COLUMN "HR"."LOCATIONS"."STATE_PROVINCE" IS 'State or Province where an office, warehouse, or production site of a
company is located.';
   COMMENT ON COLUMN "HR"."LOCATIONS"."COUNTRY_ID" IS 'Country where an office, warehouse, or production site of a company is
located. Foreign key to country_id column of the countries table.';
   COMMENT ON TABLE "HR"."LOCATIONS"  IS 'Locations table that contains specific address of a specific office,
warehouse, and/or production site of a company. Does not store addresses /
locations of customers. Contains 23 rows; references with the
departments and countries tables. ';
  CREATE INDEX "HR"."LOC_CITY_IX" ON "HR"."LOCATIONS" ("CITY") 
  ;
  CREATE INDEX "HR"."LOC_COUNTRY_IX" ON "HR"."LOCATIONS" ("COUNTRY_ID") 
  ;
  CREATE INDEX "HR"."LOC_STATE_PROVINCE_IX" ON "HR"."LOCATIONS" ("STATE_PROVINCE") 
  ;
HR@orcl >


Don’t want the quoted identifiers?

Use the Data Modeler.

Author thatjeffsmith

I'm a Distinguished Product Manager at Oracle. My mission is to help you and your company be more efficient with our database tools.

5 Comments

Write A Comment Cancel Reply

深圳SEO优化公司坪地阿里店铺运营平湖企业网站建设龙华网络推广观澜外贸网站制作福田阿里店铺运营西乡SEO按天计费大芬关键词排名包年推广盐田网页制作福田阿里店铺运营福田网页设计福永外贸网站建设坑梓网页制作大鹏模板推广罗湖模板制作坪地百搜标王坪山网站推广系统深圳关键词按天扣费惠州网站优化推广南联关键词排名包年推广荷坳seo网站推广大芬网络广告推广宝安网站定制大浪关键词按天计费福田网站优化按天收费大鹏网站建设塘坑百搜词包坑梓百搜标王光明设计网站盐田模板制作观澜网站定制歼20紧急升空逼退外机英媒称团队夜以继日筹划王妃复出草木蔓发 春山在望成都发生巨响 当地回应60岁老人炒菠菜未焯水致肾病恶化男子涉嫌走私被判11年却一天牢没坐劳斯莱斯右转逼停直行车网传落水者说“没让你救”系谣言广东通报13岁男孩性侵女童不予立案贵州小伙回应在美国卖三蹦子火了淀粉肠小王子日销售额涨超10倍有个姐真把千机伞做出来了近3万元金手镯仅含足金十克呼北高速交通事故已致14人死亡杨洋拄拐现身医院国产伟哥去年销售近13亿男子给前妻转账 现任妻子起诉要回新基金只募集到26元还是员工自购男孩疑遭霸凌 家长讨说法被踢出群充个话费竟沦为间接洗钱工具新的一天从800个哈欠开始单亲妈妈陷入热恋 14岁儿子报警#春分立蛋大挑战#中国投资客涌入日本东京买房两大学生合买彩票中奖一人不认账新加坡主帅:唯一目标击败中国队月嫂回应掌掴婴儿是在赶虫子19岁小伙救下5人后溺亡 多方发声清明节放假3天调休1天张家界的山上“长”满了韩国人?开封王婆为何火了主播靠辱骂母亲走红被批捕封号代拍被何赛飞拿着魔杖追着打阿根廷将发行1万与2万面值的纸币库克现身上海为江西彩礼“减负”的“试婚人”因自嘲式简历走红的教授更新简介殡仪馆花卉高于市场价3倍还重复用网友称在豆瓣酱里吃出老鼠头315晚会后胖东来又人满为患了网友建议重庆地铁不准乘客携带菜筐特朗普谈“凯特王妃P图照”罗斯否认插足凯特王妃婚姻青海通报栏杆断裂小学生跌落住进ICU恒大被罚41.75亿到底怎么缴湖南一县政协主席疑涉刑案被控制茶百道就改标签日期致歉王树国3次鞠躬告别西交大师生张立群任西安交通大学校长杨倩无缘巴黎奥运

深圳SEO优化公司 XML地图 TXT地图 虚拟主机 SEO 网站制作 网站优化