SQLSERVER存储过程转MYSQL问题。。。急等。。。

2024-12-12 15:32:30
推荐回答(1个)
回答1:

CREATE PROCEDURE PB_DATA(IN PRODUCT_NAME VARCHAR(50))
BEGIN

DECLARE _RODUCT_ID INT;

SELECT P_INDEX INTO _RODUCT_ID FROM TABLE_PRODUCT WHERE P_NAME=PRODUCT_NAME;

IF _RODUCT_ID IS NOT NULL THEN

SELECT * FROM TABLE_OBJECT_PRODUCT WHERE P_INDEX=_RODUCT_ID;

END IF;
END;

CALL PB_DATA('xxxx')
/*
PRODUCT_NAME 是要传进去的量吧;