Naming query results

muzza4 posted 2 weeks ago in Feature discussion

Hi Anse

I have stored files with many queries in them, that I might run for one customer. For example I might have this (very simplified example) in a query...

  • set @cust = 13;
  • select * from person where customer_id = @cust;
  • select * from payment where customer_id = @cust;
  • select address from person where customer_id = @cust;
  • select * from somethingelse where customer_id = @cust;

The trouble is that with 10 queries it's hard to tell which each query result refers to, and I have to count the queries in the file I've run and then count along the query results to see what the result means.

How about letting the user name the query with a special HSQL command e.g. something like

  • set @cust = 13;
  • set qtab = customers;
  • select * from person where customer_id = @cust;
  • set qtab = payment;
  • select * from payment where customer_id = @cust;
  • set qtab = address;
  • select address from person where customer_id = @cust;
  • set qtab = somethingelse;
  • select * from somethingelse where customer_id = @cust;

Then each query could be clearly identified based on the qtab value.

Cheers Muzza

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