distal-attribute
distal-attribute
distal-attribute
distal-attribute

[MODIFY REQUEST] Please do not reformat stored procedure/function header code

hazardland posted 1 year ago in General

I write originally (In mysql workbanch because heidisql does not have live syntax check yet but thats not critical probem):

CREATE DEFINER=`root`@`localhost` PROCEDURE `transfer_win_free`(
    IN free_user INTEGER,
    IN free_provider SMALLINT,
    IN free_game SMALLINT,
    IN free_round BIGINT,
    IN free_currency SMALLINT,
    IN free_amount DECIMAL(23,9),
    OUT return_result DECIMAL(23,9)
)
    MODIFIES SQL DATA
    COMMENT 'RETURNS CURRENT BALANCE'

And HeidiSQL Reformats it like:

CREATE DEFINER=`root`@`localhost` PROCEDURE `transfer_win_free`(IN `free_user` INTEGER, IN `free_provider` SMALLINT, IN `free_game` SMALLINT, IN `free_round` BIGINT, IN `free_currency` SMALLINT, IN `free_amount` DECIMAL(23,9), OUT `return_result` DECIMAL(23,9)
)
    LANGUAGE SQL
    NOT DETERMINISTIC
    MODIFIES SQL DATA
    SQL SECURITY DEFINER
    COMMENT 'RETURNS CURRENT BALANCE'

Is it possible to do not reformat stored routine header ?

At least all I care about is that I can not read that input params when they are on same line.

And the best thing would be If you allow me to edit entire routine including header by myself imagine If I were allowed to edit in create code texbox.

ansgar posted 1 year ago

r5074 should look better now. Please update and give feedback here.

hazardland posted 1 year ago

Thanks,

It looks exactly my first code example now.

P.S. Note that default tab index is 4 in almost every code editor.

thebizyman posted 11 months ago

I'm on r5104 and whenever I try to alter a procedure I get an "Must declare scalar variable..." error. Once I modify the code provided by HeidiSQL (remove the "IN" before each @xxxx variable) it works, since it looks like MSSQL T-SQL. Pls advise, not able to use this efficiently, going to have to go back to MSSQL management tools and I'd really rather not.

hazardland posted 11 months ago

I found after writing aprox 5-6 stored procedures in a day during one month in finances related environment that writing stored procedures fully in MySQL Workbench is more time saving and efficient and I wish HeidiSQL had same mode where I declare everything in code without parameter builder and etc with just one SAVE button. In all other things I use HeidiSQL. Also MySQL workbench has built in SQL code linter which hints what error on what line you have while you type.

thebizyman posted 11 months ago

I appreciate your input, unfortunately it makes it more difficult to use multiple tools for writing, modifying stored procedures and running queries against my DB. I'll give MySQL Workbench a shot.

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