Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 10 of 12 total
Thread EDBMgr "snippets" functionality
Mon, Oct 21 2013 5:49 AMPermanent Link

Adam Brett

Orixa Systems

There was a thread a while ago about how useful it would be to have "snippets" functionality in the EDBMgr SQL Statement and SQL Script windows.

i.e. We all have to write things like:

PREPARE Stmt FROM
'' SELECT Name FROM Configuration.Files '';
OPEN Crsr;

Quite often, it would be nice to have a way of dropping these types of statements into scripts quickly.

At the time people talked about something like auto-completion functionality (like in Delphi). I can see this would be great, but also perhaps hard to code.

An easier solution might be to extend EDBMgrs existing "drag and drop" functionality.

i.e. I can already "drag" a pre-written function, procedure (or even table!) from the treeview into a script window & see it converted into SQL.

What if there was a node on the tree for "Snippets", it could be pre-loaded with some basic, useful ones, but have an extra node for the user to add their own.

Right click, "Create Snippet", would open a simple SQL-Memo Window, with a "Save" button and a "Title" Edit.

Dragging these snippets into the SQL Editor would dump whatever SQL had been written there into the script.
Mon, Oct 21 2013 10:20 AMPermanent Link

Uli Becker

Adam,

> i.e. We all have to write things like:
>
> PREPARE Stmt FROM
> '' SELECT Name FROM Configuration.Files '';
> OPEN Crsr;

I use AutoHotKey for that. It's very easy to write and works great.

E.g. (just type st (for statement)):

::<st::DECLARE Result CURSOR WITH RETURN FOR Stmt;{ENTER}PREPARE Stmt
FROM{ENTER}'SELECT * from';{ENTER}OPEN Result using Parameter;{ENTER}

Regards Uli



Tue, Oct 22 2013 7:50 AMPermanent Link

Adam Brett

Orixa Systems

>>I use AutoHotKey for that. It's very easy to write and works great.

... Thanks for the suggestion, I have downloaded it & will check it out. It looks really useful!

I still think it would be nice to have the feature built into EDBMgr, especially if a few frequently used pieces of code were pre-loaded.
Tue, Oct 22 2013 9:12 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Adam

I've had AutoHotKey for ages - its main use is to start my alternative to Windows Explorer via the win-E key. Never thought of using it that way though. Damn good idea.


Roy Lambert
Tue, Oct 22 2013 9:17 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Uli


You must have a different version of AutoHotKey to me. I'm on 1.0.48.03 but reading the on-line help I came up with

::>st::
(
PREPARE Stmt FROM
SELECT * from
OPEN Result using Parameter;    
)

neato

Roy Lambert
Tue, Oct 22 2013 12:05 PMPermanent Link

Uli Becker

Roy,

> You must have a different version of AutoHotKey to me. I'm on 1.0.48.03 but reading the on-line help I came up with
>
> ::>st::
> (
> PREPARE Stmt FROM
> SELECT * from
> OPEN Result using Parameter;
> )

Maybe. Does the code which I posted, not work with your version?

Anyway you can use AHK even to insert tablenames e.g. by displaying
message boxes and thus reduce typing to a minimum.

Uli
Tue, Oct 22 2013 12:39 PMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Uli

>Maybe. Does the code which I posted, not work with your version?

Nope, not sure which bits giving the problem but I like the layout I used Smile

>Anyway you can use AHK even to insert tablenames e.g. by displaying
>message boxes and thus reduce typing to a minimum.

Mmmm, you'll have to post an example of that.

Roy
Tue, Oct 22 2013 2:12 PMPermanent Link

Uli Becker

Roy,

> Nope, not sure which bits giving the problem but I like the layout I used Smile

You are right - I'll have to update. Smile

> Mmmm, you'll have to post an example of that.

Just a small and simple sample:

::test::
    InputBox, providedString, Tablename, Tablename:
    if NOT ErrorLevel
    {
        Send SELECT * from %providedString%{Enter}
    }
Return

Uli
Tue, Oct 22 2013 2:18 PMPermanent Link

Uli Becker

Addition:

I wrote an application that stores all snippets and other templates (not
only for EDBManager) in a database (EDB of course) and creates the AHK
script(s) when anything has been changed. See the attached screenshot.

Regards Uli




Attachments: Clip1.png
Wed, Oct 23 2013 3:00 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Uli


Very nice. Now be a good boy and share your toy with your friends Smiley

Pretty please

Roy Lambert
Page 1 of 2Next Page »
Jump to Page:  1 2
Image