HELP: how do I evaluate an argument in string
Posted in 1995
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL
I am forwarding my friend's question here. If someone knows the answer please feel free to email me, or just post here. Thanks Heidi ************************************************************************** >Subject: Need help with informix > >I am doing a senior project and I have some difficulties. >So I'm writing to ask a question or two. > >Here is my situtation: > >System:Informix in Unix ver 4.1.1 (r4gl RDS, SQL) > >I have two tables, avail_course and academic_history for school course >information with the following fields course_no and prerequiste for the course. >Here's are some sample of data in those fields. > course_no = something like CSC450, CSC490, .... > prerequiste = something like (CSC250 AND CSC310 AND (MT134 or MT136) ) > >FUNCTION exist_course (prerequiste) > [......] >RETURN exist_or_not >END FUNCTION > >My question is in side the FUNCTION exist_course, how do I evaluate the >prerequiste and put it in the exist_or_not? That is when I have the > > (CSC250 AND CSC310 AND (MT134 or MT136) ) > >somehow I should be able to parse the string out and evaluate it to 0 or 1 >base on the the course_no exist in the academic_history table. Let say >CSC250, CSC310, and MT134 exist in the academic_history table then >exist_or_not will get 1 otherwise 0. > >The bottom line of my question is how do I evaluate an argument in string >format? > >Please let me know if you can help me with this question or if you can >forward this to anyone you think they can help me with it. Thank you >very much. > >Thank you again, >Kelvin