BOOLEAN 数据类型
create table bool_test (val varchar2(10), flg boolean);
insert into bool_test values ('true' , true );
insert into bool_test values ('false' , false);
insert into bool_test values ('null' , null );
insert into bool_test values ('t' ,'t' );
insert into bool_test values ('yes' ,'yes' );
insert into bool_test values ('true' ,'true');
insert into bool_test values ('f' ,'f' );
insert into bool_test values ('0' , 0 );
select val from bool_test where flg;
select val from bool_test where not flg;
无表查询
select 'Oracle Database 23c' as db, sysdate as now, 1+1 as result;
JavaScript 存储过程
create mle module test_js
language javascript as
export function f(p1, p2) { return p1+p2; }
…
create function f (p1 number, p2 number)
return number as mle module test_js signature f(number, number);
select f(20, 22) ;
CREATE TABLE IF NOT EXIST
create table IF NOT EXIST t1 (id INTEGER, txt varchar2(10));
drop table IF EXIST t2;
基于别名的 GROUP BY
select extract(year from hire_date) yr, count(*) as total_emp
from employee
group by yr
having total_emp > 5;
关联更新
udpate dest d
set d.col1 = s.c1
from src s
where d.id = s.id;
JSON
create table json_schema_test (
obj json validate '
{
"num": number,
…
}
'
);
SQL;
传统 HTTP/REST 操作,例如 GET、PUT 以及 POST HTTP 请求;
Simple Oracle Document API(SODA)
Oracle Database API for MongoDB
ORDS
表值构造函数
insert into t1
values (1, 'first' ),
(2, 'second'),
(3, 'third' );
select * from (
values (1, 'first' ),
(2, 'second'),
(3, 'third' )
) tmp (id, val);
模式级别的特权
grant select any table
on schema hr
to user01;
SQL 域
create domain email_addr as varchar2(99) …;
create domain month_year
constraint month_fmt check (regexp_like(year_month, '^\d\d-\d\d\d\d$')
display 'Year: ' || substr(year_month, 4, 4) || ', Month: ' || substr(year_month, 1, 2)
order substr(year_month, 4, 4) || substr(year_month, 1, 2);
create table financial_report
…
corrections_to email_addr
rep_period month_year,
…
);
开发者角色
begin
dbms_developer_admin.grant_privs('user01');
end;
/
SQL> grant developer to user01 identified by xxxxxx;
grant succeeded.
SQL> connect user01/xxxxxx@ora23c;
connected.
SQL> select * from session_privs order by privilege;
PRIVILEGE
------------------------------
CREATE ANALYTIC VIEW
CREATE ATTRIBUTE DIMENSION
CREATE CUBE
CREATE CUBE BUILD PROCESS
CREATE CUBE DIMENSION
CREATE DIMENSION
CREATE DOMAIN
CREATE HIERARCHY
CREATE JOB
CREATE MATERIALIZED VIEW
CREATE MINING MODEL
CREATE MLE
CREATE PROCEDURE
CREATE SEQUENCE
CREATE SESSION
CREATE SYNONYM
CREATE TABLE
CREATE TRIGGER
CREATE TYPE
CREATE VIEW
DEBUG CONNECT SESSION
EXECUTE DYNAMIC MLE
FORCE TRANSACTION
ON COMMIT REFRESH
24 rows selected.
表的最大字段数量
模式和对象的注解
create table test ( … )
annotations (
expected_release '1.0',
test_coverage 'yes'
);
其他
文章转载自SQL编程思想,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。





