Autor Zpráva
ronnie
Profil
Dobrý den,

nevíte, proč nefunguje v MySQL 5.0.21 (MySQL - 5.0.21-community-nt) něco takového:

create procedure sp_VratSoftware()
begin
select * from software;
end

podle všeho by to mělo bez problému fungovat. PhpMyAdmin píše

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select * from software' at line 3

Je třeba nějak procedury "aktivovat"?
Díky
llook
Profil
Na řádkovém klientu je při definici procedury potřeba změnit oddělovač, viz http://dev.mysql.com/doc/refman/5.0/en/create-procedure.html :
The example uses the mysql client delimiter command to change the statement delimiter from ; to // while the procedure is being defined. This allows the ; delimiter used in the procedure body to be passed through to the server rather than being interpreted by mysql itself.

Pak by to vypadalo takhle:
delimiter //

create procedure sp_VratSoftware()
begin
select * from software;
end
//

Ale jak to udělat přes PHP funkce, to nevím.
ronnie
Profil
Řešení:

přes phpMyAdmin to nejde, ale lze použít MySQL Qoery Browser

http://dev.mysql.com/downloads/query-browser/1.1.html
Toto téma je uzamčeno. Odpověď nelze zaslat.

0