Help Please with Faulty ObjectPAL Query Structure... 
Author Message
 Help Please with Faulty ObjectPAL Query Structure...

In Paradox 4.5 for Windows I have a table named DWNLOAD.DB. I want the
user to be able to perform searches by entering text in a field named
BoolFld1. The code below picks up the "value" of that field, placing it
in a variable named BF1. A query structure follows in which the contents
of BF1 are compared with data in every field in each record. The results
should be written to ANSWER.DB. Note that I have "commented" two of the
lines in the query structure.

Here are my two problems:

1) When the two lines of the query ARE "commented" and I perform a search,
the file ANSWER.DB is created, but it is empty of records (though the
search should have been satisfied).

2) When the two lines of the query are NOT "commented" and I perform a
search, I get the message "An error was triggered in the 'executeQBE'
method on an object of Query type" and the ANSWER.DB file is NOT created.

Can anyone help???

JEFFREY

------------------------------------------------------------------------------
method pushButton(var eventInfo Event)
   var
      fq Query
      BF1 String
   endVar
   doDefault
   BF1 = (BoolFld1.value)

   fq = Query

      ANSWER: :WORK:ANSWER.DB
      :WORK:DWNLOAD.DB | Title         | Author        | Address       |
                       | Check ..BF1.. | Check ..BF1.. | Check ..BF1.. |
;     :WORK:DWNLOAD.DB | Source        | Year          | Language      |
;                      | Check ..BF1.. | Check ..BF1.. | Check ..BF1.. |
      :WORK:DWNLOAD.DB | Major_Mesh    | Abstract      | Keywords      |
                       | Check ..BF1.. | Check ..BF1.. | Check ..BF1.. |

   EndQuery

   executeQBE(fq,":work:answer.db")
endmethod



Mon, 02 Dec 1996 20:01:30 GMT
 Help Please with Faulty ObjectPAL Query Structure...


Quote:
>In Paradox 4.5 for Windows I have a table named DWNLOAD.DB. I want the
>user to be able to perform searches by entering text in a field named
>BoolFld1. The code below picks up the "value" of that field, placing it
>in a variable named BF1. A query structure follows in which the contents
>of BF1 are compared with data in every field in each record. The results
>should be written to ANSWER.DB. Note that I have "commented" two of the
>lines in the query structure.
>Here are my two problems:
>method pushButton(var eventInfo Event)
>   var
>      fq Query
>      BF1 String
>   endVar
>   doDefault
>   BF1 = (BoolFld1.value)

Change this line to:
BF1 = ".."+string(boolfld1.value)+".."

Quote:
>   fq = Query
>      ANSWER: :WORK:ANSWER.DB
>      :WORK:DWNLOAD.DB | Title         | Author        | Address       |
>                       | Check ..BF1.. | Check ..BF1.. | Check ..BF1.. |

and change ..BF1.. to "tilde"BF1 (sorry my telcom program remaps the
tilde character). Thats your first problem.

The second problem is that the way the query is written now it is trying
to find a line with the patten "BF1" in all fields. You either have
to do a multiline "or" statement (see page 185 in Users guide
"Specifying OR conditions in different field") or know what field
you are querying and use a different variable for each field.

If you have trouble with queries try them out interactively before
using them in OPAL.

Good luck
Robert
--
Robert Cooper  Brooklyn, NY | "We don't know who discovered water, but

212 309-9600 (Work)         |           Attributed to Marshall McLuhan



Mon, 02 Dec 1996 21:38:29 GMT
 Help Please with Faulty ObjectPAL Query Structure...
Jeffrey Saikali asked why a particular query would not work:
 JS> Here are my two problems:

 JS> 1) When the two lines of the query ARE "commented" and I
 JS> perform a search, the file ANSWER.DB is created, but it is
 JS> empty of records (though the search should have been satisfied).

 JS> 2) When the two lines of the query are NOT "commented" and I
 JS> perform a search, I get the message "An error was triggered in
 JS> the 'executeQBE' method on an object of Query type" and the
 JS> ANSWER.DB file is NOT created.

