Re: Please Advice
Posted in 1997
Topics: General Discussion
I think you need to keep a counter of how deep you've gone, and PREPARE the cursor in the function using a statement identifier that includes this count. Something like: sprintf (c_id,"c%d",p_count); EXEC SQL prepare :c_id from 'select * from.... Greg Hi everybody ... Please excuse me if I make any error as this is the first time I use Informix. I use a function that contains a CURSOR to retrieve some records. Inside the function I call back the same function when certain condition are met (recursive function). Question : - Will the CURSOR be overwrite if I call the function ? - Can Informix handle a function that contain CURSOR recursively ? For example : I have 2 tables - LNK and PHL LNK - store the relationship between a follower and a leader PHL - store a number indicating which one is at higher level. The number for leader must > than follower A follower can have many leader and a leader can have many follower. Table : LNK Table : PHL follower leader Device Number ---------------------- ----------------------- B A A 4 C A B 1 D C C 3 E C D 2 F H E 1 G D F 1 G 1 H 2 This is the result I want to achieve (PHL table) when given the data in LNK table. Please advice ... Thanks