Our World Statistics Day conversations have been a great reminder of how much statistics can inform our lives. Do you have an example of how statistics has made a difference in your life? Share your story with the Community!
Choose Language Hide Translation Bar
Highlighted
dilipkumar
Level II

How to pass variables and store the results into SQL database

Hi All,

I have written a jsl code  where i am passing a input  and as a output i am storing the data into JSL table or XL sheet.  i have a requirement where for the same code i have to pass multiple input  and i need to store the output in SQL table  for the each of the given input.

 

Please refer the below example:

DA=Function({model},

//Create Database Connection


dbc = Create Database Connection("XXXX");

dataTable = New Table( "AAA");

ddt = Data Table( 1 );    
      
//Execute SQL statements using this connection 
      
sqlQuery = "Execute [Proc] @Model = '" || model || "'";
      
Write( sqlQuery );
       BBBBBBBCCCCCCCC

//When finished, close connection.
Close Database Connection( dbc );

...................................
...................................
...................................

Close All( Data Tables );

Quit();

);
a=DA("ZZZZ");

Output for above is  M=8

Now instead of feeding onevalue at a time , i want to feed several values at a time and want to sore the the value in SQL table.

 

desired output stored in SQL table

 

M=8

N=10

L=7 etc...

 

If anyone is ware please let me know the process.

 

Regards

Dilip

 

 

 

 

 

Article Labels

    There are no labels assigned to this post.