kho@joplin.mpr.ca (Peter Kho) (11/17/90)
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!!!. I've also tried to implement using Ingres ESQL/FORMS but ran into trouble when I need to implement the search feature. I cannot use the LIKE predicate to do the search anymore either in procedures or otherwise as, according to the manuals, the LIKE predicate syntax is as follows: columnname LIKE 'string constant' I'm stumped. Can anyone help?? Please email me or post a reply. Thanks. --------------------------------------------------------------- Peter Kho MPR Teltech Ltd 8999 Nelson Way Burnaby, BC CANADA V5A 4B5 Fax: 604.293.5787 Tel: 604.294.1471 Ext 5524
awe@iclswe.icl.se (Anders Weister) (11/20/90)
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 !