- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
How to import data in SQLite In-Memory Databases?
I want to import data in SQLite In-Memory Databases with JSL command. Until now, I did not find how to import it within JSL environment.
I can find how to connect In-Memory Databases generated by Python programming. But I did not find to import data within JMP.
Though I know the reason is that it is imported from other instance(process) not from same process, I'd like to know whether there is the solution or not. The JSL open Database script is as follows.
Open Database(
"DSN=SQLite3 ODBC;DATABASE=file::memory:?cache=shared",
query,
JMP_name
);
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to import data in SQLite In-Memory Databases?
There is no way to import a SQLite database that is already resident in memory. JMP 14 did add the ability to import from a SQLite database that is resident on a client file system. An example of this is:
New SQL Query(
Connection( "SQLite:Database=/C:/Testdata/ODBC/SQLite/test.db" ),
QueryName( "bigclass" ),
Select,
From( Table( "bigclass", Alias( "t1" ) ) )
) << Run
Brian Corcoran
JMP Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to import data in SQLite In-Memory Databases?
There is no way to import a SQLite database that is already resident in memory. JMP 14 did add the ability to import from a SQLite database that is resident on a client file system. An example of this is:
New SQL Query(
Connection( "SQLite:Database=/C:/Testdata/ODBC/SQLite/test.db" ),
QueryName( "bigclass" ),
Select,
From( Table( "bigclass", Alias( "t1" ) ) )
) << Run
Brian Corcoran
JMP Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to import data in SQLite In-Memory Databases?
If you can write python code to query the in-memory database then you can call that code using JSL and then pass the values back to JMP. Check out the Python Integration Functions; here is an example from that link:
Python Init();
x = [1 2 3];
Python Send( x );
y = [4 5 6];
Python Send( y );
Python Submit( "\[
#replace this code with whatever you need to connect to the database
import numpy as np
p = np.multiply(x, y) # matrix product
]\" );
p = Python Get( p );
Show( p );
Python Term();