L
Laura Stern
Guest
You can always reference field values from the buffer that you are querying on in a dynamic query. The reason we cannot allow variables is that we do not have the same compiler context when we compile the query string for QUERY-PREPARE. I.e., We don't have any of the information that we get from compiling everything in the .p/.cls before this point. So we don't actually know what foo is if you are trying to compare to a variable called foo. Once we get to the run-time, we no longer know what the names of the variables are (yes, that is true!). We only know how to find their values (e.g., it is the 3rd field in the local variable buffer). That is the information that is saved in the r-code. So if you reference "foo", we won't know how to resolve that.
Continue reading...
Continue reading...