[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2407
  • Last Modified:

Pass parameters to/between SQL scripts with Firebird ISQL

How can I pass parameters to/between SQL scripts with Firebird  (v1.5) ISQL?

For example, I have a generic script to create a new database, with all the objects and standing data I requrie. but I want to be able to pass in paramers such as DB File Name, User, Password etc.
0
Stephen Lappin
Asked:
Stephen Lappin
  • 2
  • 2
1 Solution
 
NickUpsonCommented:
assuming unix platform this is easy.

myscript.sh contains

isql ....... << !!

update mytable set last_update = 'now', last_done_by = '$1';

!!

and is called as

myscript.sh fred

if your name is fred
0
 
Stephen LappinSenior TechnologistAuthor Commented:
I am on a Windows platform.

The example you provide is not passing parameters, but generating a script with the appropriate values included. Is it not possible to pass parameters in Firebird ISQL?
0
 
NickUpsonCommented:
in that case I'm not sure what you mean, the isql command-line tool takes parameters (dbpath, username, etc).

isql localhost:c:/db/mydb -user myname ........

it also has a -i option to get it's instructions (create, etc) from a named file
0
 
Stephen LappinSenior TechnologistAuthor Commented:
The answer is that ISQL does not offer a facility to pass parameters, but the methos described by NickUpson is a workable workaround.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now