Accessing any dataset from a scripted datasource [message #884987] |
Tue, 12 June 2012 04:22  |
Eclipse User |
|
|
|
I have two datasets. One JDBC and a scripted one.
From the scripted dataset I what to access the jdbc dataset. Do some changes (query string). Then execute it. At the end I will use result value in my scripted dataset.
All this should be done different times in a for loop.
But how can I access the dataset?
Help will be appreciated.
|
|
|
|
|
|
|
|
Re: Accessing any dataset from a scripted datasource [message #886831 is a reply to message #886547] |
Fri, 15 June 2012 13:48   |
Eclipse User |
|
|
|
Thanks for the update.
Jason
On 6/15/2012 2:44 AM, Juergen Leeb wrote:
> Hi Jason,
>
> thanks für your answer. Is example was exactly what I' am looking for :) .
> Thanks a lot for that.
>
>
> Here is the background for my question:
> We have 3 production lines. Each of them monitors its consumption of
> natural gas. Therefore a table in a data base exists. With every major
> change the new consumption value is added to the old one. This new value
> is written in the table (also the timestamp and the variable's name).
> This means the values grow and grow. Compare with a water meter. To get
> the consumption in a period of time, let say from 06/04/12 12:00 am till
> 06/10/12 12:00 am, I have to query two values from the database. The one
> entry direct before 06/04/12 12:00 and the one entry direct before
> 06/10/12 12:00. The value I what to know is difference between the two
> values. This can only be done by java script.
>
> In our production are 3 Shifts. I have to generate a report which shows
> for every day and shift the value of consumption for every production line.
>
> To get out the values of the data base I use an ordenary jdbc data set.
> Parameter are the name of the variable, timestamp from and timestamp
> till. As a middle step I have scripted data set. The table looks like that:
> Variable Name, Production day, Shift, value;
> With a crosstable I' ll do the presenation.
>
> But within the script code (open event scripted ds) I have to execute
> the jdbc ds multiple times. For every day, shift and variable.
>
>
> With your example I will have the change to generate the report.
>
> Once again. Thank you!
>
>
> regards Juergen
|
|
|
|
|
|
|
|
|
|
Re: Accessing any dataset from a scripted datasource [message #897630 is a reply to message #897533] |
Tue, 24 July 2012 16:06  |
Eclipse User |
|
|
|
Are you positive you have the column name correct? You can examine the
result set meta data using:
var rsmd = ri.getResultMetaData();
ie var cc = ri.getResultMetaData().getColumnCount();
ie ri.getValue(rsmd.getColumnName(1)).toString();
Jason
On 7/24/2012 8:35 AM, Juergen Leeb wrote:
> I Think this isn' t necessary anymore. I got this part runing. Now I
> create the whole query string in the script. But one next question is
> how to get values from the query?
>
> With ri.getValue("VALUE_SYMBOL") I got the error message "VALUE_SYMBOL"
> is not defined. Even though the binding is done and the row also exists.
|
|
|
Powered by
FUDForum. Page generated in 0.05690 seconds