Re: variables in ad hoc queries
От | Iain Barnett |
---|---|
Тема | Re: variables in ad hoc queries |
Дата | |
Msg-id | BE4A60A0-D6C4-4975-96DA-CE4CF2AAAEDC@gmail.com обсуждение исходный текст |
Ответ на | Re: variables in ad hoc queries (Brian Modra <brian@zwartberg.com>) |
Список | pgsql-general |
Sorry, in oversimplifying for clarity I was making it more unclear! Whenever I write a function, I like to write a quick ad hoc test to go with it in the comments. It means I can also test combinations of functions together quickly, without having to build other functions first, and gives anyone reading the function a quick idea of the type of inputs/outputs they might see. I've mostly worked with SQL Server, and with that I can write statements that might need to be within a function in ad hoc fashion. A common example is when I write an insert statement that returns the primary key of the inserted row. I'd like to capture that in a variable and run it through other functions. To be able to declare variables outside a function would be helpful in this respect. It's just a quick way to an easy test, in my view, but if it's not possible then that's ok, I'll just write full blown test functions from the start. Regards, Iain
В списке pgsql-general по дате отправления: