Allan, Thanks for the reply I guess what I am actually looking for is an example of a dynamic SQL select statement similar to how a static sql select can select into a variable.
Thanks, Curtis Curtis, Here is an example function that uses dynamic sql. I use it under 7.4.5 Hope this helps. Allan ---------------------------(end of broadcast)--------------------------- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match