Home > database >  Can you tell me what's the problem with this code? Trouble for help have a look, be urgent!
Can you tell me what's the problem with this code? Trouble for help have a look, be urgent!

Time:09-26

String r_czyxm r_czyxm1, r_shr r_shbj, r_zhr, g_id
The integer r_row,.net
R_row=dw_wgrk. Getrow ()
R_czyxm=dw_wgrk. Getitemstring (r_row, 'SHR)
R_shbj=dw_wgrk. Getitemstring (r_row, 'SHBJ)
If r_shbj='Y' then
Messagebox (' hint: ', 'the receipt already review! ')
The else
The select czyxm into: r_czyxm1 from czyxxb where czybh=: g_id;
The select czyxm into: r_shr from czyxxb where czyqx like '%' outsourcing audit;
If r_czyxm1 & lt;> R_shr then
Messagebox (' prompt ', 'you have no right to review! ')
The else
Net=messagebox (' prompt ', 'really want to review the operation? ', the exclamation! Yesno! , 2)
If the.net=2 then return
Dw_wgrk. Setitem (r_row, 'SHR, r_shr)//reviewer
Dw_wgrk. Setitem (r_row, 'SHBJ', 'Y')//audit tag
Dw_wgrk. Accepttext ()
Messagebox (' hint: ', 'audit success! ')
Cb_bc. Triggerevent (clicked!
End the if
End the if


This is an implementation of the audit code, but every time they perform all tips "did not have the right to audit", but operators have audit authority, i.e., how be to return a responsibility excuse me? Trouble help solve, thank you very much

CodePudding user response:

A, the DEBUG variable is exactly the same as
Second, the trim try,

CodePudding user response:



Check g_id value is how much

Messagebox (r_czyxm1 r_shr)

According to the value, to find the problem

CodePudding user response:

The select czyxm into: r_czyxm1 from czyxxb where czybh=: g_id;
The select czyxm into: r_shr from czyxxb where czyqx like '%' outsourcing audit;


The second sentence add a where clause condition
The select czyxm into: r_shr from czyxxb where czybh=: g_id and czyqx like '%' outsourcing audit;

Actually I just a statement
The select czyqx into: czyqx from czyxxb where czybh=: g_id;
To assess the czyqx whether outsourcing review

CodePudding user response:

Still not solve the ah, which expert help

CodePudding user response:

Each execution are prompt "did not have the right to audit" you use a select statement to get r_czyxm1, r_shr they always not equal, you want to see the two variables

CodePudding user response:

The
reference 3 floor greatxingxing response:
select czyxm into: r_czyxm1 from czyxxb where czybh=: g_id;
The select czyxm into: r_shr from czyxxb where czyqx like '%' outsourcing audit;


The second sentence add a where clause condition
The select czyxm into: r_shr from czyxxb where czybh=: g_id...


Two statements out is certainly not the same operator's name

CodePudding user response:

What procedures?

CodePudding user response:

The
refer to the original poster xuezhiqian410 response:
string r_czyxm, r_czyxm1, r_shr, r_shbj, r_zhr, g_id
The integer r_row,.net
R_row=dw_wgrk. Getrow ()
R_czyxm=dw_wgrk. Getitemstring (r_row, 'SHR)
R_shbj=dw_wgrk. Getitemstring (r_row, 'SHBJ)
If r_shbj='Y' then
.


In
The select czyxm into: r_czyxm1 from czyxxb where czybh=: g_id;
The select czyxm into: r_shr from czyxxb where czyqx like '%' outsourcing audit;
After the two statements, add the following code to make sure the SQL execution success:
If the sqlca. Sqlcode & lt;> 0 then
Messagebox (' prompt ', 'data retrieval error: ~ n + sqlca. Sqlerrtext, stopsign!)
Return
End the if

CodePudding user response:

The select czyxm into: r_czyxm1 from czyxxb where czybh=: g_id;
The select czyxm into: r_shr from czyxxb where czyqx like '%' outsourcing audit;
That is certainly didn't take the values, MESSAGEBOX to see see

CodePudding user response:

How do you still won't do? Help!

CodePudding user response:

The select czyxm into: r_shr from czyxxb where czyqx like '%' outsourcing audit;

This sentence might return czyxm contains multiple, unable to get to the correct values, instead of like this:
... 
.
.
Int li
Select count (1) into: li from czyxxb where czybh=: g_id and czyqx like '%' outsourcing audit;
If the sqlca. Sqlcode & lt;> 0 then
Messagebox (' prompt ', 'data retrieval error: ~ n + sqlca. Sqlerrtext, stopsign!)
Return
End the if
If li & lt;=0 then
Messagebox (' prompt ', 'you have no right to review! ')
The else
.
.

CodePudding user response:

Don't know what's the time of assignment g_id across,,,,,,,,,, also, the code is not very neat oh, only you a maintenance after this code?

CodePudding user response:

refer to 12 floor kirasum reply:
don't understand when g_id assignment,,,,,,,,,, also, the code is not very neat oh, only you a maintenance after this code?


Indeed g_id assignment, for "'

CodePudding user response:

The elder brothers, if not wrong, you must be
The select czyxm into: r_czyxm1 from czyxxb where czybh=: g_id;
The select czyxm into: r_shr from czyxxb where czyqx like '%' outsourcing audit;
This two sentences in a table name write wrong, how can have two field data in the same table is the same?
To take a closer look at
Or do you czyxxb table has three fields, respectively is czybh, czyxm and czyqx, so you don't need to take two data for judgment

CodePudding user response:

The select czyxm into: r_shr from czyxxb where czyqx like '%' outsourcing audit;
This statement can only be czyxxb table has the authority to 'outsourcing audits %' first name, not just the current operator,
Czyxxb table more than one person has the '%' outsourcing review permissions,

So to change the where condition of a select statement, which is used to judge whether the current operator have a '%' outsourcing audit,
  • Related