Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Custom query interface

Status
Not open for further replies.

jlockley

Technical User
Nov 28, 2001
1,522
US
I was sure I had posted this question here, but I can't find it, so here goes again.
I have a 400+ field database, which I need to query frequently. I have tried dividing it up, but that doesn't work for me, so it's got a tapeworm of a query interface which keeps me from the data mining I need to do.
I have been trying to figure out how to put a new face on it like a .frm fil unsuccessfully.
I am not exactly proficient in sql, but I can work in a framework if I have one.
I found Mike Irwin's piece on Parameterized queries and have been trying to adapt it.

I don't quite get the if then phrases. I don't think they are what I need. What I would like to do is change the query as needed showing producing a table containing all fields limited to parameters entered in text boxes.

I don't this will do it. Any thoughts?

stNAMEID is blank() then
stNAMEID = "check"
else
stNAMEID = "check" + stNAMEID
endif
;...................
stLOCATION is blank() then
LOCATION = "check"
else
LOCATION = "check" +LOCATION
endif
 
I, for one, haven't the foggiest idea of what you are trying to do, nor how your example pertains to what you are trying to do.

If you have info after "check", you need to put a space in there ("check "+LOCATION).

I don't see "IF" for your example. Where would it go?

If we don't know what your variables represent, you aren't going to get the best responses.

** Are you trying to create a visual interface for a query? **

Help us out a bit, so maybe we can provide some better suggestions.



Tony McGuire
"It's not about having enough time; we have the rest of our lives. It's about priorities.
 
I on the other hand do have the foggiest idea of what I am trying to do. Yes, visual interface query. I found a better guide and will try that tonight. Let you know how it goes.

(The key word here is foggiest.)Thanks for the response. I just don't get the context of the if then else statement. My bad. Need to go back and look at OPal again, which is just not something that seems to work well in my head. I thought afterwards I should have done that before posting. sorry,
 
The basics of the if..else is

If [something] [is true] then [do this] else [do this] endif


; you didn't have the 'if' so I am assuming

if stNameId.isblank() then ; if 'stNameId' has no characters
stNAMEID = "check" ; assign 'check' to stNameId
else ; otherwise
; assign 'check' plus the value of stNameId
stNAMEID = "check" + stNAMEID
endif

Which line containing 'check'+stNameId is INCORRECT and will fail. It must be "check "+stNameID (note the space after 'check'.

As to what it is doing, again I must guess that you are setting up a query in code. You are defining variables, it appears, that will appear in a query statement as '~' values in various fields in the query.

Again, if you would show a bit more code it might make what you are trying to do evident to us.

Tony McGuire
"It's not about having enough time; we have the rest of our lives. It's about priorities.
 
You may want to have several dropdowns filled with the various fields that can be queried, and a corresponding field where the query criteria can be filled in.

Then programmatically do the query based on field(s) chosen with the criteria the user has filled in.

And THAT programming would be where your IF statement(s) come in. Although you could enter the 'check' portion on all fields you want included, and as long as the variable is defined just use the variable in the query without worrying about the user filling anything in.

===================================
As to 400+ field database (table), are you sure this is Paradox? The limit for Paradox/table is 255 fields.

I'd like to get a copy of that table if you indeed have that many fields; empty table would even be appreciated.

The only way I know around this limitation is if it is a dBase table; but even that won't reach 400 if I recall correctly.

Either way, enlightenment appreciated.

Tony McGuire
"It's not about having enough time; we have the rest of our lives. It's about priorities.
 
As to 400+ field database (table), are you sure this is Paradox?
Sure it is Paradox, but not 400. It's 200. Still too many. Typo. Sorry. The missing "IF' came from a bad cut and paste. If then else is clear, but the parameters are still unclear to me.

And, yes, that's what I am trying.

I would be the user. I need to be able to enter an ever changing set of criteria to find people with varied volume, skill levels, styles, etc (I find chefs for restaurants). I missed a big casino because my data mining has just got too clumsy.

I have since figured out is time to review all I can in Opal, and will come back when I am a little more solid in the knowledge end. I found another example I am playing with, too.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top