Support 805.461.7300
Sales
Our Technology. Your Success.

Add Database name to a field in your database

To create a field in your database, you can use the command:

ALTER TABLE (ALIAS()) ADD COLUMN filename C(20)

Add Column filename C(20) describes the name of the field (filename) the type of field (C for Character) and the width of the field (20 characters).
Then to add the database name to that field, use this command:

REPLACE ALL filename WITH SUBSTR(DBF(),RAT("\",DBF())+1)

DBF() is the complete path of your database. This takes everything from the first character right after the right-most backslash, which is the name of the database without any of the path, and puts it in to a field name called filename for every record in the list.
When you combine the two commands, you have a command that adds a field name then fills the database name into that field:

ALTER TABLE (ALIAS()) ADD COLUMN filename C(20) REPLACE ALL filename WITH SUBSTR(DBF(),RAT("\",DBF())+1)

« Back to Commands

Your Mr. Vince Murdoch, who I was directed to contact, was very helpful in walking me through your software. Vince was very patient with me even though I am a very small customer in your scheme of things. You have a courteous and patient tech support professional in Mr Vince Murdoch. I needed his help even though I have been doing bulk mailing for 25 years.
K.V., , Pittsburgh, PA