cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
Neo
Neo
Level VI

How to concatenate data tables pulled from database within a loop?

The following JSL script snippet pulls test data from database for tested part IDs given in myList using my function opnDtb. This works as expected and the data tables are pulled individually. I would like each new data table pulled to be concatenated (vertically below) to the previous data table. How to implement this in JSL?

For( i = 1, i <= N Items (myList), i++,
	dt = opnDtb(myList [i]);
);

Note that all parts listed in myList do not always have test data available (i.e. awaiting test) so I would also need to neglect the cases where JMP throws a warning for no data pulled from database.

[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name 'XXXX'
When it's too good to be true, it's neither
1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: How to concatenate data tables pulled from database within a loop?

For concatenating data tables use Concatenate() with "Append to first table"

jthi_0-1685979080156.png

Either perform first data query outside the loop and define that as "main" table or use condition inside the loop to define the main table

If(i == 1, dt = ..);

To capture those ODBC messages you have few options: check for LogCapture() the query and use if statement to check for eeror messages or check for empty() data table.

-Jarmo

View solution in original post

1 REPLY 1
jthi
Super User

Re: How to concatenate data tables pulled from database within a loop?

For concatenating data tables use Concatenate() with "Append to first table"

jthi_0-1685979080156.png

Either perform first data query outside the loop and define that as "main" table or use condition inside the loop to define the main table

If(i == 1, dt = ..);

To capture those ODBC messages you have few options: check for LogCapture() the query and use if statement to check for eeror messages or check for empty() data table.

-Jarmo