现在mysql上定义一个函数,一个储存过程 函数: delimiter \\ CREATE FUNCTION f2 ( num2 INT, num1 INT ) RETURNS INT BEGIN DECLARE a DEFAULT INT 1; SET a = num1 * num2; RETURN ( a ) ; END \\ delimiter; 函数式是计算两个值相乘的 在mysql的调用 select f2(9,5); -- 45 同时函数可以是配合select 函数 from 来使用…
储存过程 DELIMITER // CREATE PROCEDURE pro1() BEGIN SELECT book_id,book_name,category FROM bookinfo t1 JOIN bookcategory t2 ON t1.book_category_id = t2.category_id; END// DELIMITER ; DELIMITER // ),OUT num INT) BEGIN DELETE FROM reader_info WHERE card_id…
◆Oracle查询用户表空间:select * from user_all_tables ◆Oracle查询所有函数和储存过程:select * from user_source ◆Oracle查询所有用户:select * from all_users.select * from dba_users ◆Oracle查看当前用户连接:select * from v$Session ◆Oracle查看当前用户权限:select * from session_privs ◆Oracle查看用户表空间…
-- SQL SERVER 判断是否存在某个触发器.储存过程 -- 判断储存过程,如果存在则删除IF (EXISTS(SELECT * FROM sysobjects WHERE name='procedurename' AND type='P')) DROP PROCEDURE procedurename -- 判断触发器,如果存在则删除IF (EXISTS(SELECT * FROM sysobjects WHERE id=object_id(N'[dbo].[triggername]')…