好贷网好贷款

130823创建过程

发布时间:2016-12-4 10:05:48 编辑:www.fx114.net 分享查询网我要评论
本篇文章主要介绍了"130823创建过程",主要涉及到130823创建过程方面的内容,对于130823创建过程感兴趣的同学可以参考一下。

SQL> create or replace procedure update_product_price( 2 p_product_id IN store.products.product_id%TYPE; 3 p_factor in number 4 ) 5 as 6 v_product_count integer; 7 8 begin 9 select count(*) 10 into v_product_count 11 from store.products 12 where product_id = p_product_id; 13 14 if v_product_count = 1 then 15 update store.products 16 set price = price * p_factor 17 where product_id = p_product_id; 18 commit; 19 end if; 20 21 exception 22 when others then 23 rollback; 24 end update_product_price; 25 / Warning: Procedure created with compilation errors  使用show error命令显示错误; SQL> show error Errors for PROCEDURE CALVIN.UPDATE_PRODUCT_PRICE: LINE/COL ERROR -------- --------------------------------------------------------------------------------------------------------------------------------------------------------------- 2/48 PLS-00103: Encountered the symbol ";" when expecting one of the following: := ) , default character The symbol ", was inserted before ";" to continue. SQL> SQL> create or replace procedure update_product_price( 2 p_product_id IN store.products.product_id%TYPE, 3 p_factor in number 4 ) 5 as 6 v_product_count integer; 7 8 begin 9 select count(*) 10 into v_product_count 11 from store.products 12 where product_id = p_product_id; 13 14 if v_product_count = 1 then 15 update store.products 16 set price = price * p_factor 17 where product_id = p_product_id; 18 commit; 19 end if; 20 21 exception 22 when others then 23 rollback; 24 end update_product_price; 25 / Procedure created创建成功 调用过程,检查效果; SQL> select price from store.products where product_id =1; PRICE ------- 19.95 SQL> call calvin.update_product_price(1,1.5); Method called SQL> select price from store.products where product_id =1; PRICE ------- 29.93 查询用户下的procedure SQL> select * from user_procedures; OBJECT_NAME PROCEDURE_NAME OBJECT_ID SUBPROGRAM_ID OVERLOAD OBJECT_TYPE AGGREGATE PIPELINED IMPLTYPEOWNER IMPLTYPENAME PARALLEL INTERFACE DETERMINISTIC AUTHID -------------------------------------------------------------------------------- ------------------------------ ---------- ------------- ---------------------------------------- ------------------- --------- --------- ------------------------------ ------------------------------ -------- --------- ------------- ------------ UPDATE_PRODUCT_PRICE 75101 1 PROCEDURE NO NO NO NO NO DEFINER 删除procedure SQL> drop procedure calvin.update_product_price; Procedure dropped

上一篇:hdu 4597 2013吉林通化邀请赛 Play Game 记忆化搜索
下一篇:HDU 4498 Function Curve(数学)

相关文章

关键词: 130823创建过程

相关评论