DELIMITER $$


/* ************************************************************************************************************************************************************************
	_WELT_GET_ ...
************************************************************************************************************************************************************************ */	

DROP PROCEDURE IF EXISTS `_WELT_GET_ARTYKULY`$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `_WELT_GET_ARTYKULY`(
	IN _ID_Sklepu VARCHAR(250),	
	_Param_A VARCHAR(50)	
	)
/*
	Zwracajaca tabele ARTYKULY dla wskazanego sklepu wraz z jego cenami.
	CALL _WELT_GET_ARTYKULY(@_ID_Sklepu);
*/
BEGIN
	CALL Int_2_infoPiek('select.artykuly', _ID_Sklepu, _Param_A);
END$$

GRANT EXECUTE ON PROCEDURE _WELT_GET_ARTYKULY TO pos $$
GRANT EXECUTE ON PROCEDURE _WELT_GET_ARTYKULY TO pos@'%' $$


DROP PROCEDURE IF EXISTS `_WELT_GET_GRUPY_ART`$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `_WELT_GET_GRUPY_ART`(
	)
/*
	Zwracajaca grupy wyrobow
	CALL _WELT_GET_GRUPY_ART();
*/
BEGIN
	CALL Int_2_infoPiek('select.grupy', '', '');
END$$

GRANT EXECUTE ON PROCEDURE _WELT_GET_GRUPY_ART TO pos $$
GRANT EXECUTE ON PROCEDURE _WELT_GET_GRUPY_ART TO pos@'%' $$

DROP PROCEDURE IF EXISTS `_WELT_GET_USERS`$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `_WELT_GET_USERS`(
	)
/*
	Zwracajaca tabele osob.
	CALL _WELT_GET_USERS();
*/
BEGIN
	CALL Int_2_infoPiek('select.pos.users', '', '');
END$$

GRANT EXECUTE ON PROCEDURE _WELT_GET_USERS TO pos $$
GRANT EXECUTE ON PROCEDURE _WELT_GET_USERS TO pos@'%' $$

DROP PROCEDURE IF EXISTS `_WELT_GET_Sklepy`$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `_WELT_GET_Sklepy`(
	)
/*
	Zwracajaca tabele sklepow.
	CALL _WELT_GET_Sklepy();
*/
BEGIN
	CALL Int_2_infoPiek('select.pos.sklepy', '', '');
END$$

GRANT EXECUTE ON PROCEDURE _WELT_GET_Sklepy TO pos $$
GRANT EXECUTE ON PROCEDURE _WELT_GET_Sklepy TO pos@'%' $$

	
DELIMITER ;

/*
====================================================================================================================================================================================
	NOTATNIK
====================================================================================================================================================================================

DROP USER pos;
CREATE USER pos IDENTIFIED BY 'pos98sql';
GRANT SELECT ON TowrNg TO pos;
GRANT SELECT ON cennik TO pos;
GRANT SELECT ON Jednostki TO pos;
GRANT SELECT ON katcols TO pos;
GRANT ALL ON infpie_dok_ng TO pos;
GRANT ALL ON infpie_dok_po TO pos;
GRANT ALL ON infpiek_int_ng TO pos;
GRANT ALL ON infpiek_int_po TO pos;

GRANT EXECUTE ON PROCEDURE _WELT_GET_GRUPY_ART TO pos;
GRANT EXECUTE ON PROCEDURE _WELT_GET_ARTYKULY TO pos;
GRANT EXECUTE ON PROCEDURE _WELT_GET_USERS TO pos;
GRANT EXECUTE ON PROCEDURE _WELT_GET_Sklepy TO pos;

GRANT EXECUTE ON PROCEDURE _WELT_GET_GRUPY_ART TO pos@'%';
GRANT EXECUTE ON PROCEDURE _WELT_GET_ARTYKULY TO pos@'%';
GRANT EXECUTE ON PROCEDURE _WELT_GET_USERS TO pos@'%';
GRANT EXECUTE ON PROCEDURE _WELT_GET_Sklepy TO pos@'%';


*/
