Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / DB2 Topics / September 2006

Tip: Looking for answers? Try searching our database.

Using application data in query

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
regul8or - 28 Sep 2006 06:24 GMT
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.
Knut Stolze - 28 Sep 2006 07:38 GMT
> There's nothing special in this query:
>
[quoted text clipped - 3 lines]
> 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.

Signature

Knut Stolze
DB2 Information Integration Development
IBM Germany

regul8or - 28 Sep 2006 11:56 GMT
Thanks! It did the trick

Just for the reference (to myself): It's in SQL Reference vol.1,
Fullselect, values-clause
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.