How to use SQLite db file location in select?How to list the tables in a SQLite database file that was opened with ATTACH?SQLite - UPSERT *not* INSERT or REPLACESqlite primary key on multiple columnsHow do I check in SQLite whether a table exists?Improve INSERT-per-second performance of SQLite?What are the best practices for SQLite on Android?Is there an SQLite equivalent to MySQL's DESCRIBE [table]?Select first row in each GROUP BY group?How to delete or add column in SQLITE?How to tell SQLITE to ignore STDIN?
How invisible hand adjusts stock prices if company is listed on multiple exchanges, under multiple currencies, and one of the currencies plunges?
What is the difference between a translation and a Galilean transformation?
Friend is very nitpicky about side comments I don't intend to be taken too seriously
Why is the the worst case for this function O(n*n)
Distinguishing between octahedral and tetrahedral holes
Capacitors with same voltage, same capacitance, same temp, different diameter?
Why does low tire pressure decrease fuel economy?
How to set any file manager in Linux to show the duration like the Length feature in Windows Explorer?
How do Scrum teams manage their dependencies on other teams?
Are programming languages necessary/useful for operations research practitioner?
Distance faces never sharp/clear. Too picky?
How can Schrödinger's cat be both dead and alive?
Text is continuing wider than the width of the page and not passing to new line
I multiply the source, you (probably) multiply the output!
How there are 3 possible tautomers of 2,2,4-trimethylheptane-3,5-dione?
When calculating averages, why can we treat exploding die as if they're independent?
Remove outer padding in tikzcd
Do you need to burn fuel between gravity assists?
I need to know information from an old German birth certificate
Why would an AC motor heavily shake when driven with certain frequencies?
Is a MySQL database a viable alternative to LDAP?
Can you mark a new target with the Hunter's Mark spell if the original target shifts to a different plane?
Why can linguists decide which use of language is correct and which is not?
How can I finish my PhD?
How to use SQLite db file location in select?
How to list the tables in a SQLite database file that was opened with ATTACH?SQLite - UPSERT *not* INSERT or REPLACESqlite primary key on multiple columnsHow do I check in SQLite whether a table exists?Improve INSERT-per-second performance of SQLite?What are the best practices for SQLite on Android?Is there an SQLite equivalent to MySQL's DESCRIBE [table]?Select first row in each GROUP BY group?How to delete or add column in SQLITE?How to tell SQLITE to ignore STDIN?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I would like to use the main database file location in function (replace or other) as input data. How can i get it?
for example: replace('c:tempmain.db','main.db','')
I'm creating a database script for command line use under win10.
.database
command result seems to be fine, but how to use in replace input?
EDIT: I have to use the location as variable, because i run the script from command line, recursively in a lot of directories with a lot of small databases, so i can't use constant value in replace.
The cmd line command:
forfiles /p c:temp /m files.db /s /c "cmd /c c:sqlite3.exe @path < c:BookDbDataCopy.txt"
I want to use the path in the select as variable.
sqlite
add a comment |
I would like to use the main database file location in function (replace or other) as input data. How can i get it?
for example: replace('c:tempmain.db','main.db','')
I'm creating a database script for command line use under win10.
.database
command result seems to be fine, but how to use in replace input?
EDIT: I have to use the location as variable, because i run the script from command line, recursively in a lot of directories with a lot of small databases, so i can't use constant value in replace.
The cmd line command:
forfiles /p c:temp /m files.db /s /c "cmd /c c:sqlite3.exe @path < c:BookDbDataCopy.txt"
I want to use the path in the select as variable.
sqlite
1
Since your script will have opened the SQLite database, it already knows where it is located. It doesn't have to ask the database.
– Schwern
Mar 28 at 7:40
Sorry, my question was inaccurate, i updated that.
– AndrasK
Mar 28 at 8:58
add a comment |
I would like to use the main database file location in function (replace or other) as input data. How can i get it?
for example: replace('c:tempmain.db','main.db','')
I'm creating a database script for command line use under win10.
.database
command result seems to be fine, but how to use in replace input?
EDIT: I have to use the location as variable, because i run the script from command line, recursively in a lot of directories with a lot of small databases, so i can't use constant value in replace.
The cmd line command:
forfiles /p c:temp /m files.db /s /c "cmd /c c:sqlite3.exe @path < c:BookDbDataCopy.txt"
I want to use the path in the select as variable.
sqlite
I would like to use the main database file location in function (replace or other) as input data. How can i get it?
for example: replace('c:tempmain.db','main.db','')
I'm creating a database script for command line use under win10.
.database
command result seems to be fine, but how to use in replace input?
EDIT: I have to use the location as variable, because i run the script from command line, recursively in a lot of directories with a lot of small databases, so i can't use constant value in replace.
The cmd line command:
forfiles /p c:temp /m files.db /s /c "cmd /c c:sqlite3.exe @path < c:BookDbDataCopy.txt"
I want to use the path in the select as variable.
sqlite
sqlite
edited Mar 28 at 8:57
AndrasK
asked Mar 28 at 7:19
AndrasKAndrasK
12 bronze badges
12 bronze badges
1
Since your script will have opened the SQLite database, it already knows where it is located. It doesn't have to ask the database.
– Schwern
Mar 28 at 7:40
Sorry, my question was inaccurate, i updated that.
– AndrasK
Mar 28 at 8:58
add a comment |
1
Since your script will have opened the SQLite database, it already knows where it is located. It doesn't have to ask the database.
– Schwern
Mar 28 at 7:40
Sorry, my question was inaccurate, i updated that.
– AndrasK
Mar 28 at 8:58
1
1
Since your script will have opened the SQLite database, it already knows where it is located. It doesn't have to ask the database.
– Schwern
Mar 28 at 7:40
Since your script will have opened the SQLite database, it already knows where it is located. It doesn't have to ask the database.
– Schwern
Mar 28 at 7:40
Sorry, my question was inaccurate, i updated that.
– AndrasK
Mar 28 at 8:58
Sorry, my question was inaccurate, i updated that.
– AndrasK
Mar 28 at 8:58
add a comment |
1 Answer
1
active
oldest
votes
I got it :)
create table path (a text);
.mode csv
.output 'c:data.csv'
.databases
.import 'c:data.csv' path
The solution:
- create a table for the path
- write the command output in file
- import the file in table
- select the table in replace variable :)
select replace((select a from path where a like 'main%'),'main: c:',''), t.* from path;
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55392073%2fhow-to-use-sqlite-db-file-location-in-select%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
I got it :)
create table path (a text);
.mode csv
.output 'c:data.csv'
.databases
.import 'c:data.csv' path
The solution:
- create a table for the path
- write the command output in file
- import the file in table
- select the table in replace variable :)
select replace((select a from path where a like 'main%'),'main: c:',''), t.* from path;
add a comment |
I got it :)
create table path (a text);
.mode csv
.output 'c:data.csv'
.databases
.import 'c:data.csv' path
The solution:
- create a table for the path
- write the command output in file
- import the file in table
- select the table in replace variable :)
select replace((select a from path where a like 'main%'),'main: c:',''), t.* from path;
add a comment |
I got it :)
create table path (a text);
.mode csv
.output 'c:data.csv'
.databases
.import 'c:data.csv' path
The solution:
- create a table for the path
- write the command output in file
- import the file in table
- select the table in replace variable :)
select replace((select a from path where a like 'main%'),'main: c:',''), t.* from path;
I got it :)
create table path (a text);
.mode csv
.output 'c:data.csv'
.databases
.import 'c:data.csv' path
The solution:
- create a table for the path
- write the command output in file
- import the file in table
- select the table in replace variable :)
select replace((select a from path where a like 'main%'),'main: c:',''), t.* from path;
answered Mar 28 at 11:22
AndrasKAndrasK
12 bronze badges
12 bronze badges
add a comment |
add a comment |
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55392073%2fhow-to-use-sqlite-db-file-location-in-select%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Since your script will have opened the SQLite database, it already knows where it is located. It doesn't have to ask the database.
– Schwern
Mar 28 at 7:40
Sorry, my question was inaccurate, i updated that.
– AndrasK
Mar 28 at 8:58