![]() | ![]() Products ![]() ![]() ![]() ![]() |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB SQL » View Thread |
Messages 1 to 9 of 9 total |
![]() |
Wed, Feb 4 2009 6:11 AM | Permanent Link |
James Relyea | Is there any command to reindex tables, or is Optimize it?
When I run: "optimize tablename", I seem to be OK. I am getting errors whenever I specify an index name like "optimize tablename 'index name'. This is the error syntax: "ElevateDB Error #700 An error was found in the statement at line 2 and column 30 (Expected index name but instead found 'my index name')" The index name is not misspelled. Thanks ![]() jr |
Wed, Feb 4 2009 7:35 AM | Permanent Link |
Roy Lambert NLH Associates ![]() | James
From the manual Syntax OPTIMIZE TABLE <TableName> [USING <IndexName>] Roy Lambert [Team Elevate] |
Wed, Feb 4 2009 9:28 AM | Permanent Link |
James Relyea | I think I found my problem: Indexes without spaces worked. Indexes with spaces enclosed in
single quotes throw the error below. So, how do I execute Optimize statements and use indexes with spaces? ![]() jr James Relyea wrote: Is there any command to reindex tables, or is Optimize it? When I run: "optimize tablename", I seem to be OK. I am getting errors whenever I specify an index name like "optimize tablename 'index name'. This is the error syntax: "ElevateDB Error #700 An error was found in the statement at line 2 and column 30 (Expected index name but instead found 'my index name')" The index name is not misspelled. Thanks ![]() jr |
Wed, Feb 4 2009 9:56 AM | Permanent Link |
"Eduardo [HPro]" | James
My suggestion is "never" use space in database objects (database, tables, fields, indexes, etc). Eduardo |
Wed, Feb 4 2009 10:10 AM | Permanent Link |
Fernando Dias ![]() | James,
1. As Roy indicated, the syntax you are using for OPTIMIZE is wrong - you are missing the word "USING" 2. Database object names that contain spaces must be enclosed in double quotes, not single quotes. For example: OPTIMIZE "My Table Name" USING "My Index Name" Single quotes are used only to delimit string literals. 3. If you want to rebuild the indexes then you must use REPAIR TABLE, not OPTIMIZE TABLE. -- Fernando Dias [Team Elevate] |
Wed, Feb 4 2009 10:13 AM | Permanent Link |
Roy Lambert NLH Associates ![]() | James
The rule seems to be double space for system objects and single space for data so try wrapping in double spaces. However, I will agree with Eduado - don't use spaces for table, column, stored procedures, index names etc Roy Lambert [Team Elevate] |
Wed, Feb 4 2009 11:05 AM | Permanent Link |
James Relyea | Thanks everyone!
Double quotes work. For the very first time in over 13 years, I chose to use spaces in DB object name.... and I got bit by it! I won't be using spaces again! ![]() jr Roy Lambert wrote: James The rule seems to be double space for system objects and single space for data so try wrapping in double spaces. However, I will agree with Eduado - don't use spaces for table, column, stored procedures, index names etc Roy Lambert [Team Elevate] |
Wed, Feb 4 2009 12:10 PM | Permanent Link |
Roy Lambert NLH Associates ![]() | James
I also developed a habit of prefacing column names with an underscore - pretty much guarantees no collision with reserved words. Roy Lambert |
Tue, Feb 17 2009 11:30 AM | Permanent Link |
"James Relyea" | I was doing that but found it handier use the data type in the column name.
Helps me not use reserved words too. (eg EmpId could be a variety of data types so I usually prefix them like intEmpId varEmpId or idEmpId for GUIDs depending on the app. It's saved me debugging time down the road when I've not looked at the app for a while. I do the same for .Net object types too for the same reason. ![]() jr "Roy Lambert" <roy.lambert@skynet.co.uk> wrote in message news:E67D3A60-579B-488E-A518-89312642E663@news.elevatesoft.com... > James > > > I also developed a habit of prefacing column names with an underscore - > pretty much guarantees no collision with reserved words. > > Roy Lambert > |
This web page was last updated on Wednesday, August 14, 2024 at 07:31 PM | Privacy Policy![]() © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? ![]() |