Pages: [1]
Author Topic: Reading DB in the middle of a process to get a new attribute  (Read 898 times)
Posts: 17

« on: May 18, 2011, 12:37:58 PM »

Hey together,

i would like to call the DB in the middle of a process to get new informations out of a DB-table. Therefor i would like to send a SQL-query through which i can send an attribute of my example set as a parameter.

Let a example set  look like this:

ROLE          NAME       TYPE
attribute      id              integer
attribute      number     real

Example of a sql Statement i would like to execute:
          Select c from TABLE where ? BETWEEN 'a' AND 'b';

I would like the Parameter ? be the number of the example set and i would like to store the result in my example set afterward.

Is this possible because i canīt find any Operator. As far as i understand the Execute SQL operator cannot load data from the DB but this is what i need

Greetings and thanks for your help in advance
Full Member
Posts: 245

« Reply #1 on: May 18, 2011, 01:19:29 PM »

Hi adaman,

if you use the "Extract Macro" operator on the number attribute value, you can use this macro in your query like "... WHERE %{number} BETWEEN...". But in my opinion this query doesn't make much sense, WHERE should be followed by a column name, not by a number.

If you want to use the response from this query, I would suggest the "Read Database" operator. You will receive a new example set fulfilling the SQL query. If you want to store the result in your example set you have to look for a proper way to combine both sets. Since your intention isn't clear to me, I cannot make any suggestions on this one. You will probably receive multiple lines (since you are using the BETWEEN operator, although your query will certainly result in zero lines) and you can't simply add them to a single example in your existing example set. Perhaps you can give a bit more details on your problem to make things clearer (at least to me).

Pages: [1]
Jump to: