cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Submit your abstract to the call for content for Discovery Summit Americas by April 23. Selected abstracts will be presented at Discovery Summit, Oct. 21- 24.
Discovery is online this week, April 16 and 18. Join us for these exciting interactive sessions.
Choose Language Hide Translation Bar
Kwangki
Level III

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
);

1 ACCEPTED SOLUTION

Accepted Solutions

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

View solution in original post

2 REPLIES 2

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

ih
Super User (Alumni) ih
Super User (Alumni)

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();