My editor wrapped the query lines so that I cannot easily reproduce
it. Robert Cooper posted a response which nicely covers the question
of why, when the query runs, it does not produce any results. I
believe the answer to why the query will not even execute when the
lines are not commented is this.  The body of the query appears on
6 lines -- 3 sets of 2 lines representing on the first line the
name of the table and the field names and on the second line the
query instructions, such as Check. At least one blank line between
each of these sets of 2 lines is mandatory.  When you commented out
one set, the comment lines supplied the necessary blank lines
separating the remaining 2 sets so the query executed. When you
removed the comments, the mandatory blank lines were missing and you
got an error message.

 * Origin: PCUG BBS - San Francisco HST/V.32 415-621-2609 (8:914/201.0)



Tue, 03 Dec 1996 01:09:44 GMT
 Help Please with Faulty ObjectPAL Query Structure...

Quote:

>In Paradox 4.5 for Windows I have a table named DWNLOAD.DB. I want the
>user to be able to perform searches by entering text in a field named
>BoolFld1. The code below picks up the "value" of that field, placing it
>in a variable named BF1. A query structure follows in which the contents
>of BF1 are compared with data in every field in each record. The results
>should be written to ANSWER.DB. Note that I have "commented" two of the
>lines in the query structure.
>Here are my two problems:
>1) When the two lines of the query ARE "commented" and I perform a search,
>the file ANSWER.DB is created, but it is empty of records (though the
>search should have been satisfied).

  What you need is a query line with a check in each field first.  Then put
  one ..~bf1.. on each line in the field that you want.  Then check all the
  same fields on the next line and do the same thing, only putting the
  ..~bf1.. in the next field that you want.  Be sure you check all the same
  fields as before.

Quote:
>2) When the two lines of the query are NOT "commented" and I perform a
>search, I get the message "An error was triggered in the 'executeQBE'
>method on an object of Query type" and the ANSWER.DB file is NOT created.

You need to check for errors and do a
  if NOT executeQBE(fq,":work:answer.db") then errorshow() endif

This should give you more info on why it failed.

Quote:
>------------------------------------------------------------------------------
>method pushButton(var eventInfo Event)
>   var
>      fq Query
>      BF1 String
>   endVar
>   doDefault
>   BF1 = (BoolFld1.value)
>   fq = Query
>      ANSWER: :WORK:ANSWER.DB
>      :WORK:DWNLOAD.DB | Title         | Author        | Address       |
>                       | Check ..BF1.. | Check ..BF1.. | Check ..BF1.. |
>;     :WORK:DWNLOAD.DB | Source        | Year          | Language      |
>;                      | Check ..BF1.. | Check ..BF1.. | Check ..BF1.. |
>      :WORK:DWNLOAD.DB | Major_Mesh    | Abstract      | Keywords      |
>                       | Check ..BF1.. | Check ..BF1.. | Check ..BF1.. |
>   EndQuery
>   executeQBE(fq,":work:answer.db")
>endmethod


DataBase Designs, Inc.


Thu, 12 Dec 1996 02:26:39 GMT
 
 [ 4 post ] 

 Relevant Pages 

1. Similar Problem: Faulty ObjectPAL Query Structure

2. Similar Problem: Faulty ObjectPAL Query Structure

3. Query/View/Stored Proc structure - please help!?

4. APPROACH QUERY-PLEASE PLEASE PLEASE PLEASE HELP

5. APPROACH QUERY-PLEASE PLEASE PLEASE HELP

6. Need some help with ObjectPal methods please!

7. ObjectPal Questions, Please help!!

8. ObjectPAL help, please!

9. Help please with ObjectPal

10. deleting faulty queries

11. Calculating in a query using objectpal HELP!!

12. Pdx7 QUERIES -- ObjectPal SETcriteria HELP!!!!


 
Powered by phpBB® Forum Software