--创建数据库 create database Information go --使用数据库 use Information go --创建表 create table Student ( Sno ) primary key not null, Sname ) not null, Ssex bit not null, Sbirthday datetime, Class ), ) create table Course ( Cno ) primary key not null, Cname ) n
第一种方法是使用工具,如:pl/sql developer,在[工具]--[导出用户对象]出现就可以得到建表脚本. 第二种方法是,sql语句. DBMS_METADATA.GET_DDL包可以得到数据库的对象的ddl脚本.如下(SQLPLUS中执行): 1.得 到一个表的ddl语句: SET SERVEROUTPUT ON SET LINESIZE 1000 SET FEEDBACK OFF set long 99999 set pagesize 4000 ---去除stor
一.常用的查询语句 1.1 常用查询 查表中有多少个字段 select count(*) from user_tab_columns where table_name=upper('表名') 或者 select max(column_id) from user_tab_columns where table_name=upper('表名') 1.2 日期/时间 相关查询 获取当前月份的第一天 SELECT TRUNC (SYSDATE, 'MONTH') "First day of curren
从远程oracle数据库上导出指定表的表结构语句有两种方法: 方法一:通过sql语句获得 1,make sure that you can connect the remote database. 2,enter into the sqlplus,and execute the command: select dbms_metadata.getddl('TABLE',tablename) from user_tables and you will get all the tables defin