By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,237 Members | 1,224 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,237 IT Pros & Developers. It's quick & easy.

Using application data in query

P: n/a
There's nothing special in this query:

SELECT tbla.* FROM tbla, tblx WHERE tbla.cola = tblx.cola ORDER BY
tblx.colz

except that I'm creating tblx in application. It's a small array with
just 2 columns and usually 2-3 rows. Used for user preferences.

Do you think there's a way to do it? I'm using PHP and DB2 if it
matters.

Sep 28 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
regul8or wrote:
There's nothing special in this query:

SELECT tbla.* FROM tbla, tblx WHERE tbla.cola = tblx.cola ORDER BY
tblx.colz

except that I'm creating tblx in application. It's a small array with
just 2 columns and usually 2-3 rows. Used for user preferences.

SELECT tbla.*
FROM tbla,
TABLE ( VALUES ( ... <generate rows here... ) ) AS tblx(cola, colb)
WHERE tbla.cola = tblx.cola
ORDER BY tblx.colb

An example for the generated rows could be:

VALUES (1, 2), (3, 4), (5, 6)
Do you think there's a way to do it? I'm using PHP and DB2 if it
matters.
Does not matter.

--
Knut Stolze
DB2 Information Integration Development
IBM Germany
Sep 28 '06 #2

P: n/a

Thanks! It did the trick

Just for the reference (to myself): It's in SQL Reference vol.1,
Fullselect, values-clause

Sep 28 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.