开发者

Loop structure in select clause

开发者 https://www.devze.com 2023-03-25 02:08 出处:网络
I am writing a query where the number of columns is not fixed and dependent on the number of values provided by another table. Hence I am not able to write a static query that specifies the number of

I am writing a query where the number of columns is not fixed and dependent on the number of values provided by another table. Hence I am not able to write a static query that specifies the number of columns being selected. I need t开发者_C百科o apply something similar to a loop structure where the number of columns are created dynamically depending on the values provided. Is it possible to use loop structure in select clause ? In case this is not possible then I may have to use a procedure to build the query dynamically. Thanks in advance


Create your query dynamically and execute it using 'EXECUTE IMMEDIATE'. Refer http://download.oracle.com/docs/cd/B12037_01/appdev.101/b10807/13_elems017.htm for more details

0

精彩评论

暂无评论...
验证码 换一张
取 消