Home > database >  Problems in the SQL statement
Problems in the SQL statement

Time:10-05

S_name1=dw_1. Getitemstring (I, "s_come")
S_no1=""
Ll_cnt=0

The select the_no
Into: s_no1
The from sci_base_data
Where the_class='IT03 and the_name=: s_name1;


Select sum (s_female)
Into: ll_cnt1
The from sci_sci_person
Where s_no IN
(select s_no
The from sci_scis
Where s_src2=: s_no1);

If isnull (ll_cnt1) then ll_cnt1=0
Dw_1. Setitem (I, "s_female ll_cnt1)

In the above paragraph, s_no1 string type, why am I in the above program used in s_no1, not as a result, the nested SQL statements in the where clause, could use a variable, the above procedure wrong in there

CodePudding user response:

In a nested SQL statements in the where clause, can use the variable!
Grammar of your code is no problem, try to ask: s_no1 this variable after add the if isnull (s_no1) then s_no1="" a try,

CodePudding user response:

If there is no data in the database, you track. Look at the sqlca sqlcode is what

CodePudding user response:

Ok thank you I try

CodePudding user response:

Haven't met this situation.

CodePudding user response:

There is a problem please GOOGLE and BAIDU
  • Related