Re: CONSTRUCT bytes
Posted in 1992
In article <8954@emory.mathcs.emory.edu>, jbaker@lexington-emh2.army.mil ("John Baker, Lex-Blue Grass Army Depot") writes: |> How many bytes does the Construct clause (version 4.0) require for the variable |> that will hold the selection criteria ("char-variable" in the syntax below)? .... |> Remember: The char-variable that I'm using with CONSTRUCT is defined in my |> 4GL program to be char(80) in length. |> So the question is why can't I enter up to 80 characters????? |> And why are there differences between entering just letters vs pipes??? How |> many bytes do pipes take up? First of all, remember that what CONSTRUCT produces is a fragment of SQL code. The easiest way to figure out what's going on is to look at the string it produces, either by DISPLAYing it, or if you have fgldb, looking at it in the debugger, which is what I just did. On my platform (sun4 running RDS 4.10.UC1), "A|B|C" in a CONSTRUCT yields 'field_name in ("A","B","C")' so you have to allow a few bytes for the syntax (the number depending on the length of the field name), plus 3 bytes "overhead" per alternative, to leave room for the quotation marks and commas. I routinely allow 300 bytes for my CONSTRUCT variables, and I've still occasionally had it overflow when users construct complicated queries. But since you're only querying on one field, 80 bytes seems like plenty. -- Harry Bochner bochner@das.harvard.edu