It doesn't sound like a big deal. Create Database Profile (Tools/Database Profiles menu) using ODBC as a DBMS In the job script you will do something like the following: Dim( rows, number ) Dim( row, number ) // connect to db DatabaseConnect( "[profile name here]" ) // retrieve result set DatabaseRetrieve( "[your sql here]", rows ) // go row by row, assuming that there is just one column in the output Dim( full_practice_name, string ) ForNext( row, 1, rows, 1, NEXT ) // get the value for full_practice_name DatabaseGet(row, 1, full_practice_name ) // build a new file using that variable // .. put build logic here ... NEXT: // ... rename original file ... // disconnect from db DatabaseDisconnect( ) the fragment above assumes you retrieve many rows for evry file. If you don't, remove ForNext loop and just do DatabaseGet(1, 1, full_practice_name ) If you are going to process many files in one script put DatabaseConnect and DatabaseDisconnect as the first and last line of the script. Do DatabaseRetrieve as many times as many files you process. : Hullo again : I need to issue a SQL select statement and have the answerset returned in the : form of JAL variables. : We have a script that must rename input files based on a moderately sized : MSAccess/Jet/SQL7 table. The sctipt must positionally isolate a 6-digit : site-id field within the file name (done), build a SQL select statement : using that value (done), query the database (uh-oh), read the : full_practice_name value returned (yikes), build a new file using that : variable (whew), and rename the file accordingly (done). There are any : combination of 300 site-ids to test for. : I can write a simple VC++ program to do this, dumping the necessary data into : a temp file, and then reading that file in using JAL, but that seems sort : of barbaric. : Any ideas? Thanks in advance. : - Rick
|