Re: [sqlite] Attach to file in same directory

2011-02-03 Thread BareFeetWare
On 2/2/2011 8:03 PM, BareFeetWare wrote: I use the attach command to attach another SQLite database file that resides in the same directory as my main file. I tried: attach 'Import.sqlitedb'; But it fails to find the file. If I specify the full path: attach

Re: [sqlite] Attach to file in same directory

2011-02-03 Thread BareFeetWare
On 3 Feb 2011, at 1:03am, BareFeetWare wrote: How can I attach to a local file in the same directory, without specifying the full absolute path? On 03/02/2011, at 12:17 PM, Simon Slavin wrote: No easy way. Argh. That's kind of mental, that SQLite, a file based database system, can't

Re: [sqlite] Attach to file in same directory

2011-02-03 Thread Pavel Ivanov
Instead use operating system commands to retrieve the full path to the first file, then construct a full path to the second file. But if a I have an arbitrary SQL script/procedure to perform, that starts with an attach statement, I don't have creation control over the path specified in

Re: [sqlite] Attach to file in same directory

2011-02-03 Thread BareFeetWare
On 04/02/2011, at 2:08 AM, Pavel Ivanov wrote: What's wrong with the following suggestion to you? Just start sqlite3 in such a way that the directory where your database files reside is the current one. Because I am not using sqlite3, ie the command line utility. You can read it as:

Re: [sqlite] Attach to file in same directory

2011-02-03 Thread Simon Slavin
On 3 Feb 2011, at 2:59pm, BareFeetWare wrote: But if a I have an arbitrary SQL script/procedure to perform, that starts with an attach statement, I don't have creation control over the path specified in the script. If you were able to open the original database without specifying a path,

Re: [sqlite] Attach to file in same directory

2011-02-03 Thread Luuk
On 03-02-11 16:18, BareFeetWare wrote: What SQLite or C library call could I put before that to set the current directory, that the sqlite3_prepare_v2 function would observe when processing the attach statement? i'm not a C-programmer but:

Re: [sqlite] Attach to file in same directory

2011-02-03 Thread BareFeetWare
On 3 Feb 2011, at 2:59pm, BareFeetWare wrote: But if a I have an arbitrary SQL script/procedure to perform, that starts with an attach statement, I don't have creation control over the path specified in the script. On 04/02/2011, at 2:18 AM, Simon Slavin wrote: If you were able to

Re: [sqlite] Attach to file in same directory

2011-02-03 Thread BareFeetWare
On 03-02-11 16:18, BareFeetWare wrote: What SQLite or C library call could I put before that to set the current directory, that the sqlite3_prepare_v2 function would observe when processing the attach statement? On 04/02/2011, at 2:25 AM, Luuk wrote: i'm not a C-programmer Me either,

Re: [sqlite] Attach to file in same directory

2011-02-03 Thread Igor Tandetnik
On 2/3/2011 9:48 AM, BareFeetWare wrote: I could be using any SQLite utility, whether the command line, SQLite Manager, Froq etc. I happen to be using my own app, developed for the iPad/iPhone. In any of these environments, I open my main SQLite data file then want to run an SQL

[sqlite] Attach to file in same directory

2011-02-02 Thread BareFeetWare
Hi All, I use the attach command to attach another SQLite database file that resides in the same directory as my main file. I tried: attach 'Import.sqlitedb'; But it fails to find the file. If I specify the full path: attach '/Users/tom/Documents/Work/Databases/Import.sqlitedb'; Then it

Re: [sqlite] Attach to file in same directory

2011-02-02 Thread Igor Tandetnik
On 2/2/2011 8:03 PM, BareFeetWare wrote: I use the attach command to attach another SQLite database file that resides in the same directory as my main file. I tried: attach 'Import.sqlitedb'; But it fails to find the file. If I specify the full path: attach

Re: [sqlite] Attach to file in same directory

2011-02-02 Thread Simon Slavin
On 3 Feb 2011, at 1:03am, BareFeetWare wrote: How can I attach to a local file in the same directory, without specifying the full absolute path? No easy way. Instead use operating system commands to retrieve the full path to the first file, then construct a full path to the second file.