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

hazardland's profile image hazardland posted 8 years ago in General Permalink

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.

Code modification/commit from ansgarbecker, 8 years ago, revision 5074
Set each procedure parameter on its own line, and remove some tabs. See http://www.heidisql.com/forum.php?t=21166
ansgar's profile image ansgar posted 8 years ago Permalink

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

hazardland's profile image hazardland posted 8 years ago Permalink

Thanks,

It looks exactly my first code example now.

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

[expired user #9949]'s profile image [expired user #9949] posted 8 years ago Permalink

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's profile image hazardland posted 8 years ago Permalink

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.

[expired user #9949]'s profile image [expired user #9949] posted 8 years ago Permalink

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.