• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Kind of query on an array

Explorer ,
Jul 25, 2008 Jul 25, 2008

Copy link to clipboard

Copied

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 !
TOPICS
Advanced techniques

Views

500

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 25, 2008 Jul 25, 2008

Copy link to clipboard

Copied

It's convoluted but possible. Where did the array come from in the first place?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 25, 2008 Jul 25, 2008

Copy link to clipboard

Copied

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 ?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 25, 2008 Jul 25, 2008

Copy link to clipboard

Copied

> 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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 25, 2008 Jul 25, 2008

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 29, 2008 Jul 29, 2008

Copy link to clipboard

Copied

LATEST
Very useful site. I learned a lot from this site. Thanks.
For nice music visit http://musiktag.eu

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation