All comments -> Why an error?

Gwyneth's profile image Gwyneth posted 1 day ago in General Permalink

I am preparing a stored procedure. I have all the lines commented out. I cannot save. Why not?image description

1 attachment(s):
  • hedisql
ansgar's profile image ansgar posted 1 day ago Permalink

Your image is cropped too much. The error may be in the log panel but you need to post the whole message and the code of the routine here.

Gwyneth's profile image Gwyneth posted 1 day ago Permalink

Ansgar, where do I click to see the stored procedure? I opened HeidiSql anew, but I am at a lost to see the code we just wrote.

ansgar's profile image ansgar posted 1 day ago Permalink

Click the "Create code" tab and copy the contents here:

grafik.png

Gwyneth's profile image Gwyneth posted 1 day ago Permalink

The procedure already exists apparently. How do I navigate to it? Looked thoroughly, cannot find a way.

image description

1 attachment(s):
  • hedisql2
Gwyneth's profile image Gwyneth posted 1 day ago Permalink
BEGIN
-- IF EXISTS(SELECT 1 FROM chessback WHERE column = value...) THEN
--     UPDATE table 
 --    SET column = value ...
--     WHERE other_column = other_value ...;
-- ELSE
--     INSERT INTO table
 --        (column1, column2, ...)
 --    VALUES
 --        (value1, value2, ...);
-- END IF;

END

