Enhancement Request

phocai

Member²
Hi Marco,

Thought of a new (small and easy to add ;-) feature today:

When right-clicking on a table name in the Object Browser, there is an option to Query Data.

When multiple tables are selected, clicking Query Data opens each select query in a separate SQL Window. Would it be possible to include an option to "Query All in a single SQL Window"?

Many thanks as always for an awesome product.
 
Hello,

You can do it easily using Browser Extender plugin.
You can create a simply pascal extension with the following code in OnClick event:

program t1;
begin
If IDE_WindowHasEditor(True) then
IDE_SetSelectedText(IDE_GetEditorHandle, 'select * from #oowner.#oname;' + #13#10);
end.

When a window with editor will be opened - prepared code will be inserted into it.
When you in General tab add a "+" to table name --> "TABLE+" extension will work in multiselection mode.

 
Last edited:
Sorry to continue such an old thread, but I'm looking for the IDE_SetSelectedText function and this thread seems to be the only place in the world that refers to it.

Although IDE_GetSelectedText exists, I cannot find IDE_SetSelectedText in the documentation, nor in PlugInIntf.pas.

I now use a trick using the Clipboard and a simulated Ctrl+V keypress, but that is far from ideal.
 
I've been able to work around it by calling IDE_GetEditorHandle and use it to send an EM_REPLACESEL message to.

Code:
procedure PasteText(Text: String);
var
  Handle: THandle;
  StartPos, EndPos: Integer;
begin
  Handle := IDE_GetEditorHandle;
  // Replace selection
  SendMessage(Handle, EM_REPLACESEL, 1, Integer(PChar(Text)));
  // Select pasted text
  SendMessage(Handle, EM_GETSEL, Integer(@StartPos), Integer(@EndPos));
  SendMessage(Handle, EM_SETSEL, StartPos - Length(Text), StartPos);
end;
 
Last edited:
Back
Top