Home > database >  Pb optimization
Pb optimization

Time:10-09

Pb beginner, into the pit soon took over pb program, a departure brother found two window open takes a long time, may be initialized things too much? Not a minute? Do not know how to do so would you like to do some optimization, and also hope you homo habilis directions
Open event
Win_center (this)
Enclosing TriggerEvent (' ue_position)

Datetime dt
String s_1, s_2, s_3, s_4, kh1, kh2
DECLARE ls_cur CURSOR FOR
SELECT "KHXXDB". "KHMC
"FROM "KHXXDB" where SJHM is not null and WXSBS='1' and WXSHZBS='1' and inval is null;
The open ls_cur;
The fetch ls_cur into: s_1;
The do while the sqlca. Sqlcode=0
Ddlb_1. Additem (s_1)
Ddlb_14. Additem (s_1)
The fetch ls_cur into: s_1;
Loop
The close ls_cur;
Em_1. Text=string (today ())

DECLARE CURSOR l FOR
SELECT "BM_WXCPLB". "SORT_NA
"FROM "BM_WXCPLB
"Where id not in (' 7 ');
Open the l;
The fetch l into: s_2;
The do while the sqlca. Sqlcode=0
Ddlb_4. Additem (s_2);
The fetch l into: s_2;
Loop
Close the l;

DECLARE ls_2 CURSOR FOR
SELECT DISTINCT JZM FROM JZB WHERE BS<> '7';
The open ls_2;
The fetch ls_2 into: s_3;
The do while the sqlca. Sqlcode=0
Ddlb_2. Additem (s_3);
The fetch ls_2 into: s_3;
Loop
The close ls_2;


Dw_1. Settransobject (sqlca)
Dw_2. Settransobject (sqlca);
Dw_3. Settransobject (sqlca);
Dw_4. Settransobject (sqlca);
Dw_5. Settransobject (sqlca);
Dw_6. Settransobject (sqlca)
Dw_3. Retrieve ()
//dw_4. Retrieve ()
Int I, j
String KHMC

For j=1 to dw_3 rowcount ()
KHMC=dw_3. Getitemstring (j, "KHMC")
Ddlb_9. Additem (KHMC)
Next

The select sysdate into: dt from dual;
Em_2. Text=string (dt)



Ddlb_5. Reset ()
DECLARE ls_cur4 CURSOR FOR
SELECT "CALL_KH_LEVEL1". "KH_NAME
"FROM "CALL_KH_LEVEL1" where kh_name not in (' haagen-dazs', 'like holiland', 'dicos',' KFC KFC ', 'pizza hut PH) and inval=' 0 ';
The open ls_cur4;
The fetch ls_cur4 into: s_1;
The do while the sqlca. Sqlcode=0
Ddlb_5. Additem (s_1)
The fetch ls_cur4 into: s_1;
Loop
The close ls_cur4;

DECLARE ls_gzxz CURSOR FOR
SELECT code, "BM_WX_GDXZ". "MC"
FROM "BM_WX_GDXZ" order by code;
The open ls_gzxz;
The fetch ls_gzxz into: s_1, : s_2;
The do while the sqlca. Sqlcode=0
Ddlb_10. Additem (s_1 and s_2)
The fetch ls_gzxz into: s_1, : s_2;
Loop
The close ls_gzxz;
Ddlb_8. Text=', 48 '

/////province//////////
String ls_sf
Declare cursor_sf cursor for

SELECT "BM_PROVINCE". "NAME"
FROM "BM_PROVINCE
"WHERE "BM_PROVINCE". "LEVELTYPE"='1' and "BM_PROVINCE". "BS" is null and "BM_PROVINCE". "NAME" & lt;> 'overseas'
The order by "BM_PROVINCE". "NAME" asc;

The open cursor_sf;
The fetch cursor_sf into: ls_sf;
The do while the sqlca. Sqlcode=0
Ddlb_13. Additem (ls_sf)
The fetch cursor_sf into: ls_sf;
Loop
The close cursor_sf;

//phone cowcatcher note
String ls_dhpzbz
Declare cursor_bz cursor for

SELECT "BM_WX_DHPZGZ". "NAME"
FROM "BM_WX_DHPZGZ
"WHERE "BM_WX_DHPZGZ". "INVAL"='0'
The order by "BM_WX_DHPZGZ". "NAME" asc;

The open cursor_bz;
The fetch cursor_bz into: ls_dhpzbz;
The do while the sqlca. Sqlcode=0
Ddlb_dhpzgz. Additem (ls_dhpzbz)
The fetch cursor_bz into: ls_dhpzbz;
Loop
The close cursor_bz;

//special maintenance category
String ls_tswxlb
Declare cursor_tswxlb cursor for

SELECT "BM_WXTSWXLX". "NAME"
FROM "BM_WXTSWXLX
"WHERE "BM_WXTSWXLX". "INVAL"='0'
The order by "BM_WXTSWXLX". "NAME" asc;

The open cursor_tswxlb;
The fetch cursor_tswxlb into: ls_tswxlb;
The do while the sqlca. Sqlcode=0
Ddlb_tswxlb. Additem (ls_tswxlb)
The fetch cursor_tswxlb into: ls_tswxlb;
Loop
The close cursor_tswxlb;

CodePudding user response:

Another window open event
String pg, s_1 and s_2
String ls_kh1
String ls_pgr
Win_center (this)
Dw_1. Settransobject (sqlca)
Dw_2. Settransobject (sqlca)
Dw_3. Settransobject (sqlca)
Dw_4. Settransobject (sqlca)
Dw_5. Settransobject (sqlca)
Dw_6. Settransobject (sqlca)
Dw_7. Settransobject (sqlca)
Dw_8. Settransobject (sqlca)
Dw_9. Settransobject (sqlca)
Ls_pgr=user. User_id
If ls_pgr="Susan" or ls_pgr="er" then
Ls_pgr="%"
The else
Ls_pgr=ls_pgr + "%"
End the if
Pg='0'
Dw_1. Retrieve (pg, ls_pgr)
//dw_3. Retrieve (pg)
//dw_7. Retrieve ()
Dw_2. Retrieve (' % ', '%')
//timer (60)
Ddlb_2. Text=', 48 '
St_25. Text=user. User_id
DECLARE ls_gzxz CURSOR FOR
SELECT code, "BM_WX_GDXZ". "MC"
FROM "BM_WX_GDXZ" order by code;
The open ls_gzxz;
The fetch ls_gzxz into: s_1, : s_2;
The do while the sqlca. Sqlcode=0
Ddlb_3. Additem (s_1 and s_2)
The fetch ls_gzxz into: s_1, : s_2;
Loop
The close ls_gzxz;



//phone cowcatcher note
String ls_dhpzbz
Declare cursor_bz cursor for

SELECT "BM_WX_DHPZGZ". "NAME"
FROM "BM_WX_DHPZGZ
"WHERE "BM_WX_DHPZGZ". "INVAL"='0'
The order by "BM_WX_DHPZGZ". "NAME" asc;
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related