Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

SQL Error 1064 -> Fehlersuche

Empfohlene Antworten

Hallo zusammen,

es ist wie verhext, eigentlich tue ich etwas Alltägliches: eine stored proc erstellen. Ich erhalte bei der folgenden immer den berühmten 1064-Fehler, aber ich finde einfach den Fehler nicht. Jemand anders vielleicht?

DB-System: MySQL


DELIMITER $$

CREATE PROCEDURE insertmessages
(strFirstName varchar, strLastName varchar, strEmail varchar, strTelNumber varchar, strMessage varchar)
BEGIN
INSERT INTO message
(strFirstName, strLastName, strEmail, strTelNumber, strMessage)
VALUES
(strFirstName, strLastName, strEmail, strTelNumber, strMessage);
SELECT @@IDENTITY;
END$$

DELIMITER ;

[/PHP]

Hier ist die Fehlermeldung

Error while executing query: CREATE PROCEDURE insertmessages

(strFirstName varchar, strLastName varchar, strEmail varchar, strTelNumber varchar, strMessage varchar)

BEGIN

INSERT INTO message

(strFirstName, strLastName, strEmail, strTelNumber, strMessage)

VALUES

(strFirstName, strLastName, strEmail, strTelNumber, strMessage);

SELECT @@IDENTITY;

END:

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 ' strLastName varchar, strEmail varchar, strTelNumber varchar, strMessage varchar' at line 2 (errno: 1064)

Click 'Ignore' if you'd like to have this error ignored until the end of the script.

Hier mal ein repräsentatives Beispiel einer problemlosen Erstellung:

[PHP]
DELIMITER $$

CREATE PROCEDURE insertloginlogs (randomid INT, dDate DATETIME, intCount INT)
BEGIN
INSERT INTO loginlogs
(randomid, dDate, intCount)
VALUES
(randomid, dDate, intCount);
SELECT @@IDENTITY;
END$$

DELIMITER ;

Vielen Dank schonmal im voraus!

Liebe Grüße

Maya

Bearbeitet von Maya*

ach ich bin ja blöde, bin selbst drauf gekommen, die Größe des varchars fehlte :rolleyes::rolleyes::rolleyes:

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Konto

Navigation

Suchen

Suchen

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.