zoukankan      html  css  js  c++  java
  • plsql programming 01 plsql概述

    授权

    从 oracle 8i 开始, oracle 用通过提供 authid 子句为 pl/sql 的执行授权模型, 这样我们可以选择使用 authid current_user(调用者权限)来执行这个plsql语句, 这时这个程序是用调用者(当前)模式的授权运行的.

    与 SQL 整合

    pl/sql 于 sql 紧密整合, plsql 无需任何 odbc, jdbc

    declare
      l_book_count INTEGER;
    begin
      select count(*)
        into  l_book_count
      from autor like '%FEUERSTEIN, STEVEN%'
    
    dbms_output.put_line(
      'Steven has written (or co_written) ' || l_book_count || 'books. ');
    
    update books
        set author = replace( author, 'Steven', 'Stephen')
      where author like '%FEUERSTEIN, STEVEN%'
    end;

    以上代码可以看出, 只是在单纯的定义一个pl/sql块时, 如果有变量定义, 那么可以使用 declare 生命, 但是, 假如是一个 function, 或者 procedure 就不需要 declare 来生命, 而是直接声明就可以了.

  • 相关阅读:
    AtCoder Grand Contest 013 C:Ants on a Circle
    AtCoder Grand Contest 010 C:Cleaning
    055 列表推导式
    054 三元表达式
    05 Python爬虫之信息标记与提取方法
    053 迭代器
    052 装饰器
    051 闭包函数
    04 Python爬虫之Beautiful Soup库
    03 Python爬虫之Requests网络爬取实战
  • 原文地址:https://www.cnblogs.com/moveofgod/p/3765672.html
Copyright © 2011-2022 走看看