How to use query parameters in Database Console Tool and one more thing

I found that IDEA is the best tool for DB work if switching from QMF I've found so far.

But I have some open questions:

  1. How to use the query parameters? It seems that you can specify some placeholders in your queries and supply values for them -- as I understood the docs. But I'm to stupid to find out how you can specify them in the statement. Can someone help me out?
  2. What is the best way in IDEA to store statements for reuse? The history is not the best place because you cannot name the statements in any way and searching for the correct query is cumbersome.


Thanks in advance!

Helge

3 comments
Comment actions Permalink

I've found the answer deeply in the docs:

http://www.jetbrains.com/idea/webhelp/writing-and-executing-sql-commands-in-the-database-console.html#parameters

But it does not work, so I opened a bug report: IDEA-73744.

The open question is: "Best practice to store reusable queries"

0
Comment actions Permalink

Hello Helge,

I'm not sure whether it's a really good practice but you can store a
query in an SQL file. Thus you will be able to quickly locate it via "Go
to File" and run it via "Run Query in Console" or "Run Script".

On 8/31/11 2:05 PM, Helge Walter wrote:

I've found the answer deeply in the docs:

>

http://www.jetbrains.com/idea/webhelp/writing-and-executing-sql-commands-in-the-database-console.html#parameters

>

But it does not work, so I opened a bug report: IDEA-73744.

>

The open question is: "Best practice to store reusable queries"

>

---
Original message URL: http://devnet.jetbrains.net/message/5318087#5318087


Regards,
--
Gregory Shrago
Software Developer
JetBrains Inc.
http://www.jetbrains.com
"Develop With Pleasure!"

0
Comment actions Permalink

Hi Gregory,

thanks for the reply. It sounds good but I cannot find the "Run Query in Console" or "Run Script" action.

I created a file globalcounts.sql containing the query. All I've found is 'Run "globalcounts.sql" ...' but this does run the query in the 'Run' tool windows which does not have a display for the query results.

Can you please advice!

Helge

0

Please sign in to leave a comment.