Statement parameters

[expired user #10323]'s profile image [expired user #10323] posted 6 years ago in General Permalink

Hi,

good job you're doing with HeidiSQL. It's actually more popular than the commercial DataGrip among my colleagues and me. HeidiSQL is perceived to be more flexible.

One thing where HeidiSQL is lacking though is parameters in statements. We have many statements in applications like this:

SELECT foo FROM bar WHERE baz = :foobarbaz

When you execute this statement in DataGrip, it lets you enter a value which is automatically replaced by DataGrip. This is especially helpful if there are many parameters. In HeidiSQL I use search and replace, but it's somewhat cumbersome. It would be great if HeidiSQL would also support this.

Attached is a screenshot of DataGrip parameter window. It shows the parameter name, real column name (if applicable) and the value that gets replaced.

1 attachment(s):
  • datagrip-parameters
kalvaro's profile image kalvaro posted 6 years ago Permalink

In HeidiSQL you can populate parameters in the right pane in the Query tab ("Bind parameters" subtree).

Unfortunately, the implementation is too simplistic and it doesn't behave as bind parameter do in any other tool; it's basically an automated search and replace (for instance, you need to quote strings yourself).

Theo Jager's profile image Theo Jager posted 5 years ago Permalink

I understand there is a right pane, and i don't mind quoting my own strings :-)

But it would be great if there was a ( small ) extention

i.e.

...

WHERE id = :id #:id=1234

AND name = :name #:name="bob"

this way i can just copy past the sql from the editor into heidisql and run it with the default values

thanks and i realy like heidisql

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