我试图创建一个过程来根据用户的搜索条目搜索表并显示它们。在我的过程中,我在 p_brand 中收到重复参数错误。
这是代码
-- 例程 DDL -- 注意:例程正文前后的注释不会被服务器存储
DELIMITER $$
CREATE DEFINER=`root`@`localhost` PROCEDURE `MAS_pSearchinventory`
(
IN p_Category VARCHAR(20),
IN p_Brand VARCHAR(20),
IN P_Model varchar(20),
IN p_Pricefrom INT(20),
IN p_Priceto INT(20),
OUT p_Product varchar(30),
OUT p_Brand varchar(30),
OUT p_Model varchar(30),
OUT p_Series varchar(30),
OUT p_Color varchar(30),
OUT p_MotherBoard varchar(30),
OUT p_Processor varchar(30),
OUT p_Ram varchar(30),
OUT p_ScreenType varchar(30),
OUT p_ScreenSize varchar(30),
OUT p_OpticalDiskdrive varchar(30),
OUT p_Usb varchar(30),
OUT p_ModemEthernet varchar(30),
OUT p_Bluetooth varchar(30),
OUT p_TVOutput varchar(30),
OUT p_SoundCard varchar(30),
OUT p_KeyboardAndMouse LONGTEXT,
OUT p_Accessories LONGTEXT,
OUT p_OperatingSystem varchar(30),
OUT p_GraphicsCard varchar(30),
OUT p_ScreenResolution varchar(30),
OUT p_HardDrive varchar(30),
OUT p_MemoryCardReader varchar(30),
OUT p_Wifi varchar(30),
OUT p_AudioInterface varchar(30),
OUT p_ExpantionCardSlot varchar(30),
OUT p_Webcam varchar(30),
OUT p_Battery varchar(30),
OUT p_SoftwareIncluded varchar(30),
OUT p_Price varchar(30),
OUT p_Discount varchar(30),
OUT p_HomeDelivery varchar(30),
OUT p_FileName varchar(100),
OUT p_Result varchar(100)
)
BEGIN
SELECT
Product,Brand,Model,Series,Color,MotherBoard,
Processor,
Ram,
ScreenType,
ScreenSize,
OpticalDiskdrive,
Usb,
ModemEthernet,
Bluetooth,
TV put,
SoundCard,
KeyboardAndMouse,
Accessories,
OperatingSystem,
GraphicsCard,
ScreenResolution,
HardDrive,
MemoryCardReader,
Wifi,
AudioInterface,
ExpantionCardSlot,
Webcam,
Battery,
SoftwareIncluded,
Price,
Discount,
HomeDelivery,
FileName,
Result
from mas_tinsertinventorydetails
WHERE
(
(category=p_Category) and
(Brand=p_Brand) and
(model=p_Model) and
(pricefrom=p_Pricefrom) and
(priceto=p_Priceto)
);
END