This is a discussion on Stored Procedure und insert on a variable tables within the MySQL Database forums, part of the Database Forums category; create procedure createKonto($myKonto integer, $einzahlung double) BEGIN DECLARE $t TEXT; IF ( NOT EXISTS ( select * from konto where kontoNr = $myKonto ) ) ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
create procedure createKonto($myKonto integer,
$einzahlung double) BEGIN DECLARE $t TEXT; IF ( NOT EXISTS ( select * from konto where kontoNr = $myKonto ) ) THEN SET $t = CONCAT('konto_' , CAST($myKonto AS CHAR)); INSERT INTO konto (kontoNr, kontoStand) VALUES( $myKonto,$einzahlung ); INSERT INTO $t (buhung, erfolg) VALUES($einzahlung, 1); END IF; END " -- DELIMITER ; I just want to insert $myKonto und $einzahlubg in the table konto_myKonto, where myKonto is an account number but i get Table $t does not exists. How can i make mysql to insert not in $t but in the table which is saved as TEXT in $t |
|
|||
|
ivaylo.mateev.uos@googlemail.com <ivaylo.mateev.uos@googlemail.com>
wrote: > I have found the solution :) So what was your solution? If you had this problem, then someone else might also have the problem and if they search newsgroups for the same problem, all they'll find is your original problem, and that you found a solution, but no solution given. -- Pd |
![]() |
| Thread Tools | |
| Display Modes | |
|
|