I ran a query and needed to save the results to an Excel spreadsheet. Since I knew I was going to have to do this multiple times I thought I'd test out the AquaScript functionality, something I've never done despite having used the product for more than a decade.
From the Save Results screen I clicked on the AquaScript to review it, then click the Generate AquaScript button. (See attached) After generating the script and then opening it, I click Run and it immediately fails with the error (See attached):
Error on line 2: Wrapped com.aquafold.openapi.AQException: Connection not found: Prod (#2)
Since this is auto-generated code I assume it's correct code but there's a bug in the function, but I don't really know. I tried multiple server connections and tried different ways of specifying the database connection name figuring it might be something silly - like maybe it needed to be "Local Database Servers/Prod". Anyway, spent way too much time trying to find documentation on exactly how the server name needed to be specified without any luck. Whatever the problem is, the fact that the product-generated code immediately fails is a bit unfortunate.
Note, a language reference for AquaScript would be really handy. I looked all over trying to figure out not only this connection issue but also what's the syntax for a loop or error handling and other language syntax. I found API documentation but no language reference.
71 KB
72 KB
367 KB
125 KB
156 KB
Hi Tim,
This can get a bit confusing. AquaScript likes to work under a project. So when you generate AquaScript, ADS asks you for an associated project. When a project is built, it contains three folders AquaScripts, Servers and User Files. The generated AquaScript will be placed in the AquaScript folder. It is expected that the Server folder contain the connection file for the database in your AquaScript. All you need to do is drag it from the Server tree to the Projects->Name->Servers folder in the Projects tree. It should work for you after that. Please give that a try.
Thanks,
Tom
Hi Tim,
We only have java type docs https://docs.aquafold.com/ads/22.1/openapi/. Unfortunately, there is no language reference. You can build a couple projects using templates already created in ADS. Right click on projects, click on new and select a project. The underlying AquaScript will give you a lot of examples of how to use the api. Additionally, on our downloads page, you can download examples. We can also help if there is something specific that you don't find in the examples.
Thanks,
Tom
Hi Tim,
We only have java type docs https://docs.aquafold.com/ads/22.1/openapi/. Unfortunately, there is no language reference. You can build a couple projects using templates already created in ADS. Right click on projects, click on new and select a project. The underlying AquaScript will give you a lot of examples of how to use the api. Additionally, on our downloads page, you can download examples. We can also help if there is something specific that you don't find in the examples.
Thanks,
Tom
Hi Tom,
Thank you for the information about how AquaScript programs reference the Servers. I didn't see a Servers folder under the Projects folder when it was initially created. I'm not sure if the screen simply didn't refresh to show it, or if it got created when I saved my 2nd script. In any event it would certainly have been helpful if in the act of auto-creating and saving a script with a database reference with it, if doing so also copied the database reference to the Server's folder it created so the generated script would actually run. Alternatively it would be helpful if a server reference didn't exist in the project's server folder if it simply looked in the global Servers list.
Re: having no language reference for AquaScript what language does it follow for syntax? I thought perhaps JavaScript given the scripts are .xJS but that doesn't quite seem right as certain constructs aren't recognized. I'm surprised that's simply not clearly stated right where AquaScript is introduced in the documentation, especially given there's no language reference. The examples certainly help though... thank you!.
Hi Tom,
Thank you for the information about how AquaScript programs reference the Servers. I didn't see a Servers folder under the Projects folder when it was initially created. I'm not sure if the screen simply didn't refresh to show it, or if it got created when I saved my 2nd script. In any event it would certainly have been helpful if in the act of auto-creating and saving a script with a database reference with it, if doing so also copied the database reference to the Server's folder it created so the generated script would actually run. Alternatively it would be helpful if a server reference didn't exist in the project's server folder if it simply looked in the global Servers list.
Re: having no language reference for AquaScript what language does it follow for syntax? I thought perhaps JavaScript given the scripts are .xJS but that doesn't quite seem right as certain constructs aren't recognized. I'm surprised that's simply not clearly stated right where AquaScript is introduced in the documentation, especially given there's no language reference. The examples certainly help though... thank you!.
Issue #15881 |
New |
Completion |
No due date |
No fixed build |
No time estimate |
Hi Tim,
This can get a bit confusing. AquaScript likes to work under a project. So when you generate AquaScript, ADS asks you for an associated project. When a project is built, it contains three folders AquaScripts, Servers and User Files. The generated AquaScript will be placed in the AquaScript folder. It is expected that the Server folder contain the connection file for the database in your AquaScript. All you need to do is drag it from the Server tree to the Projects->Name->Servers folder in the Projects tree. It should work for you after that. Please give that a try.
Thanks,
Tom