zoukankan      html  css  js  c++  java
  • Apex 使用和学习

    ref doc http://o7planning.org/en/10345/oracle-apex-tutorial-for-beginners   (change from web to pdf)

    http://blog.csdn.net/sunansheng/article/details/50408716

    C:UsersDesktop6

    sample 1:


    工作区信息
    工作区名称
    dev_workspace
    工作区 ID
    系统指定的
    说明

    dev/dev123

    test and learn
    管理员信息
    用户名
    ADMIN/admin123.
    dev01/dev01123.

    电子邮件
    test@sina.com
    数据库方案信息
    重用现有方案

    方案名
    DEV
    表空间
    APEX_XXX
    数据文件
    /database/statdb/statdb/APEX_XXX.DBF


    由管理员 ADMIN 预配的工作区 dev_workspace。 数据库用户 DEV 已创建, 该用户具有使用数据文件

    NOTE:
    database column: column name must uppercase.


    /database/statdb/statdb/APEX_2949731940585331.dbf 的默认表空间 APEX_2949731940585331

    demo 1:

    --新数据库

    create database spdb1

    --创建dept表

    create table dept
    (
    deptno int primary key,
    dname varchar(30),
    loc varchar(30)
    )
    ;
    --创建emp表

    create table emp

    (empno int primary key,
    ename nvarchar(30),
    job nvarchar(30),
    mgr int,
    hiredate datetime,
    sal numeric(10,2),
    comm numeric(10,2),
    deptno int foreign key references dept(deptno) --因为deptno我们根据需要做成外键

    )

    --针对外键,请注意

    --①外键只能指向主键

    --②外键和主键的数据类型要一致

    --首先建立dept表,因为dept表与emp表存在约束

    insert into dept values(10,'ACCOUNTING','NEW YORK')
    /
    insert into dept values(20,'RESEARCH','DALLAS')
    /
    insert into dept values(30,'SALES','CHICAGO')
    /
    insert into dept values(40,'OPERATIONS','BOSTON')
    /
    --建立emp表

    insert into emp(EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,DEPTNO) values(7369,'SMITH','CLERK',7902,'1980-12-17',800.00,20)

    insert into emp values(7499,'ALLEN','SALESMAN',7698,'1981-2-20',1600.00,300.00,30)

    insert into emp values(7521,'WARD','SALESMAN',7698,'1981-2-22',1250.00,500.00,30)

    insert into emp(EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,DEPTNO) values(7566,'JONES','MANAGER',7839,'1981-4-2',2975.00,20)

    insert into emp values(7654,'MARTIN','SALESMAN',7698,'1981-9-28',1250.00,1400.00,30)

    insert into emp(EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,DEPTNO) values(7698,'BLAKE','MANAGER',7839,'1981-5-1',2850.00,30)

    insert into emp(EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,DEPTNO) values(7782,'CLARK','MANAGER',7839,'1981-6-9',2450.00,10)

    insert into emp(EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,DEPTNO) values(7788,'SCOTT','ANALYST',7566,'1987--4-19',3000.00,20)

    insert into emp(EMPNO,ENAME,JOB,HIREDATE,SAL,DEPTNO) values(7839,'KING','PRESIDENT','1981-11-17',5000.00,10)

    insert into emp values(7844,'TURNER','SALESMAN',7698,'1981-9-8',1500.00,0.00,30)

    insert into emp(EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,DEPTNO) values(7876,'ADAMS','CLERK',7788,'1987-5-23',1100.00,20)

    insert into emp(EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,DEPTNO) values(7900,'JAMES','CLERK',7698,'1981-12-3',950,30)

    insert into emp(EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,DEPTNO) values(7902,'FORD','ANALYST',7566,'1981-12-3',3000,20)

    insert into emp(EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,DEPTNO) values(7934,'MILLER','CLERK',7782,'1982-1-23',1300,10)

    insert into emp values(9999,'SHUNPING','CLERK',7782,'1988-5-5',2456.34,55.66,10)

    SELECT * FROM EMP

    SELECT * FROM DEPT

    javascript:apex.confirm('Are you sure?','delete_confirm');
    line 4927

    // Declare a variable named htmldb_delete_message

    var htmldb_delete_message='Would you like to perform this delete action?';

    // Or:
    // "DELETE_CONFIRM_MSG" is a constant available in APEX.
    // It has value: Would you like to delete this thực action?

    var htmldb_delete_message='"DELETE_CONFIRM_MSG"';


    // Then can use this variable in the whole page.

    apex.confirm(htmldb_delete_message,DELETE_CONFIRM');

    begin
    if :P6_DEPTNO is null then
    select DEPT_SEQ.nextval
    into :P6_DEPTNO
    from dual;
    end if;
    end;

    drop SEQUENCE dept_seq;

    CREATE SEQUENCE dept_seq MINVALUE 42 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 42 CACHE 20 NOORDER NOCYCLE NOPARTITION;

  • 相关阅读:
    jsp输出当前时间
    java连接操作Oracle
    Oracle 内置函数
    伪表和伪列
    关于listview视图的 作业
    5月21日 课堂总结
    网格布局作业
    网格布局视图整理
    5月19日课堂总结
    拷贝程序
  • 原文地址:https://www.cnblogs.com/feiyun8616/p/7245822.html
Copyright © 2011-2022 走看看