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

Post any Bulk Rename Utility support requirements here. Open to all registered users.

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

Postby alez_G » Wed Dec 02, 2020 8:42 pm

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!
alez_G
 
Posts: 2
Joined: Wed Dec 02, 2020 8:33 pm

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

Postby Admin » Wed Dec 02, 2020 10:53 pm

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
Admin
Site Admin
 
Posts: 2344
Joined: Tue Mar 08, 2005 8:39 pm

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

Postby alez_G » Thu Dec 03, 2020 12:09 am

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.
alez_G
 
Posts: 2
Joined: Wed Dec 02, 2020 8:33 pm


Return to BRU Support