0

I have a table. For example: CREATE TABLE temp AS SELECT * FROM range(20)

How i can create in sqlite a new database with one command with the table temp?

1
  • What RDMS are you using? Commented Sep 20, 2014 at 1:40

2 Answers 2

2

Since your in sqlite, in the command line just type:

 sqlite3 datbase_name.db

This will create a new database called database_name.db, now to create your table to this database just type:

 sqlite3 database_name.db "CREATE TABLE .......;"

Type your create table statement inside the quotes.

For more info, please take a look at their documentation.

Sign up to request clarification or add additional context in comments.

Comments

-1

I think that would depend on the DBMS but this may be what you're looking for.

COPY Command Syntax

"COPY {FROM database | TO database | FROM database TO database} {APPEND|CREATE|INSERT|REPLACE} destination_table [(column, column, column, ...)] USING query"

http://docs.oracle.com/cd/B19306_01/server.102/b14357/apb.htm

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.