SQL Scripts with Variables?

Forum for DBF Commander discussing.

SQL Scripts with Variables?

Postby danlapp » Tue Nov 19, 2019 1:18 am

I've been using DBF Commander with multi-line single commands, by highlighting the code and clicking Execute.

Is there a way to create a script with multiple commands, including the use of variables?

For example:

set ItemStart = "ABC"
set ItemEnd = "RST"
select * from "C:\filename"
where ItemNumber > ItemStart and ItemNumber < ItemEnd
order by itemNumber

Thanks!
danlapp
 
Posts: 5
Joined: Fri Nov 08, 2019 10:17 am

Re: SQL Scripts with Variables?

Postby Admin » Tue Nov 19, 2019 8:20 am

Hello,
unfortunately, there is no way to use variables in your SQL text, since variable definition is not an SQL statement.
But you can use a script file with multiple commands. Write your SQL in a text file, then open it by clicking Open button at the SQL Panel toolbar. Then, click Execute (F5) to run the whole script.
You can also use the script in batch mode. More info is available here:
http://dbf-software.com/sql-dbf.html
http://dbf-software.com/dbf-command-line.html
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