1
내 쿼리가 실행되어 값을 반환하고 동일한 프로 시저에서 반환 값을 사용해야합니다. 어떻게 사용합니까?mysql은 동일한 프로 시저에서 반환 값을 사용합니다.
내 코드는 내가 조건에 @xcount를 사용할 필요가 여기
set @table_name_count = CONCAT('SELECT COUNT(*) into @xcount ', CONCAT(' FROM ') , concat(table_name),concat(' where issueNumber=',concat('30030'),concat(' and ISSNcode='),CONCAT('112640402')));
PREPARE statement from @table_name_count;
EXECUTE statement;
DEALLOCATE PREPARE statement;
select 'hello4' from dual;
IF xcount > 0 and xcount<>NULL THEN
DELETE from table_name where issueNumber='30030' and ISSNcode='112640402' ;
END IF ;
입니다
IF xcount > 0 and xcount<>NULL THEN
DELETE from table_name where issueNumber='30030' and ISSNcode='112640402' ;
END IF ;
감사합니다. 잘 작동합니다. – user1703145