Re: Order in the Database
Posted in 1999
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL, Platform-Specific Issues
From: mathprof@bigfoot.com > >I have two (related?) questions about using "order by" with Informix >(I'm using SE-7, the free Linux version). First my questions: > >Q1: "select x from tabname order by y" doesn't work. How can I make it >work, or what's a good workaround? AFAIK, there isn't one. TTBOMK, this is ANSI-standard behaviour. >Q2: You can't create a view that has an 'order by' clause in it. Is >there a workaround to this? Not that I know of. >Now my thoughts: > >I don't think Q1 is hard-- for example, Informix could simply do a >"select x,y from tabname order by y" (which works fine), and then strip >off the column y which I'm not using before returning the result to me. >In other words, it shouldn't be hard to "hide" the ORDER BY column even >if Informix needs it internally to do the query. Am I missing something? Just the ANSI standard. :-) >For Q2, I can sort of see the issue-- views are like tables, and tables >don't have any implicit order (for one thing, if you could create a view >with order, then "select * from view order by x" would be ambigious). >So, I'm wondering if there's something SIMILAR to a view that does what >I want? I'm not too familiar with terminology, but I think this would be >a cross between a view and a form? About the only way I could think of doing it is using a 4GL program or an ESQL/C + SPerform screen. Not very helpful, I'm afraid. ______________________________________________________ Get Your Private, Free Email at http://www.hotmail.com
Set field, you order by must be in the select-List Obnoxio The Clown schrieb: > From: mathprof@bigfoot.com > > > >I have two (related?) questions about using "order by" with Informix > >(I'm using SE-7, the free Linux version). First my questions: > > > >Q1: "select x from tabname order by y" doesn't work. How can I make it > >work, or what's a good workaround? > > AFAIK, there isn't one. TTBOMK, this is ANSI-standard behaviour. > > >Q2: You can't create a view that has an 'order by' clause in it. Is > >there a workaround to this? > > Not that I know of. > > >Now my thoughts: > > > >I don't think Q1 is hard-- for example, Informix could simply do a > >"select x,y from tabname order by y" (which works fine), and then strip > >off the column y which I'm not using before returning the result to me. > >In other words, it shouldn't be hard to "hide" the ORDER BY column even > >if Informix needs it internally to do the query. Am I missing something? > > Just the ANSI standard. :-) > > >For Q2, I can sort of see the issue-- views are like tables, and tables > >don't have any implicit order (for one thing, if you could create a view > >with order, then "select * from view order by x" would be ambigious). > >So, I'm wondering if there's something SIMILAR to a view that does what > >I want? I'm not too familiar with terminology, but I think this would be > >a cross between a view and a form? > > About the only way I could think of doing it is using a 4GL program or an > ESQL/C + SPerform screen. Not very helpful, I'm afraid. > > ______________________________________________________ > Get Your Private, Free Email at http://www.hotmail.com