-- DELIMITER
=====================================
/* Delimiter changed to ; */
/* Connecting to sql63.your-server.de via MariaDB or MySQL (TCP/IP), username w6wehfc9, using password: Yes ... */
SELECT CONNECTION_ID();
SHOW VARIABLES;
/* Characterset: utf8mb4 */
SHOW /*!50002 GLOBAL */ STATUS;
SELECT NOW();
/* Connected. Thread-ID: 28039645 */
/* Reading function definitions from C:\Program Files\HeidiSQL\functions-mariadb.ini */
SHOW TABLES FROM `information_schema`;
SHOW DATABASES;
SHOW OPEN TABLES FROM w6wehfc9_baseB WHERE `in_use`!=0;
USE `w6wehfc9_baseB`;
/* Entering session "LinguaShop" */
SELECT `DEFAULT_COLLATION_NAME` FROM `information_schema`.`SCHEMATA` WHERE `SCHEMA_NAME`='w6wehfc9_baseB';
SHOW TABLE STATUS FROM `w6wehfc9_baseB`;
SHOW FUNCTION STATUS WHERE `Db`='w6wehfc9_baseB';
SHOW PROCEDURE STATUS WHERE `Db`='w6wehfc9_baseB';
SHOW TRIGGERS FROM `w6wehfc9_baseB`;
SELECT *, EVENT_SCHEMA AS `Db`, EVENT_NAME AS `Name` FROM information_schema.`EVENTS` WHERE `EVENT_SCHEMA`='w6wehfc9_baseB';
/* Loading file "C:\Users\Lenovo\AppData\Roaming\HeidiSQL\Backups\query-tab-2024-06-02_16-45-32-539.sql" (317 B) into query tab #1 */
/* Loading file "C:\Users\Lenovo\AppData\Roaming\HeidiSQL\Backups\query-tab-2024-10-23_19-49-11-173.sql" (128 B) into query tab #2 */
/* Loading file "C:\Users\Lenovo\AppData\Roaming\HeidiSQL\Backups\query-tab-2024-12-19_21-34-38-139.sql" (173 B) into query tab #3 */
/* Loading file "C:\Users\Lenovo\AppData\Roaming\HeidiSQL\Backups\query-tab-2025-01-08_18-35-13-998.sql" (426 B) into query tab #4 */
/* Loading file "C:\Users\Lenovo\AppData\Roaming\HeidiSQL\Backups\query-tab-2025-01-12_18-36-25-011.sql" (241 B) into query tab #5 */
/* Scaling controls to screen DPI: 100% */
SELECT * FROM `information_schema`.`COLUMNS` WHERE TABLE_SCHEMA='w6wehfc9_baseB' AND TABLE_NAME='chesserrors' ORDER BY ORDINAL_POSITION;
SHOW INDEXES FROM `chesserrors` FROM `w6wehfc9_baseB`;
SELECT * FROM information_schema.REFERENTIAL_CONSTRAINTS WHERE   CONSTRAINT_SCHEMA='w6wehfc9_baseB'   AND TABLE_NAME='chesserrors'   AND REFERENCED_TABLE_NAME IS NOT NULL;
SELECT * FROM information_schema.KEY_COLUMN_USAGE WHERE   TABLE_SCHEMA='w6wehfc9_baseB'   AND TABLE_NAME='chesserrors'   AND REFERENCED_TABLE_NAME IS NOT NULL;
SHOW COLLATION;
SHOW ENGINES;
SHOW CREATE TABLE `w6wehfc9_baseB`.`chesserrors`;
SELECT CONSTRAINT_NAME, CHECK_CLAUSE FROM `information_schema`.`CHECK_CONSTRAINTS` WHERE CONSTRAINT_SCHEMA='w6wehfc9_baseB' AND TABLE_NAME='chesserrors';
SELECT `DEFAULT_COLLATION_NAME` FROM `information_schema`.`SCHEMATA` WHERE `SCHEMA_NAME`='information_schema';
SHOW TABLE STATUS FROM `information_schema`;
SHOW FUNCTION STATUS WHERE `Db`='information_schema';
SHOW PROCEDURE STATUS WHERE `Db`='information_schema';
SHOW TRIGGERS FROM `information_schema`;
SELECT *, EVENT_SCHEMA AS `Db`, EVENT_NAME AS `Name` FROM information_schema.`EVENTS` WHERE `EVENT_SCHEMA`='information_schema';
SELECT * FROM `information_schema`.`COLUMNS` WHERE TABLE_SCHEMA='w6wehfc9_baseB' AND TABLE_NAME='chessbackup' ORDER BY ORDINAL_POSITION;
SHOW INDEXES FROM `chessbackup` FROM `w6wehfc9_baseB`;
SELECT * FROM information_schema.REFERENTIAL_CONSTRAINTS WHERE   CONSTRAINT_SCHEMA='w6wehfc9_baseB'   AND TABLE_NAME='chessbackup'   AND REFERENCED_TABLE_NAME IS NOT NULL;
SELECT * FROM information_schema.KEY_COLUMN_USAGE WHERE   TABLE_SCHEMA='w6wehfc9_baseB'   AND TABLE_NAME='chessbackup'   AND REFERENCED_TABLE_NAME IS NOT NULL;
SHOW CREATE TABLE `w6wehfc9_baseB`.`chessbackup`;
SELECT CONSTRAINT_NAME, CHECK_CLAUSE FROM `information_schema`.`CHECK_CONSTRAINTS` WHERE CONSTRAINT_SCHEMA='w6wehfc9_baseB' AND TABLE_NAME='chessbackup';
SELECT CURRENT_USER();
CREATE PROCEDURE `UpdateOrInsert`()
LANGUAGE SQL
NOT DETERMINISTIC
CONTAINS SQL
SQL SECURITY DEFINER
COMMENT ''
BEGIN

END;
/* SQL Error (1304): PROCEDURE UpdateOrInsert already exists */
SELECT CURRENT_USER();
SHOW CREATE PROCEDURE `w6wehfc9_baseB`.`UpdateOrInsert`;
ansgar's profile image ansgar posted 1 day ago Permalink

Either filter the tree on the left side:

grafik.png

... or use the filter box in the "Database" tab:

grafik.png

Gwyneth's profile image Gwyneth posted 1 day ago Permalink

Yaaa! Thanks!

Please login to leave a reply, or register at first.