Thx gandolf989.

Actually the result of the first SQL becomes a column of the second SQL.

I understand explicit cursor need to be closed or remain opened and I've done that. The thing is, the explicit cursor has closed while the implicit cursor, which is the first SQL(with open cursor statement), remains opened!!

If it is an implicit one, I could have no control over it after used, right.

Please correct me if I'm wrong, thx.