Re: Construct Line Length Limit
Posted in 1998
Jonathan Knight wrote: > > In 4GL, where you have a construct statement, if the user enters a query > string longer than the field you can continue entering the code on the > comment line. If you reach the end of the comment line you can't enter > any more. Is there any way to create a longer query using the P-code > compiler *without* using C? > > Jon A possible way around the problem is to use a wider screen, if your terminal or emulator allows this. The comment line will then be longer. I assume you are using the full screen width already and not a smaller window. I don't know of any other way but I haven't looked hard for one as I have never had a query which required a specification longer than 78 characters. I'm curious to know how you manage to exceed this limit. Another possible approach, assuming you exceed the limit because of repeated use of the or bar, is to provide another field which is explicitly ORed with the original. You'd need to do a bit of editing on the constructed where clause to make it work but it shouldn't be too difficult, especially if you choose your pseudo-field name to be long enough to avoid any insert operations on the string. It works like this: CONSTRUCT mystring ON t1.myfield, t1_or.myfielx FROM query.* You then search mystring for the string "t1_or.myfielx" and replace it with "OR t1.myfield". "t1" is a table alias. I always use them in CONSTRUCTs. I haven't tested this approach. A possible problem has just occurred to me: you would need to bracket the "x OR y" expression to ensure it is combined correctly with the ANDs in the rest of the constructed string. -- Peter Lancashire Information Systems Specialist, Bayer plc Eastern Way, Bury St Edmunds, Suffolk, IP32 7AH, UK Tel: +44-1635-562258, Fax: +44-1635-562281 --- If all else fails, read the instructions AND the release notes. All opinions are my own and not those of Bayer plc. My Internet plumbing does not allow me to mail and post news together. Sorry. --- Join Infuse, the UK Informix User Group at http://www.infuse.org.uk/