存储过程

lydavid 2002-05-30 02:17:32
我想知道存储过程再什么时候用,怎么写,希望高手给点点拨
谢谢!!!
...全文
62 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
wh_cisco 2002-06-12
  • 打赏
  • 举报
回复
存储过程、函数、包都是存在数据库中的,在你调用的时候用!你不调用当然就没有用了!
一般的写法:
create or replace procedure name(in 参数1,in 参数2,out 参数3,.....)
is
内容.......
end ;
/

海洋‘s 2002-06-11
  • 打赏
  • 举报
回复
1.定义一个结构变量:str_bitmap
Type Variable Name
long bmtype
long bmwidth
long bmheight
long bmwidthbytes
long bmplanes
long bmbitspixel
blob bmbits
2.定义用户对象:
 Instance Variables:
//代码:
boolean ib_mdi = false
 mdiclient i_mdi
 window iw_window
 string ls_bitmap
 ulong iul_hbitmap
 ulong iul_hmdi
 ulong iul_dcmdi
 ulong iul_hDCMem
 s_bitmap istr_Bitmap
 boolean ib_center = FALSE
 boolean ib_resize = TRUE
 integer ii_TitleBarHeight = 200

Local External Functions:
//代码:
FUNCTION int ReleaseDC(ulong handle, ulong hDC) LIBRARY "User32.dll"
 FUNCTION ulong SelectObject(ulong hDC, ulong hGDIObj) LIBRARY "Gdi32.dll"
 FUNCTION int BitBlt(ulong hDC, int num, int num, int num, int num, ulong hDC, int num, int num, ulong lParam) LIBRARY "Gdi32.dll"
 FUNCTION ulong CreateCompatibleDC(ulong hDC) LIBRARY "Gdi32.dll"
 FUNCTION ulong GetDC(ulong handle) LIBRARY "User32.dll"
 FUNCTION ulong LoadImageA( ulong hints, ref string lpszName, UINT uType, int cxDesired,int cyDesired,UINT fuLoad ) library "user32.dll"
 FUNCTION ulong GetObjectBitmap( ulong hgdiobj, int cbBuffer, ref s_bitmap bm ) library "gdi32.dll" alias for GetObjectA
 FUNCTION boolean DeleteObject ( ulong hgdiobj ) library "gdi32.dll"
 FUNCTION boolean StretchBlt(ulong hDCdest, int x1, int y1, int w1, int h1, ulong hDCsrc, int x2, int y2, int w2, int h2, ulong lParam) LIBRARY "Gdi32.dll"

3.在MDI窗体中编写代码:
 *定义一个用户自定义事件:ue_PostOpen()
Event Name:ue_PostOpen()
Return Type:None
//代码:
inv_wallpaper = create n_cst_wallpaper
 inv_wallpaper.of_SetWindow ( this, this.mdi_1 )

 inv_wallpaper.ib_Resize = false
 inv_wallpaper.ib_Center = true

 inv_wallpaper.of_SetBitmap ( 'Maps\Dataauditing.bmp' ) //图片路径和图片名
 inv_WallPaper.of_SetWallPaper(true)
 *定义第二个用户自定义事件:Ue_paint()
Event Name:ue_Paint()
Return Type:None
//代码:
if IsValid(inv_WallPaper) then
  inv_WallPaper.event post ue_Paint()
end if
*****W_Mdi的Open事件代码:
 This.event post ue_postopen()
*****W_Mdi的Resize事件代码:
This.event ue_Paint()
*****W_Mdi的Close事件代码:
destroy inv_WallPaper
**********************完毕*******************

***方法当然不止这一种,还有其他方法,听听其他同仁的意见吧.
lydavid 2002-06-11
  • 打赏
  • 举报
回复
存储过程通常再生么时候用呢??
海洋‘s 2002-05-30
  • 打赏
  • 举报
回复
创建一个存储过程,名为:spm1
CREATE PROCEDURE spm1
(dept varchar2, mgr_name OUT varchar2)
IS lutype varchar2(10);
BEGIN
SELECT manager INTO mgr_name FROM mgr_table
WHERE dept_name = dept;
END;

To declare that procedure for processing within PowerBuilder, you code:
//声明存储过程
  DECLARE dept_proc PROCEDURE FOR spm1(:dept);

Note that this declaration is a non-executable statement, just like a cursor declaration. Where cursors have an OPEN statement, procedures have an EXECUTE statement.

When the EXECUTE statement executes, the procedure is invoked. The EXECUTE refers to the logical procedure name.
//执行存储过程
EXECUTE dept_proc;

1,072

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 相关问题讨论
社区管理员
  • 基础类社区
  • WorldMobile
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