I want to save the answer from the query into a variable, which I then go through and check the individual values.
FUNCTION F_capa(
v_carId car.carid%Type,
v_snumber box.snumber%Type)
RETURN Boolean
IS
type t_box is Table OF box%rowtype;
v_possibleBox t_box := t_box();
BEGIN
SELECT b.carid, COUNT(p.trayID) AS amaunt,b.capacity ,b.date
INTO v_possibleBox
FROM Box b
left JOIN place p on b.carID = p.carID
WHERE b.snumber = v_snumber
GROUP BY b.carID, b.date, b.capacity ;
-- LOOP IF( v_carId = v_possibleBox(i).carID) Something like that
End;
But I always get this error.
ORA-00947: not enough values
I am relatively new to PLSQL and really doubt this site, so i would be grateful for any help.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…