3 ms·
What are you referring to as "SQL"? As far as I know, ISO-standard SQL doesn't have variables outside of its procedural language. I'm also not aware of any SQL-
by dvdkon 6y ago
What are you referring to as "SQL"? As far as I know, ISO-standard SQL doesn't have variables outside of its procedural language. I'm also not aware of any SQL-wide naming conventions. But I haven't read any of the standards, so I could be missing something.
- throw1234651234 6y ago"T-SQL" - in reality, everyone just refers to it as SQL Server even though it's obviously not a language. I find this syntax super helpful: DECLARE @someName AS VARCHAR(100) SET @someName= 'Bob' When coupled with SPs and Functions, you can write some fairly readable logic in SQL. I am completely against this for most applications, but when you need it, it helps.
- dvdkon 6y agoOh, alright. I know T-SQL and have actually missed variables in PostgreSQL before. Just please don't shorten it to "SQL", it's only one dialect of many.
- dragonwriter 6y ago> have actually missed variables in PostgreSQL before You can just use a DO-block with plpgsql (or any other installed procedural language) code to make variables available in Postgres. T-SQL just somewhat elides the distinction between declarative and procedural code. https://www.postgresql.org/docs/current/sql-do.html https://www.postgresql.org/docs/current/sql-do.html