Skip to main content
Known Participant
July 25, 2008
Question

Kind of query on an array

  • July 25, 2008
  • 4 replies
  • 569 views
Hi,

I have an array like this :

DATA | YEAR | SCENARIO | JAN | FEB | MAR | ....
data1 2008 1 120 101 109
data2 2008 2 120 105 104
data3 2007 1 100 108 111
data4 2008 1 124 101 116

and I want to search something like we do with a query but on an array

SELECT JAN
FROM myArray
WHERE
YEAR = 2008
AND SCENARIO = 1
AND DATA= data3

is it possible ? and how to do it ?

Thanks !
This topic has been closed for replies.

4 replies

Participating Frequently
July 29, 2008
Very useful site. I learned a lot from this site. Thanks.
For nice music visit http://musiktag.eu
Inspiring
July 26, 2008
What Adam said is correct, but not the only way to do it. If you are going to loop through the array anyhow, you could add some if/else code to get your answer.
Inspiring
July 25, 2008
> I have an array like this :

That looks like an array of structs rather than simply an array. Arrays
can have only numeric indices.

You could loop over whatever data structure it is and populate a query.
Then you could QoQ the query.

--
Adam
Inspiring
July 25, 2008
It's convoluted but possible. Where did the array come from in the first place?
aubwebAuthor
Known Participant
July 25, 2008
Here's a simple schema :

1. query from flex to coldfusion
2. cf return array to flex

3. from flex I send the array to cf in order to make some calcuations (that's where I need to "query" the array)
4. new array returned by cf to flex

the idea is that I make a query on the server A (sql server) that returns all the infos I need
then I send those infos to the server B (coldfusion) to avoid using server A ...

do you know what I mean ?