Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!think.com!paperboy!snorkelwacker.mit.edu!bloom-beacon!eru!hagbard!sunic!iclswe!awe From: awe@iclswe.icl.se (Anders Weister) Newsgroups: comp.databases Subject: Re: Ingres 4GL/FORMS (Help!!) Message-ID: <1990Nov19.193041.11013@iclswe.icl.se> Date: 19 Nov 90 19:30:41 GMT References: <2439@kiwi.mpr.ca> Distribution: comp.databases Organization: ICL, Sweden Lines: 40 kho@joplin.mpr.ca (Peter Kho) writes: >Hi there, database gurus: >I've a problem that someone out there might have solved or can point me >in the right direction to the solution. >H/W: HP-UX 7.0 on HP9000 >S/W: Ingres 6.2 >Problem: >Need to provide a user interface where the user can specify one or more >conditions to be apply to the SQL select statement. That is the SQL >select will not be known until run-time. This implies using dynamic SQL >to prepare and execute the SQL statement. Another feature required is >that the user should able to search back and fro on the data set >retrieved by giving a pattern to match. E.g. "%Smith%". >I've tried to implement the solution using Ingres 4GL but ran into >trouble as I cannot build the SQL dynamically. I can get around this >problem by creative coding of the SQL statement. Problem is this >approach is too slow!!!. Sounds like you need the qualification statement: empform := select idnum=empnum, age, salary=empsal from employee where qualification (age=age, empsal=salary); This function builds a where clause based on the values in the specified simple fields of the current form. Check your ABF/4GL Reference manual. -- ! Anders Weister, M.Sc ! ! ICL Data AB ! ! S- 194 85 Upplands Vasby ! ! Sweden !