UPDATE table from command line

Forum for DBF Commander discussing.

UPDATE table from command line

Postby skydiver » Mon Mar 04, 2013 10:57 pm

I am testing the evaluation version of the dbfcommander tool. I need to be able to script an update of a specific field in a database table by using the -q command line switch but this does not seem to work. I am getting an error that is an error opening d:\-q.
Is this an error due to the evaluation version?
skydiver
 
Posts: 5
Joined: Mon Mar 04, 2013 9:56 pm

Re: UPDATE table from command line

Postby skydiver » Tue Mar 05, 2013 1:30 am

Any suggestions?
skydiver
 
Posts: 5
Joined: Mon Mar 04, 2013 9:56 pm

Re: UPDATE table from command line

Postby Admin » Tue Mar 05, 2013 10:16 am

Hi,
thanks for your question!

No, the UPDATE statement should work. It looks like there is some syntax error(s) in your command line. Here is a sample command line for your case:

Code: Select all
dbfcommander.exe -q "UPDATE 'D:\Data\employee.dbf' SET emp_id='' WHERE ALLTRIM(emp_id)='6'"


More info on using command line you can find here: http://dbf-software.com/dbf-command-line.html

If you cannot find the error, please provide your command line (or SQL query) you want to execute.
Best regards,
Oleg Zhechkov
User avatar
Admin
Site Admin
 
Posts: 124
Joined: Wed Apr 21, 2010 7:27 pm

Re: UPDATE table from command line

Postby skydiver » Tue Mar 05, 2013 10:16 pm

So I have a file job.dbf with columns ID | usernumber | longname | noprint
I can run the following SQL command from inside of dbfcommander in the SQL panel:
update D:\data\20100609\job.dbf set noprint='N' where ID=17

ID is type Numeric
norpint is type Char

I try to run this command from command line (dbfcommander is in the system path):
dbfcommander.exe -q "update 'D:\data\20100609\job.dbf' set noprint='N' where ID=18"
I get this error: Cannot open file "D:\data\20100609\-q". The system cannot find the file specified.
Click ok though the error and dbfcommander gui opens without any file loaded

I try to run this command from command line:
dbfcommander.exe -q "update 'D:\data\20100609\job.dbf' set noprint='N' where ID='18'"
Exactly the same error occurs
skydiver
 
Posts: 5
Joined: Mon Mar 04, 2013 9:56 pm

Re: UPDATE table from command line

Postby Admin » Wed Mar 06, 2013 8:42 am

I just did EXACTLY what you're doing, and there were no any errors.

What version of DBF Commander Pro do you use? Please make sure your version is the latest - 2.8.41.
How do you run your command? Typing in command-line mode or using BAT file? If it's a BAT file and it contains other commands besides of this UPDATE SQL query, maybe some other command invokes this error?
Best regards,
Oleg Zhechkov
User avatar
Admin
Site Admin
 
Posts: 124
Joined: Wed Apr 21, 2010 7:27 pm

Re: UPDATE table from command line

Postby skydiver » Thu Mar 07, 2013 5:15 am

I am currently running dbfcommander (not pro yet) 1.1 build 25 as I entioned in the first post. I need to test this on my lab before we use this to update the files on the server.

I have tried from a command line session and also via a CMD batch file. I have also tried on both WIndows 7 32 bit and x64 with the same issue.
skydiver
 
Posts: 5
Joined: Mon Mar 04, 2013 9:56 pm

Re: UPDATE table from command line

Postby skydiver » Thu Mar 07, 2013 5:23 am

Does the evaluation version of the pro version require internet access when you purchase the license? The server we need to run this on is a whitelist only network and doesn't have any external internet access.
skydiver
 
Posts: 5
Joined: Mon Mar 04, 2013 9:56 pm

Re: UPDATE table from command line

Postby Admin » Thu Mar 07, 2013 8:12 am

DBF Commander Free (version 1.1.25) does not supports command line mode at all. Please use Pro version. It has 20-days trial period and is fully-functional.

>>Does the evaluation version of the pro version require internet access when you purchase the license?
No, DBF Commander Pro doesn't need Internet connection neither before purhase nor after.
Best regards,
Oleg Zhechkov
User avatar
Admin
Site Admin
 
Posts: 124
Joined: Wed Apr 21, 2010 7:27 pm


Return to DBF Commander Professional

Who is online

Users browsing this forum: No registered users and 7 guests

cron