Page 1 of 1

Possible to return a file name based on a SQL query?

PostPosted: Wed Dec 02, 2020 8:42 pm
by alez_G
Hello all.

Trying to solve a bit of an issue. Getting ready to update some software that creates PDF documents. In the past we had a file name of "INV_CUSTCO_#PrintDate#_#InvoiceNumber#" (break down below) but due to some aging software and compatibility issues, our new process will only create a file name of "#InvoiceNumber#".

Is there a method I could take that file name "#InvoiceNumber#" and run a sql query to pull in the the CUSTCO field? Not even sure if this is possible.

"INV_CUSTCO_#PrintDate#_#InvoiceNumber#"
-INV - static field
-CUSTCO - customer code - pull from a sql database
-#PrintDate# - date printed - can be a pulled from the file
- invoice number - primary key in a sql database

APPRECIATE ANY HELP!

Re: Possible to return a file name based on a SQL query?

PostPosted: Wed Dec 02, 2020 10:53 pm
by Admin
Hi, if you can run the SQL query by command line, how is the result of the query returned?
If you could create a CSV file with
invoice#,Customer#
then you could import that into BRU for renaming.
Is the PrintDate equal to the file modified date?

Or you could create a Powershell Script for this routine instead of using BRU

thanks

Re: Possible to return a file name based on a SQL query?

PostPosted: Thu Dec 03, 2020 12:09 am
by alez_G
I haven't really started putting the pieces together yet just trying to look route.

Appreciate the advice. Powershell would probably be the route to go in this case.