iam getting "No data - zero rows fetched, selected, or processed" error what can i do
DELIMITER $$
DROP PROCEDURE IF EXISTS `testfull`.`sp_SaveInventoryIssueInfo` $$ CREATE DEFINER=`root`@`localhost` PROCEDURE `sp_SaveInventoryIssueInfo`(
paClientID smallint(5), paPersonID mediumint(8), paSportID mediumint(8), paEquipmentID mediumint(8), paItemCode mediumint(8),
paConditionID tinyint(3), paQuantity smallint(5),
paIssueDate date, paDueDate date, paIssuer SMALLINT(5),
paReason VARCHAR(255),
paNotes VARCHAR(255), paTransType TINYINT(3), paPackageID integer,
paPersonName VARCHAR(50)
) COMMENT 'Save/Update the Athletes Issue details' BEGIN
declare intCount smallint(5); declare intInvoiceId SMALLINT(5); declare intOrderID SMALLINT(5);
if paPersonID=0 then begin select clientid into intCount from tbltransactions where ClientID=paClientID and PersonID=paPersonID and SportID=paSportID and EquipmentID=paEquipmentID and ItemCode=paItemCode and TransType=paTransType and PersonName=paPersonName limit 1; END; else begin select clientid into intCount from tbltransactions where ClientID=paClientID and PersonID=paPersonID and SportID=paSportID and EquipmentID=paEquipmentID and ItemCode=paItemCode and TransType=paTransType limit 1; END; END if;
if isnull(intCount)=1 then begin
select InvoiceID into intInvoiceId from tblinventory where ClientID=paClientID and ItemCode=paItemCode;
select OrderID into intOrderID from tblinventory where ClientID=paClientID and ItemCode=paItemCode;
if isnull(intInvoiceId)=1 then begin set intInvoiceId=0; END; END if;
if isnull(intOrderID)=1 then begin set intOrderID=0; END; END if;
insert into tbltransactions (ClientID,PersonID,SportID,EquipmentID,ItemCode, ConditionID,Quantity,DueDate,Issue_ReturnDate,Issuer,Reason ,Notes ,TransType,EstimatedCost,ActualCost,InvoiceID,OrderID,PersonName,PackageID) values(paClientID,paPersonID,paSportID,paEquipmentID,paItemCode,paConditionID,paQuantity,paDueDate,paIssueDate, paIssuer,paReason,paNotes,paTransType,'','',intInvoiceId,intOrderID,paPersonName,paPackageID);
END;
else begin
if paPersonID=0 then begin update tbltransactions set ConditionID=paConditionID,Quantity=paQuantity,DueDate=paDueDate,Issue_ReturnDate=paIssueDate,Issuer=paIssuer, Reason=paReason,Notes=paNotes,PersonName=paPersonName where ClientID=paClientID and PersonID=paPersonID and SportID=paSportID and EquipmentID=paEquipmentID and TransType=paTransType and itemcode=paItemCode and PersonName=paPersonName ; END; else begin update tbltransactions set ConditionID=paConditionID,Quantity=paQuantity,DueDate=paDueDate,Issue_ReturnDate=paIssueDate,Issuer=paIssuer, Reason=paReason,Notes=paNotes,PersonName=paPersonName where ClientID=paClientID and PersonID=paPersonID and SportID=paSportID and EquipmentID=paEquipmentID and TransType=paTransType and itemcode=paItemCode; END; END if;
END; END if;
END $$
DELIMITER ;
|
| Author: saroop 27 Aug 2008 | Member Level: Silver | Rating:  Points: 1 |
pls tell ur table structure and ur requirement for the sp
|
| Author: mythili d 27 Aug 2008 | Member Level: Silver | Rating:  Points: 2 |
Kugan is right for all your input parameters should have @symbol because these are variables from which you want to input values.
|
| Author: vaddesreenivasulu 27 Aug 2008 | Member Level: Gold | Rating:  Points: 2 |
iam using mysql if one record in tha table it will works fine other wise giving error "No data - zero rows fetched, selected, or processed"
|