SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Remove closing parentheses in create table statement

 
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant View previous topic
View next topic
Remove closing parentheses in create table statement
Author Message
birgerii



Joined: 21 Feb 2007
Posts: 29

Post Remove closing parentheses in create table statement Reply with quote
If I position the cursor after the closing parentheses in the statment below and hit enter, the ")" disappears.

CREATE TABLE #tmp_ph_message(
ph bigint
, message varchar(2000)
)


I'm using SQL Assistant version 5.0.97, and I run
SQL Query Analyser version 8.00.2039 on my local PC with XP, connecting to a SQL2000 database on a database server in our network.
Fri Apr 30, 2010 5:39 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7849

Post Reply with quote
I'm unable to reproduce this issue. I tried several different editors to no avail.

Please check if you have custom code snippets associated with ) symbol entry.
Fri Apr 30, 2010 7:02 am View user's profile Send private message
birgerii



Joined: 21 Feb 2007
Posts: 29

Post Reply with quote
When I copied the text, I couldn't reproduce it either.
However, if I open an existing procedure it happens.
I have not been able to narrow it down when it happens, but I also get a strange behaviour when the code is indented(?) (in my example I have used space but when failing, I use tab).

<TAB>CREATE TABLE #tmp_ph_message(
<TAB><TAB>ph bigint
<TAB><TAB>, message varchar(2000)
<TAB><TAB>)

After I hit <Enter> the code looks like

<TAB>create table #tmp_test(
<TAB><TAB>kol1 varchar(10)
<TAB><TAB>, kol2 varchar(5)
C)


If I could send you a file with the code, maybe it would help.

No custom code snippets associated with ")" exists
Fri Apr 30, 2010 7:26 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7849

Post Reply with quote
Do you have any other add-ons installed? Could be some kind of a conflict.

By the way, in the first example, when I hit Enter after the closing bracket, that bracket moves 1 tab to the left, as expected. It does not disappear.

Please try restoring default code formatting settings. On the Options dialog, click Import/Export button, select Load Default Settings, then click Import and OK. Please let us know if that helps.
Fri Apr 30, 2010 7:50 am View user's profile Send private message
birgerii



Joined: 21 Feb 2007
Posts: 29

Post Reply with quote
No other add-ons are installed, as far as I know.

I've installed the default options, but the behaviour is still the same as in my last post.

But if the closing bracket is aligned with Create, nothing happens with the formatting, as expected.
Fri Apr 30, 2010 8:00 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7849

Post Reply with quote
Can you reproduce this issue with Windows Notepad?

Just in case, to try it with Notepad, enable Notepad target and SQL Assistant options and choose appropriate assistance type for this target. Open Notepad, and type or paste your SQL query.
Fri Apr 30, 2010 8:20 am View user's profile Send private message
birgerii



Joined: 21 Feb 2007
Posts: 29

Post Reply with quote
If I use Notepad, everything works as expected.

Could an old installation of SQL Assist interfer with the new version in any way?
Fri Apr 30, 2010 8:31 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7849

Post Reply with quote
Do you think this is specific to CREATE TABLE statement or not?

Can you reproduce that if you disable CREATE TABLE formatting rule in the options?
Fri Apr 30, 2010 9:24 am View user's profile Send private message
birgerii



Joined: 21 Feb 2007
Posts: 29

Post Reply with quote
After a while testing back and forth, I've seen the following behaviour, with the CREATE TABLE formatting rule disable

--test
<TAB>CREATE TABLE #tmp_ph_message(
<TAB><TAB>ph bigint
<TAB><TAB>, message varchar(2000)
<TAB><TAB>)

and hitting <ENTER> with the cursor after the last bracket this is the result


--test
<TAB>CREATE TABLE #tmp_ph_message(
<TAB><TAB>ph bigint
<TAB><TAB>, message varchar(2000)
-)

If I type "CREATE PROCEDURE test AS" on the first line, in the top of my sql-file, the "-" before the bracket is replaced by a "C"...
If the top line is empty, the bracket is deleted.
To me it seems as if the first character is inserted before the bracket.

I also tried with an INSERT INTO statement, and got the same result. (If I place the end bracket on a single line)
Fri Apr 30, 2010 9:45 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7849

Post Reply with quote
I'm still unable to reproduce that in the Query Analyzer. I propose to reinstall the software in order to get the setup recreate configuration files from scratch and don't import any settings from previous version. Before you run the setup, please rename folder %APPDATA%\SQL Assistant to something else. The setup searches for old version config files in this folder and subfolders and imports them if found. If you rename that folder, it won't find anything and will install the default config files.

Please let us know if that helps.
Fri Apr 30, 2010 10:51 am View user's profile Send private message
birgerii



Joined: 21 Feb 2007
Posts: 29

Post Reply with quote
I'm sorry to say, but the uninstall and renaming of the folder followed by a new installation did not solve the problem. I also tried to install the program on a server (a completely new installation of the software), didn't make any modifications at all in the settings, but the problem still occurs as described, hitting enter after the last bracket, the first character from the top line is copied and put before the bracket, and placed at the beginning of the line. If the top line only contains <ENTER>, the last bracket is lost (probably replaced by the combination carriage return and linefeed).
CREATE PROCEDURE xtest
AS
<TAB>CREATE TABLE #tmp_test(
<TAB><TAB>a_col VARCHAR(10)
<TAB><TAB>, b_col VARCHAR(10)
<TAB><TAB>)<ENTER>

results in

CREATE PROCEDURE xtest
AS
<TAB>CREATE TABLE #tmp_test(
<TAB><TAB>a_col VARCHAR(10)
<TAB><TAB>, b_col VARCHAR(10)
C)
Mon May 03, 2010 2:13 am View user's profile Send private message
gemisigo



Joined: 11 Mar 2010
Posts: 2109

Post Reply with quote
This issue seems similar to one I sent in mail to the support about malfunctioning bracket snippet. It broke after I installed the beta over the 4.8 trial. It moved the cursor to the second column of the same row instead of moving it between the brackets. Perhaps they are related...
Mon May 03, 2010 4:12 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7849

Post Reply with quote
We succeeded in reproducing this issue on one of our test system and working on the resolution
Mon May 03, 2010 7:29 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7849

Post Reply with quote
A fix for this issue will be available in the next released build, most likely next week.
Tue May 04, 2010 11:06 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.