|
-
Hi,
athough it's possible to do that, it is, as you said, inefficient.
Consider that processing of your code will parse, execute and fetch a query for each field you want to select. The queries will be stored in the library cache without chance to be reused. (Once again, use bind variable for sCode.)
Generally, it's advisable (and only possible, IMHO) to use dbms_sql for variable select-list since you have access to metadata. That means you can construct a query, parse, execute, get metadata and fetch. In the metadata you find the count of fields that the query returns and since the're indexed by integer you can easily concatenate their values in one string with a loop taking an advantage of implict conversion to char type.
If you still want to use NDS and don't want to decrease performance, use the trick with null fields I posted earlier. Then open the cursor CurFeld again and in a IF-THEN-ELSIF-ENDIF statement concatenate only the columns you selected. Looks clumsy but will perform better.
Ales
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|