[转帖]Oracle数据库-PL/SQL使用方法整理_MySQL, Oracle及数据库讨论区_Weblogic技术|Tuxedo技术|中间件技术|Oracle论坛|JAVA论坛|Linux/Unix技术|hadoop论坛_联动北方技术论坛  
网站首页 | 关于我们 | 服务中心 | 经验交流 | 公司荣誉 | 成功案例 | 合作伙伴 | 联系我们 |
联动北方-国内领先的云技术服务提供商
»  游客             当前位置:  论坛首页 »  自由讨论区 »  MySQL, Oracle及数据库讨论区 »
总帖数
1
每页帖数
101/1页1
返回列表
0
发起投票  发起投票 发新帖子
查看: 3514 | 回复: 0   主题: [转帖]Oracle数据库-PL/SQL使用方法整理        下一篇 
derek
注册用户
等级:中校
经验:1550
发帖:209
精华:0
注册:2011-7-21
状态:离线
发送短消息息给derek 加好友    发送短消息息给derek 发消息
发表于: IP:您无权察看 2011-9-14 14:25:12 | [全部帖] [楼主帖] 楼主

--获取系统记录行数

go_block(’T_WARITEMPRT’);

last_record;

row_count:=:system.trigger_record; --system.cursor_record

--execute_trigger(’POST-CHANGE’);

--设置鼠标状态

set_application_property(cursor_style,’BUSY’);

--raise form_trigger_failure;

--显示错误信息

exception when others then

display_note(sqlerrm||sqlcode,:global.logon_user);

--decode

decode(a.freightmode,’0’,’企业自付’,’1’,’供应商付费’,’2’,’企业代付’,’3’,’供应商代付’,null)

decode(qtyonhand - qtyinit,invtranqty,invtranqty,null)

--导出路径

select * from t_parameter where f_name=’LeanERPTempDir’;

select f_c_value from t_parameter where f_name =’WebServer1’;

--合同附件

select f_c_value from t_parameter where f_name=’purorderaccesspath’;

select f_c_value from t_parameter where f_name=’purorderaccessurl’;

--设置值列表

SET_ITEM_PROPERTY(’top.ORIGINALNO’,LOV_NAME,’LOV_MSO’);

LIST_VALUES;

--下拉列表

n:=populate_group(’rec_lb’);

populate_list(’BLK_BUT.APPTYPE’,’rec_lb’);

:bLK_BUT.APPTYPE:=’0’;

--调用另一模块

DECLARE

pl_id ParamList;

v_string varchar2(1000);

v_itemname varchar2(1000);

BEGIN

pl_id := Get_Parameter_List(’calendar’);

IF NOT Id_Null(pl_id) THEN

Destroy_Parameter_List(pl_id);

END IF;

pl_id := Create_Parameter_List(’calendar’);

v_itemname:=:system.current_block||’.’||:system.current_item;

v_string:=name_in(v_itemname);

Add_Parameter(pl_id, ’p_str’,TEXT_PARAMETER,v_string);

Call_Form(’input_str’,no_hide,no_replace,no_query_only,pl_id);

copy(:global.str,v_itemname); Erase(:global.str);

END;

--批量处理

set_application_property(cursor_style,’BUSY’);

SYNCHRONIZE;

first_record;

loop

null;

exit when :system.last_record = ’TRUE’;

next_record;

end loop;

set_application_property(cursor_style,’DEFAULT’);

bell;

display_note(’SRMP035’,:global.logon_user);

-- 采购计划关闭完毕!

--对话框

IF display_stop(’INV081’, :GLOBAL.logon_user) <> alert_button1 THEN

RETURN;

END IF;

--取得货币名称

begin

select currencydesc

into v_currencydesc

from t_currency

where currencycode = c1.splymoneyflag;

    exception when others then v_currencydesc := ’人民币(元)’;

end;

--询问对话框-1

declare

return_value number; [Page]

begin

set_alert_property(’stop_alert’,alert_message_text,’确认送审该合同吗?’);

return_value := show_alert(’stop_alert’);

if return_value != alert_button1 then

return;

end if;

end;

--询问对话框-2

DECLARE

return_value number;

BEGIN

return_value := display_stop(’mdm011’,:global.logon_user);

IF return_value = ALERT_BUTTON1 THEN

COMMIT_FORM;

END IF;

END;

--取下周一

select trunc(sysdate,’d’)+8 from dual;

--message_level

oldmsg := :System.Message_Level;

IF reldef = ’FALSE’ THEN

Go_Block(detail);

Check_Package_Failure;

:System.Message_Level := ’10’;

Execute_Query;

:System.Message_Level := oldmsg;

ELSE

--取当前年度、期段号

begin

select year,period

into v_year,v_period

from t_accperiod

where sysdate >= startdate

and to_char(sysdate,’yyyy/mm/dd’)<=to_char(enddate,’yyyy/mm/dd’);

exception when others then null;

end;

--设置画布属性

vCan2:=FIND_VIEW(’CAN_PRTNO2’);

SET_VIEW_PROPERTY(vCan2,VISIBLE,property_true);

vCan1:=FIND_VIEW(’CAN_PRTNO1’);

SET_VIEW_PROPERTY(vCan1,VISIBLE,property_false);

--设备提示信息

elsif :top.opsrc = ’X’ or :top.opsrc=’T’ then

set_item_property(’top.tranobj’,prompt_text,’客户代码’);

else

set_item_property(’top.tranobj’,prompt_text,’部门代码’);

end if;

--设置值列表KEY-LISTVAL

ELSIF :top.OPSRC=’I’ THEN --零星出库

SET_ITEM_PROPERTY(’top.ORIGINALNO’,LOV_NAME,’LOV_MSI’);

LIST_VALUES;

IF :top.ORIGINALNO IS NOT NULL THEN

PRTNO_MSI;

END IF;

END IF;

--调用值列表show_lov

DECLARE

a_value_chosen BOOLEAN;

BEGIN

a_value_chosen := Show_Lov(’lov_name’);

IF a_value_chosen THEN

set_block_property(’t_efficiency’,default_where,’username = :control.display_name’);

go_block(’t_efficiency’);




赞(0)    操作        顶端 
总帖数
1
每页帖数
101/1页1
返回列表
发新帖子
请输入验证码: 点击刷新验证码
您需要登录后才可以回帖 登录 | 注册
技术讨论