Alpha DevCon 2018
Results 1 to 14 of 14

Thread: How to delete a custom query

  1. #1
    Member
    Real Name
    D.Chiasson
    Join Date
    Jan 2004
    Location
    West Coast of Canada
    Posts
    622

    Default How to delete a custom query

    I can save a query, recall it but how does one REMOVE a query. Thanks to Cal!!!!

    There is a limit as to how many queries can be saved per data file & the oldest gets deleted if you exced the limit. How be a pain if you have an old query that took you an hour to make & it got deleted because it was the oldest. Is that correct?

    To me, the custom query process management tools are VERY weak to be kind.

    dewayne

  2. #2
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,298

    Default Re: How to delete a custom query

    dewayne,

    It's not clear what you are struggling with.

    To delete a saved query operation go to the operations tab of the control panel and right click on it. Piece of cake.

    There's no limit to the number of query "operations" you can save to the operations tab of the control panel. Perhaps you need to learn how to save a query operation. Is this the problem?

    Alpha Five has a limit on the number of unsaved temporary query lists that are maintained internally. Considering the fact that these lists are static and do not get updated with changes the user makes to the data how many more would you want Alpha to keep track of for you when a single edit to a single record may render them all invalid.

    I recommend you revisit the Users Guide. The chapter on sorting and selecting records has a good topic on queries.

  3. #3
    Member
    Real Name
    D.Chiasson
    Join Date
    Jan 2004
    Location
    West Coast of Canada
    Posts
    622

    Default Re: How to delete a custom query

    Morning. My mistake post done before brain in gear & not enuf detail on my part.

    I can & know how to delete a Query as I have a full version of A5V8 but what I "should have" said is how does a user with only the Runtime version (V5V8) delete a custom Query he made & saved. That is our prob.

    Thanks for the reply.....

    DeWayne

    Quote Originally Posted by Tom Cone Jr View Post
    dewayne,

    It's not clear what you are struggling with.

    To delete a saved query operation go to the operations tab of the control panel and right click on it. Piece of cake.

    There's no limit to the number of query "operations" you can save to the operations tab of the control panel. Perhaps you need to learn how to save a query operation. Is this the problem?

    Alpha Five has a limit on the number of unsaved temporary query lists that are maintained internally. Considering the fact that these lists are static and do not get updated with changes the user makes to the data how many more would you want Alpha to keep track of for you when a single edit to a single record may render them all invalid.

    I recommend you revisit the Users Guide. The chapter on sorting and selecting records has a good topic on queries.

  4. #4
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,298

    Default Re: How to delete a custom query

    Good morning.

    I didn't realize that a runtime user could create and save a custom query. Can you walk me through the steps so I can understand the scenario more fully? I guess I'm still not sure what you mean by a "custom query". -- tom

  5. #5
    VAR
    Real Name
    Cheryl Lemire
    Join Date
    Jul 2003
    Location
    Pembroke Pines, FL
    Posts
    2,914

    Default Re: How to delete a custom query

    I can only guess that dewayne is talking about queries that are created on the fly by users with query by form, key, index, etc. This is the only place that I am aware of where there are limitations. With this 'guess'

    dewayne,

    If your users are creating complex queries that need to be used on a regular basis, may I suggest that you create a query operation for them and allow them to run that script whenever they need it via a specific query button. This way you do not have to worry about the query being deleted.

    If my 'guess' is off the wall, you need to be much more specific with the problems. Where are you users in the runtime when they are creating the queries in the first place? Exactly what steps are they taking to create this query? Provide us with a zipped up sample of the db and give us exact steps to duplicate the query creation. Then tell us 'how' you know their query has been deleted.

    The 'devil is in the details'. I do not remember how many threads I have read that it .... but if you do not give us enough samples and step by step instructions to duplicate the problem .... we are all only guessing at what the actual problem is .... hence, our solutions are only guesses as well. It saves everybody a lot of time when details and samples are provided.
    Cheryl
    #1 Designs By Pagecrazy
    http://pagecrazy.com/

  6. #6
    "Certified" Alphaholic
    Real Name
    Mike Christensen
    Join Date
    Nov 2005
    Location
    Michigan U.P.
    Posts
    5,907

    Default Re: How to delete a custom query

    Tom, Cheryl,

    This sounds so much like a previous thread I read in which Tom took part in quite a while ago.

    http://msgboard.alphasoftware.com/al...ight=statusbar

    Regardless, I guess it is possible to Save a query produced with Query by Genie, Query by Expression, etc. And apparently this can be done in a runtime situation as well--good to know! They can be brought back with the Query-->Run Saved Query menu selection. It looks like they should be able to be deleted by selecting the yellow Select Index/Query icon toward the right side of the toolbar....but it is grayed out. Once I finally figured out what DeWayne wanted (I think!) it took just a few minutes to find. You two did the hard work of "20" questions/guesses!

    If the control panel is accessible then the saved queries can be deleted from the Operations tab.

    But if this is the case then an unlimited amount of queries can be saved---maybe DeWayne is talking about the saved filters which most likely do have a limited amount. Which can be deleted easily by choosing menu item Query-->Select Index/Query or the same named icon on the right side of the toolbar. But the saved filters need not be saved (or deleted) as it is the saved queries that generate them anyway........

    The way to delete an operation would be to use

    object_operation("query","queryOperationName","","delete")


    Now I suppose we better wait to see if I guessed correctly! :)
    Last edited by MikeC; 11-17-2007 at 03:17 AM.
    Mike
    __________________________________________
    It is only when we forget all our learning that we begin to know.
    It's not what you look at that matters, it's what you see.
    Henry David Thoreau
    __________________________________________




  7. #7
    Member
    Real Name
    D.Chiasson
    Join Date
    Jan 2004
    Location
    West Coast of Canada
    Posts
    622

    Default Re: How to delete a custom query

    I am not a programmer so plse bare with me. Ad hoc to moi means made on the fly, used once & NOT saved. A custom query is one that a user gives a name to, saves, recall so it can be APPLIED to a report.

    These NON-programmer users could spend a considreable time to prepare an elaborate query. Needless to say, sometime in the future they would like to enjoy the fruits of their labour & use the query again.

    These Queries are developed by each user for their specific use, they are NOT generic.

    Cheryl, you mention a "specific query button". Would this button allow saving, naming & deletion of any saved queries that mite not be needed?

    There is no problem with developing, naming & saving of "custom" queries so the steps are not an issue. The only prob is how would a user with only a RUNTIME delete one of these queries.

    Please fire away for more details & I will try to fill in any gaps.

    Thanks....you Folks are Champions!

    dewayne

    Quote Originally Posted by Cheryl Lemire View Post
    I can only guess that dewayne is talking about queries that are created on the fly by users with query by form, key, index, etc. This is the only place that I am aware of where there are limitations. With this 'guess'

    dewayne,

    If your users are creating complex queries that need to be used on a regular basis, may I suggest that you create a query operation for them and allow them to run that script whenever they need it via a specific query button. This way you do not have to worry about the query being deleted.

    If my 'guess' is off the wall, you need to be much more specific with the problems. Where are you users in the runtime when they are creating the queries in the first place? Exactly what steps are they taking to create this query? Provide us with a zipped up sample of the db and give us exact steps to duplicate the query creation. Then tell us 'how' you know their query has been deleted.

    The 'devil is in the details'. I do not remember how many threads I have read that it .... but if you do not give us enough samples and step by step instructions to duplicate the problem .... we are all only guessing at what the actual problem is .... hence, our solutions are only guesses as well. It saves everybody a lot of time when details and samples are provided.

  8. #8
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,298

    Default Re: How to delete a custom query

    Dewayne, here's my confusion. I open the runtime. I load AlphaSports. I close the main menu and arrive at the control panel. From here I want to define and save a query operation. I can't. The runtime doesn't permit me to create a "new" query operation. I'm forced to conclude you're not talking about saved query operations.

    So then I open a form and use query by form to define and run a query. Works fine. But there's no option available to "save" my new custom query. So you're not talking about this, either.

    What am I missing? Can you describe for us the steps the runtime user would go through to define and save the kind of query you want to be able to delete?

    -- tom

  9. #9
    "Certified" Alphaholic
    Real Name
    Mike Christensen
    Join Date
    Nov 2005
    Location
    Michigan U.P.
    Posts
    5,907

    Default Re: How to delete a custom query

    Tom.

    In runtime (I used a version 5 runtime version of my current App), Open a form or browse, go to the top menu and choose Query-->Query Genie.

    Choose some filter criteria that suits the form/browse. Now choose the save icon on the bottom of the filter genie and save the query. This query will now be one of the saved queries that are under the Operations tab of the control panel (along with any saved queries created during development).

    The only way I can see to delete such a saved query would be to use the function I showed in the prior post

    object_operation("query","queryOperationName","","delete")


    But the question remains--Is there not a very high number of these that can be saved in the operations area?? So DeWayne must be referring to something else such as the filters that are produced by these queries...maybe these only reach a certain number and then the earliest deleted??? Which is really nothing to be concerned about seeing as how these filters are only produced when a query is run.

    DeWayne still has not answered all the questions asked so I am at a loss as to whether what I stated here and before is correct or .....
    Mike
    __________________________________________
    It is only when we forget all our learning that we begin to know.
    It's not what you look at that matters, it's what you see.
    Henry David Thoreau
    __________________________________________




  10. #10
    Member
    Real Name
    D.Chiasson
    Join Date
    Jan 2004
    Location
    West Coast of Canada
    Posts
    622

    Default Re: How to delete a custom query

    I will go thru the process if I have got your ? right:
    1.open the Work module (its Form is based on WORK.SET)
    2.Clicks Query Genie icon. Sets some conditions & filters
    3.Saves the Query as "PM WORK"
    4.at end of month goes to a report called "Work for Month" which is based on WORK.SET. Selects "Records selected by saved query". Goes to the Query above & presto the report comes out how he expects with only records based on the previously designed & saved query.

    I had a look at Operations & of course, there is a query called "PM WORK" as expected.

    Works very well, other than how does a user, delete this query at a later time.

    dewayne

    Quote Originally Posted by Tom Cone Jr View Post
    Dewayne, here's my confusion. I open the runtime. I load AlphaSports. I close the main menu and arrive at the control panel. From here I want to define and save a query operation. I can't. The runtime doesn't permit me to create a "new" query operation. I'm forced to conclude you're not talking about saved query operations.

    So then I open a form and use query by form to define and run a query. Works fine. But there's no option available to "save" my new custom query. So you're not talking about this, either.

    What am I missing? Can you describe for us the steps the runtime user would go through to define and save the kind of query you want to be able to delete?

    -- tom

  11. #11
    Member
    Real Name
    D.Chiasson
    Join Date
    Jan 2004
    Location
    West Coast of Canada
    Posts
    622

    Default Re: How to delete a custom query

    Good day.

    I am unsure whether you are addressing your remarks to Tom or myself? Which ? or ?'s am I supposed to answer or did not?

    You descibe exactly what we do. There are a number of Saved Queries in the Operations tab with various filters & "and's" & "or's" conditions.

    I will have to speak to my programmer about the "object_operation("query","queryOperationName","","delete")

    I do not understand your remark "...DeWayne must be referring to something else such as the filters that are produced by these queries...maybe these only reach a certain number and then the earliest deleted???"

    The delete operation above could be what we need. THANKS.

    dewayne

    Quote Originally Posted by MikeC View Post
    Tom.

    In runtime (I used a version 5 runtime version of my current App), Open a form or browse, go to the top menu and choose Query-->Query Genie.

    Choose some filter criteria that suits the form/browse. Now choose the save icon on the bottom of the filter genie and save the query. This query will now be one of the saved queries that are under the Operations tab of the control panel (along with any saved queries created during development).

    The only way I can see to delete such a saved query would be to use the function I showed in the prior post

    object_operation("query","queryOperationName","","delete")

    But the question remains--Is there not a very high number of these that can be saved in the operations area?? So DeWayne must be referring to something else such as the filters that are produced by these queries...maybe these only reach a certain number and then the earliest deleted??? Which is really nothing to be concerned about seeing as how these filters are only produced when a query is run.

    DeWayne still has not answered all the questions asked so I am at a loss as to whether what I stated here and before is correct or .....

  12. #12
    "Certified" Alphaholic
    Real Name
    Mike Christensen
    Join Date
    Nov 2005
    Location
    Michigan U.P.
    Posts
    5,907

    Default Re: How to delete a custom query

    DeWayne,

    There is a limit as to how many queries can be saved per data file & the oldest gets deleted if you exced the limit.
    This is what I was referring to and what I do not understand where the problem is. If there is a limit on how many Saved Queries you can have under the Operations tab it must be a very large amount. The only thing I could even guess at what you meant was

    "...must be referring to something else such as the filters that are produced by these queries...maybe these only reach a certain number and then the earliest deleted???"
    Just color me confused! :confused: :)

    But hopefully the function I found will do what you want. I would perhaps use a variable for the query name and have a way to set it prior to pressing a Query Delete button...Very possible to have an xDialog come up which lists the names of all the saved queries and then pick the one you want---there was one produced today by Mike Wilson for doing a similar task with reports.



    This thread has definitely been beneficial for me (and hopefully others as well) in that I had no idea a query could be saved during runtime like you (or your users) have done.
    Mike
    __________________________________________
    It is only when we forget all our learning that we begin to know.
    It's not what you look at that matters, it's what you see.
    Henry David Thoreau
    __________________________________________




  13. #13
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,298

    Default Re: How to delete a custom query

    Mike, thanks. I did not realize that the runtime user could save a query operation defined with the query genie. I think a script could be written that would list the saved query operations for a table and then delete the one selected by the user. It looks like this would have to be done separately for each table that might have a saved query operation. I don't see a way for the runtime user to delete a saved query operation from the control panel.

    Later...
    Here's an example cobbled together from Alpha Sports. Unzip to empty folder. Use the default form and the query genie to define and save a few queries. Then run the DelCustQryOp script on the Code page of the control panel to delete one.

    If you want to test this in the runtime use the button on Form1, since the Code page of the control panel is not available to the runtime user.
    Last edited by Tom Cone Jr; 11-20-2007 at 05:44 AM. Reason: Attach example

  14. #14
    Member
    Real Name
    Paul Verboom
    Join Date
    Apr 2006
    Location
    Halifax, Nova Scotia, Canada
    Posts
    130

    Default Re: How to delete a custom query

    For anyone that comes across this thread in the future.

    I was faced with the same problem, so taking the information in this thread I was able to create a very simple script to allow the end user to delete Queries.

    It can be found at the following post 110212-Script-for-end-user-to-delete-user-created-Queries

Similar Threads

  1. Custom Query
    By Leo Cohen in forum Alpha Five Version 6
    Replies: 0
    Last Post: 09-27-2004, 12:33 PM
  2. Custom Query Form
    By Rick Canady in forum Alpha Five Version 5
    Replies: 1
    Last Post: 01-11-2004, 09:36 PM
  3. Custom Query
    By Phil Rolf in forum Alpha Five Version 5
    Replies: 5
    Last Post: 01-03-2003, 03:56 AM
  4. Custom query
    By Dave Swubtib in forum Alpha Five Version 5
    Replies: 3
    Last Post: 11-27-2002, 04:18 PM
  5. Custom Toolbar query
    By Graham Wickens in forum Alpha Five Version 4
    Replies: 4
    Last Post: 12-03-2000, 10:48 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •