AugForums.com

An Acumatica User Group

  • Free
    • Start Here
    • Rolodex
    • Podcast
    • Blog
    • Forums
  • Paid
    • AugSQL
    • GI Course
    • GI Library
    • Consulting
  • Register
Acumatica Forums

By using this website, you agree to our Terms of Use (click here)

Forums
AugSQL
AugSQL
Saved SQL Queries
 
Notifications
Clear all

Idea - Planned Saved SQL Queries

 
Votes Received: 0

AugSQL
Last Post by AugSQL Developer 2 years ago
5 Posts
3 Users
3 Reactions
51 Views
RSS
Tim Rodman
Posts: 3193
 Tim Rodman
Admin
Topic starter
July 16, 2023 11:07 pm
(@timrodman)
Famed Member
Joined: 10 years ago

I'm kicking off an idea for saving SQL Queries in AugSQL.

 

In order to keep the current AugSQL (QQ900001) screen as clean as possible, I'm proposing that we create a new screen called AugSQL Saved Queries (QQ900003) with some additional functionality.

 

The AugSQL Saved Queries (QQ900003) screen could be modeled after the first couple of fields in the existing Automation Schedules (SM205020) screen which is pictured here:

image

 

Instead of Schedule ID in the previous screenshot, the 1st field could be called Query ID. Instead of Description in the previous screenshot, the 2nd field could be called Query Description.

 

Then the 3rd field could be called SQL Command, just like on the existing AugSQL (QQ900001) screen.

 

Below the SQL Command field could be the same results grid area that we have on the AugSQL (QQ900001) screen.

 

On the top could be an EXEC button, just like we have on the AugSQL (QQ900001) screen.

 

After the EXEC button, there would be additional buttons on the top. These buttons would mimic the buttons on the top of the Automation Schedules (SM205020) screen as shown in the previous screenshot:

1. Save (Ctrl+S)

2. Cancel (Esc)

3. Add New Record (Ctrl+Ins)

4. Delete (Ctrl+Del)

5. Go to First Record

6. Go to Previous Record (PgUp)

7. Go to Next Record (PgDn)

8. Go to Last Record

 

The Query ID lookup field would behave like the Schedule ID field on the front-end.

 

On the backend, the data that gets stored in the database would be similar to the data that gets stored in the database for Automation Schedules. The Query ID would just get stored as an auto-incrementing integer like in the ScheduleID column in the screenshot below. The Query Description would get stored in the same way as the Description column in the screenshot below (same data type, etc.). This means that the Query Description could be changed at anytime without changing the primary key on the query.

image

 

This would be created as a separate idea, but I'm mentioning it here to make sure that this idea for saving queries could accommodate this in the future. Would this approach allow us to add parameters? Maybe parameters could simply be defined in the SQL Command window using SQL Variable syntax, then passed to the query in the URL?

4 Replies
Ryan Brown @xByte Hosting
Posts: 84
 Ryan Brown @xByte Hosting
July 16, 2023 11:23 pm
(@ryanxbyte)
Estimable Member
Joined: 5 years ago

put the SQL Command in the URL so you can bookmark certain queries and send links to others

Reply
Jwright and Ryan Brown @xByte Hosting reacted
AugSQL Developer
Posts: 9
 AugSQL Developer
Admin
July 16, 2023 11:23 pm
(@augsql)
Active Member
Joined: 2 years ago

If the core value is to bookmark and share queries, would it be OK in your eyes to store the queries and recall them with an auto-generated ID (ie. kind of how URL-shorteners like Bitly or TinyUrl work)? Just thinking about limits to the length of a Query String (URL) that would limit the size of the query you could share if the whole thing was encoded there.

Reply
Tim Rodman
 Tim Rodman
Admin
(@timrodman)
Joined: 10 years ago

Famed Member
Posts: 3193
July 16, 2023 11:23 pm
Reply toAugSQL DeveloperAugSQL Developer

@timsql I was also thinking that there could be issues with the URL length for long queries.

 

You'd also probably lose spacing and indents which makes the code easier to read.

 

I like the idea of being able to store queries and recall them with an auto-generated ID. Passing parameters would be cool to. If I could recall a saved query like this:

https://mycompany.acumatica.com?ScreenId=QQ900001&QueryId=5

 

Then what if I could pass parameters to it like this:

https://mycompany.acumatica.com?ScreenId=QQ900001&QueryId=5&MyParam1=AA&MyParam2=BB

 

Then you could save the parameters in the text of the saved query and the query would use the parameters in the URL at run-time. The saved query could look like this:

SELECT *

INTO MyCustomTable

FROM Vendor

WHERE AcctCD LIKE 'MyParam1%' OR AcctCD LIKE 'MyParam2%'

Reply
AugSQL Developer
 AugSQL Developer
Admin
(@augsql)
Joined: 2 years ago

Active Member
Posts: 9
July 16, 2023 11:23 pm
Reply toAugSQL DeveloperAugSQL Developer

love it!

Reply
Tim Rodman reacted
Forum Jump:
  Previous Topic
Next Topic  
Forum Information
Recent Posts
Unread Posts
Tags
  • 12 Forums
  • 2,521 Topics
  • 10.9 K Posts
  • 11 Online
  • 2,321 Members
Our newest member: Courtney Wilder
Latest Post: Can UDFs be populated using an Import Scenario?
Forum Icons: Forum contains no unread posts Forum contains unread posts
Topic Icons: Not Replied Replied Active Hot Sticky Unapproved Solved Private Closed

Online Members

 No online members at the moment

Acumatica Forums

Terms of Use & Disclaimers :: Privacy Policy

Copyright © 2025 · AUG Forums, LLC. All rights reserved. This website is not owned, affiliated with, or endorsed by Acumatica, Inc.

‹›×

    ‹›×