This is a discussion on sql dummies within the Oracle Miscellaneous forums, part of the Oracle Database category; --> Hello, I'm switching from sybase to oracle. With sybase, I was used to start with sql-dummies like select 'test' ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hello, I'm switching from sybase to oracle. With sybase, I was used to start with sql-dummies like select 'test' so I could build the whole application on top of the sql-statement and later I replaced this dummy by a real sql-statement querying table data. How can I do this with oracle? Oracle doesn't allow a statement like the above one. Regards Marten |
| |||
| Marten Lehmann wrote: > Hello, > > I'm switching from sybase to oracle. With sybase, I was used to start > with sql-dummies like > > select 'test' > > so I could build the whole application on top of the sql-statement and > later I replaced this dummy by a real sql-statement querying table data. > > How can I do this with oracle? Oracle doesn't allow a statement like the > above one. > > Regards > Marten Perhaps, if you indicate what it is you want to do, rather than what command you used in Sybase, someone might be able to help. -- Randy Harris tech at promail dot com I'm pretty sure I know everything that I can remember. |
| |||
| > Perhaps, if you indicate what it is you want to do, rather than what > command you used in Sybase, someone might be able to help. Sorry, I thought thats clear. Just assume that my final sql-statement will return exactly one row of data with lets say 3 rows. So could be something like select fname, lname, city from employees where id = 123 But at the start of my project, this table doesn't exist and the whole table design isn't ready yet. But I know that the query will return one row with the expected fields. So at the start I could use a dummy like this select 'Bill', 'Gates', 'Redmond' which would return 'Bill', 'Gates', 'Redmond' in one row as it could happen with the first statement. The first statement could be far more complex, so using dummies is definetely a good idea for the start. How can I do this in Oracle? I'm sure there is a way. Regards Marten |
| |||
| "Marten Lehmann" <lehmannmapson@cnm.de> wrote in message news:48j1ggFkh97kU2@individual.net... > > will return exactly one row of data with lets say 3 rows. > > Sorry, I was meaning columns. select 'a','b','c' from dual; -- Terry Dykstra Canadian Forest Oil Ltd. |
| ||||
| On Fri, 24 Mar 2006 21:03:25 +0100, Marten Lehmann wrote: >> will return exactly one row of data with lets say 3 rows. > > Sorry, I was meaning columns. You apparently are looking for a placeholder mechanism. In Oracle, I believe the closest thing you will find is the 'DUAL' table, which has one real column and one real row. Select * from dual; will always return one row, one column. You can then use literal to be placeholders for the further expressions you need in development. (The simplest expression being, of course, a simple column or literal.) One caution - there are enough differences between Oracle and Sybase internals that you will have some challenges in your approach. I strongly encourage reading Tom Kyte's books (see http://www.apress.com) before proceeding - the list of challenges IS long enough and complex enough to fill a book. -- Hans Forbrich Canada-wide Oracle training and consulting mailto: Fuzzy.GreyBeard_at_gmail.com *** Top posting [replies] guarantees I won't respond. *** |