Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Any suggestions ?

Re: Any suggestions ?

From: Mike <mike.walton_at_btinternet.com>
Date: Fri, 14 Jan 2005 22:29:53 GMT
Message-ID: <BJXFd.1274$TT5.127@newsfe6-gui.ntli.net>


Luc

Many many thanks for your very quick reply.......appreciated. I have tried your statement but now get the following response :

Expected end of statement

strSQL = "select * from "Cottages", "Pricebands" where "Location" = '& strLocation &' and "Price Number" = '& strDates &' and "Bedrooms Number" = '& strRooms &' and "Pets" = '& strPets &'"

Any quick solution ? any chance I could email you the page for you to look at in context ??

Many thanks

Luc Gyselinck wrote:

> If you would take the time to elaborate this expression, it would
> look like:
>
> select * from Cottages, Pricebands where Location = '<something>',
> Price Number = '<something>', Bedrooms Number = '<something>', Pets =
> '<something>'
>
> You have several problems here
> 1. This is not a valid SQL statement, hence the ORA-00933 error
> 2. You do not use bind variables, you will blow up your sql area
> 3. There is no join condition between the two tables you select from,
> cartesian product, is this the intend ?
> 4. Are your table and column names case sensitive? If yes, you'll
> have to put the names between double quotes.
> 5. What about these columns in two words ? Price Number, etc...
>
> Give us a describe of the tables...
>
> SQL> select * from Cottages, Pricebands where Location =
> '<something>', 2 Price Number = '<something>', Bedrooms Number =
> '<something>', Pets = '<something>'
> SQL> /
> select * from Cottages, Pricebands where Location = '<something>',
> *
> ERROR at line 1:
> ORA-00933: SQL command not properly ended
>
> SQL> create table test
> 2 ( "Price Number" number,
> 3 "Bedrooms Number" number)
> 4 /
>
> Table created.
>
> SQL> descr test
> Name Null? Type
> ----------------------------------------- --------
> ------------------------ ----
> Price Number NUMBER
> Bedrooms Number NUMBER
>
> SQL> insert into test values(1,1);
>
> 1 row created.
>
> SQL> commit;
>
> Commit complete.
>
> SQL> select Price Number from test
> 2 /
> select Price Number from test
> *
> ERROR at line 1:
> ORA-00923: FROM keyword not found where expected
>
> SQL> select "Price Number" from test
> 2 /
>
> Price Number
> ------------
> 1
>
> SQL> drop table test
> 2 /
>
> Table dropped.
>
> SQL>
>
> Here is something that looks closer to SQL:
>
> select * from "Cottages", "Pricebands" where "Location" =
> '<something>' AND "Price Number" = '<something>' AND "Bedrooms
> Number" = '<something>' AND "Pets" = '<something>'
>
> Good luck.
>
> "Mike" <mike.walton_at_btinternet.com> wrote in message
> news:x3XFd.543$N25.236_at_newsfe3-gui.ntli.net...
> > Anybody able to advise please
> >
> > I get the following message
> > ORA-00933: SQL command not properly ended
> >
> > which relates to the following statement
> >
> > strSQL = "select * from Cottages, Pricebands where Location = '"&
> > strLocation &"', Price Number = '"& strDates &"', Bedrooms Number =
> > '"& strRooms &"', Pets = '"& strPets &"' "
> >
> > What's wrong ??
Received on Fri Jan 14 2005 - 16:29:53 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US