QBF q (OpenInsight Specific)
At 03 MAR 1998 06:42:20AM bwk@akribi.se wrote:
which routines are involved in the QBF function ??
which routines do they use for searching the database ??
/Bengt
At 05 MAR 1998 09:51AM Cameron Revelation wrote:
Bengt,
The QBF processing creates an RList statement. I will post the conversion code but I'm afraid it won't be much help as it is written in a BNF-style compiler-compiler language. The function which wraps the query execution is:
Oiwin_QbfDoQuery(winId, criteria, qbfIds, qbfRows, InspectFlag)
It returns the row count selected by the query operation.
Cameron Purdy
info@revelation.com
<code> DEFINITION * DEFINE BUFFERS * & SIZE 2000 AT 4000 @ SIZE 1000 AT 6000 | SIZE 1000 AT 7000 ;ID; SIZE 60 AT 100 ;WORD; SIZE 60 AT 160 ;INT; SIZE 10 AT 220 ;STR; SIZE 270 AT 230 ;STG; SIZE 270 AT 500 ;NUM; SIZE 16 AT 770 ;BAD; SIZE 40 AT 786 ;PRED; SIZE 200 AT 850 ;CRLF; SIZE 6 AT 1090 ;OPTS; SIZE 60 AT 1096 * ;DICT; SIZE 60 AT 1170 ;CP; SIZE 70 AT 1230 ;VAL; SIZE 100 AT 1300 ;FF; SIZE 10 AT 1400 * ;STRL; SIZE 500 AT 9000 ;NEW; SIZE 1000 AT 10000 * * ;MASKS; SIZE 800 AT 3000 ;SYMS; SIZE 200 AT 3800 * END BUFFERS * DEFINE STACKS * * END STACKS * DEFINE COUNTERS * #S SIZE 2 AT 0 #C1 SIZE 2 AT 2 #C2 SIZE 2 AT 4 #C3 SIZE 2 AT 6 * #G SIZE 2 AT 22 #NL SIZE 2 AT 24 #SEQ SIZE 2 AT 26 #BIN SIZE 2 AT 28 #SRCPOS SIZE 2 AT 30 #ERRNO SIZE 2 AT 32 #ERR SIZE 2 AT 34 #BAD SIZE 2 AT 36 #GOOD SIZE 2 AT 46 * #SRC SIZE 2 AT 4002 #OBJ SIZE 2 AT 6002 #LID SIZE 2 AT 102 #STR SIZE 2 AT 232 #STRL SIZE 2 AT 9002 #ID SIZE 2 AT 102 #FF SIZE 2 AT 1404 * * END COUNTERS * DEFINE MASKS * END MASKS * * DEFINE DATA SIZE 20000 * DEFINE STANDARD NAMES & ;OPTS; #S ;ID; ;INT; ;STR; ;STG; ;NUM; #SEQ ;SYMS; * * INITIALIZE * ;CRLF;\0D0A\ #STRL=0 ;STRL;\00\ * FORCE NULL ONTO LIT POOL ;FF;;FF; ;FF;\FD\ +#FF +#FF * && @@ ;NEW;;NEW; ;BAD;;BAD; #GOOD=T #BAD=F #ERRNO=0 ;PRED;;PRED; END INITIALIZE * = <code> %RETURN.OBJ% =@@ @'BAD' @^ #SEQ=#SRCPOS %TOASCII% @;NUM; @^ + #SEQ=#ERRNO %TOASCII% @;NUM; %RETURN.OBJ% * <code> = ELSE = { + ELSE ( #BAD=T ) } ?#BAD? %RETFALSE% * = { + ELSE ( #BAD=T ) } ?#BAD? %RETFALSE% * =OR " @' OR ' * =AND " @' AND ' * =(" @'(' ")" ELSE @' )' = <code> @' WITH ' @;PRED; * * <code> =;PRED;;PRED; ELSE * =#S=T %TRIMF% %CONTINUE% BEGIN CASE BYTE & CASE "=== ;PRED;'= CASE "" ;PRED;' ' ="=]= ;PRED;' ]= ' =]" ;PRED;' ] ' CASE ""=" ;PRED;' ' =" ;PRED;' ' CASE ""=" ;PRED;' ' END CASE * =;ID;;ID; %TESTWORD% ELSE ;PRED;;ID; * =%TESTSTR% ELSE ;PRED;;STG; * =#ERR=1 =#ERR=2 =#ERR=3 =#ERR=4 =#ERR=5 =#ERR=6 =#ERR=7 =?#ERRNO? ELSE ( #S=T #ERRNO=#ERR #SRCPOS=#SRC ) %RETFALSE% END</code>
At 05 MAR 1998 04:17PM Aaron Kaplan wrote:
I know how to read this! I know how to read this!
Just as an example, QBF as written will not allow for
{FIELD1}={FIELD2} since the second value must be a literal.
<code> =;PRED;;PRED; ELSEThe COLREF rule
=;ID;;ID; %TESTWORD% ELSE ;PRED;;ID;tells me that a valid column reference will, null out the ID buffer, validate against the current dictionary then place the contents of ID in the PRED buffer. If the column referece cannot be validated, then execute rule ERR5
The LITERAL rule,
=%TESTSTR% ELSE ;PRED;;STG;does pretty much what you would expect based on the code given.
I hope this clarifies this.
apk@sprezzatura.com