I got this problem running my stored procedure in PB8. An error message "Internal Query Processor Error: The query processor encountered an unexpected error during execution." appears.
I had surfed the net to find out the cause of the error and found out that the error is a bug in SQL 7 with Service Pack 2. However, my program/stored procedure perfectly runs using my local connection in my PC with Service Pack 2. The error only occurs when my program is run and is connected to the server. But the server is using Service Pack 3. Furthermore, my stored procedure executes perfectly in my Query Analyzer regardless of where it is connected, be in my local db or in the server.
This is the portion that triggers the error coz when excluded in the execution no error is encountered.
set amount = num_basis /
( Select sum(num_basis)
From t_tmc_dtl xx
inner join #pl_ucode zz on zz.user_code =
Where xx.class_type = t_tmc_dtl.class_type
and xx.user_code = t_tmc_dtl.user_code
and zz.ref_usercode = #pl_ucode.ref_usercode
and zz.prod_type = #pl_ucode.prod_type
Group by zz.ref_usercode, zz.prod_type ) * @amount
inner join #pl_ucode on #pl_ucode.user_code = t_tmc_dtl.td_user_code
Where t_tmc_dtl.class_type = @c_type
and t_tmc_dtl.user_code = @u_code