SqlDbx
You are not logged in.
Very often I need to do something like this:
select * from table1 where user = 'user1' and date = '01/22/09'
go
select * from table2 where user = 'user1' and date = '01/22/09'
go
select * from table3 where user = 'user1' and date = '01/22/09'
I need to do it for different user and date values. Every time
I have to go and change them. It would be great if somehow it was
possible to have some kind of "macro" capability.
Thanks
Offline
Actually it is possible to do right now. Take a look below
define var_user = 'user1'
define var_date = '01/22/09'
select * from table1 where user = $(var_user) and date = $(var_date)
go
select * from table2 where user = $(var_user) and date = $(var_date)
go
select * from table3 where user = $(var_user) and date = $(var_date)
Offline
I tested this feature for Oracle and see that it is not working properly. It is working for Sybase without problem..
Offline
In case of Oracle you have to reference variable like this &var_user.
The reason is to be compatible with SQL *Plus
Offline
Right, I had done this part alright.
One difficulty is that the "grid" applies to the results of all the queries. So each column gets the width of the widest column of ANY of the queries. So a column with a sindle digit number as a value can take half the screen width, if the corresponding column number in an unrelated query was a string(100).
Is it possible to "break" the grid horizontally into pieces so each query results are efficient to read ?
The 'break' of the grid could be a cmd option e.g : cmd results = new [grid | tab]
by placing these cmd options in between the sql queries, one could structure the results as desired.
Last edited by Akorde (2011-05-20 15:33:59)
Offline
You can put results in multiple grids by holding SHIFT key while executing query.
Offline