Hi Ansgar,
Would it be possible to use some magic to make the CTE columns suggest the same way as when suggesting from the actual table?
Short video: https://is.gd/2NOfYH
Hi Ansgar,
Would it be possible to use some magic to make the CTE columns suggest the same way as when suggesting from the actual table?
Short video: https://is.gd/2NOfYH
You mean the id column from the dynamic cte result/table? Well, that's not a real table which can be parsed before the result exists. The only thing I could think of is parsing the query with a regex, for instance:
WITH\s+(\S+)\s+AS\s+\(\s*SELECT\s+(.*)\)
... and then use the first group as the table name, and the second one for the column names. That would of course not know the data types of the columns. Also, if you use table aliases, the parsing would go up in horror I'm afraid.
Please login to leave a reply, or register at first.