then tempsql := ' and sp.department_oid = '||''''||de_oid||'''';
end if;
if vFlag = '1' then
if flag ='1' then
open result for
'select t.inv_stock_oid INV_STOCK_OID,t.stock_type_id STOCK_TYPE_ID,t.inv_position_oid INV_POSITION_OID,nvl(t.safety,0)-t.qty state,
t.part_no PART_NO,t.part_name PART_NAME,t.spec SPEC,t.unit UNIT,t.qty TOTALQTY,t.safety SAFETY,t.update_time UPDATE_TIME,
t1.potion_id POSITION_ID,t1.description POSITION_DESC,t2.stock_type_id STOCK_TYPE_ID,t2.description TYPE_DESC,
sp.inv_partnoclass_oid partnoclassoid,sp.qty DEQTY,sp.safe_qty SAFEQTY,de.department_name DEPARTMENT
from inv_stock t,inv_position t1,inv_stock_type t2,inv_stock_partnoclass sp,basicdata_department de
where de.department_oid(+) = sp.department_oid'
||tempsql||'
and sp.inv_stock_oid(+) = t.inv_stock_oid
and t.stock_type_id = t2.inv_stock_type_oid
and t.inv_position_oid = t1.inv_position_oid(+)
and t2.description='||''''||vCondition||''''||'
order by state desc';
return result;
注意特别奇怪的如下写法
tempsql := ' and sp.department_oid = '||''''||de_oid||'''';
t2.description='||''''||vCondition||''''||'