You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Surya Saraff <su...@yahoo.com> on 2001/11/07 00:03:16 UTC

Column names with spaces in btwn.

Hi,
I tried executing:
try{
  PreparedStatement updaterequest;
  String s = new String( "insert into
Request(Priority, Detailed Description, Title)
values('High','Krypton','title' );");
 updaterequest = con.prepareStatement( s );
 updaterequest.execute();
		  }
		
It gives me "java.sql.SQLException: [Microsoft][ODBC
Microsoft Access Driver] Syntax error in INSERT INTO
statement. "

But, when I have "Description" instead of "Detailed
Description" it works fine. (I have both those fields
in my database)

Does anyone have any idea how I can handle the extra
space btwn "Detailed" and "Description"

Regards,
Surya


__________________________________________________
Do You Yahoo!?
Find a job, post your resume.
http://careers.yahoo.com

--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Column names with spaces in btwn.

Posted by Mandeep Mehta <me...@zeenext.com>.
Surya,
    Try enclosing the columns with spaces in square brackets like [Detailed
Description]. It might help.

Regards
Mandeep

----- Original Message -----
From: "Surya Saraff" <su...@yahoo.com>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Wednesday, November 07, 2001 04:33
Subject: Column names with spaces in btwn.


> Hi,
> I tried executing:
> try{
>   PreparedStatement updaterequest;
>   String s = new String( "insert into
> Request(Priority, Detailed Description, Title)
> values('High','Krypton','title' );");
>  updaterequest = con.prepareStatement( s );
>  updaterequest.execute();
>   }
>
> It gives me "java.sql.SQLException: [Microsoft][ODBC
> Microsoft Access Driver] Syntax error in INSERT INTO
> statement. "
>
> But, when I have "Description" instead of "Detailed
> Description" it works fine. (I have both those fields
> in my database)
>
> Does anyone have any idea how I can handle the extra
> space btwn "Detailed" and "Description"
>
> Regards,
> Surya
>
>
> __________________________________________________
> Do You Yahoo!?
> Find a job, post your resume.
> http://careers.yahoo.com
>
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


Re: Column names with spaces in btwn.

Posted by Tom Drake <rt...@pobox.com>.
Surya:

The problem is that SQL does not allow for spaces in identifier names.
Microsoft, extended the standard to allow for this. In order for you to
'correctly' use these sorts of identifiers you'll need to surround them
with square brackets (e.g. [Detailed Description] ). I would advise
you to modify your schema and all corresponding source code to
eliminate all spaces in table and column names, if at all possible.
Those spaces will cause you problems if you every decide to migrate
to another (non-Microsoft) database.


----- Original Message ----- 
From: "Surya Saraff" <su...@yahoo.com>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Tuesday, November 06, 2001 3:03 PM
Subject: Column names with spaces in btwn.


| Hi,
| I tried executing:
| try{
|   PreparedStatement updaterequest;
|   String s = new String( "insert into
| Request(Priority, Detailed Description, Title)
| values('High','Krypton','title' );");
|  updaterequest = con.prepareStatement( s );
|  updaterequest.execute();
|   }
| 
| It gives me "java.sql.SQLException: [Microsoft][ODBC
| Microsoft Access Driver] Syntax error in INSERT INTO
| statement. "
| 
| But, when I have "Description" instead of "Detailed
| Description" it works fine. (I have both those fields
| in my database)
| 
| Does anyone have any idea how I can handle the extra
| space btwn "Detailed" and "Description"
| 
| Regards,
| Surya
| 
| 
| __________________________________________________
| Do You Yahoo!?
| Find a job, post your resume.
| http://careers.yahoo.com
| 
| --
| To unsubscribe:   <ma...@jakarta.apache.org>
| For additional commands: <ma...@jakarta.apache.org>
| Troubles with the list: <ma...@jakarta.apache.org>
| 
| 
| 


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>