I have a script that I run in Oracle SQL*Plus. It updates a flag to 'T' if the customer's account number is like "one of these hard-coded numbers". Each customer account is 6-digits plus other digits that designate regional locations, etc. So my script looks like this:
... except that there are over 100 accounts and that number will grow. Rather than updating the script each time a new account needs to be added, can I change the script to something like this:
...where VarAcctNo is a variable stored in a .txt file or some config file? That way, I could update the config file as needed and never touch the script.
I'm thinking there must be a way to do this, but I'm not very familiar with Oracle programming.
dstinsman
Code:
UPDATE tbl
SET FLAG = 'T'
WHERE
ACCTNO like '002476%'
OR ACCTNO like '003748%'
OR ACCTNO like '054379%'
... except that there are over 100 accounts and that number will grow. Rather than updating the script each time a new account needs to be added, can I change the script to something like this:
Code:
UPDATE tbl
SET FLAG = 'T'
WHERE
ACCTNO like 'VarAcctNo'
...where VarAcctNo is a variable stored in a .txt file or some config file? That way, I could update the config file as needed and never touch the script.
I'm thinking there must be a way to do this, but I'm not very familiar with Oracle programming.
dstinsman