Editing after SELECT not possible anymore?

chris221's profile image chris221 posted 8 months ago in General Permalink

Hi,

I am very certain a few weeks/months ago I was able to edit rows in a SELECT query, as long as I queried the primary key.

For a while now I am not able to do this anymore. I can double click a cell and the input opens up fine, but I am not able to put in any characters.

Was that removed on purpose or did I accidentally changed some settings?

I am using the latest version.

Thanks!

ansgar's profile image ansgar posted 8 months ago Permalink

Editing should still be possible. You may be missing some important field in the query, but I can't tell you without knowing how the table looks like and what you selected.

chris221's profile image chris221 posted 8 months ago Permalink

Ok, I just figured out the problem.

SELECT cronjobID, className, startMinute, startHour, startDom, startMonth, startDow, lastExec, FROM_UNIXTIME(lastExec), nextExec, FROM_UNIXTIME(nextExec), afterNextExec, FROM_UNIXTIME(afterNextExec)
FROM wcf1_cronjob
ORDER BY cronjobID DESC

doesnt work because I am using the function FROM_UNIXTIME(). Is there no way to make editing work even when selecting more fields then the original table has?

For example this also doesn't work:

SELECT cronjobID, className, startMinute, startHour, startDom, startMonth, startDow, lastExec, 1
FROM wcf1_cronjob
ORDER BY cronjobID DESC
ansgar's profile image ansgar posted 8 months ago Permalink

No, as soon as you include some non-editable field to the query, HeidiSQL sets the grid in read-only mode. You need to select the required fields only for editing.

chris221's profile image chris221 posted 8 months ago Permalink

Alright, thank you!

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