Fixed command "set quoted_identifier on" in MS-SQL

Code patches written by our users to solve certain "problems" that were not solved, yet.

Moderators: gto, cipto_kh, EgonHugeist, mdaems

Post Reply
rpelisson
Fresh Boarder
Fresh Boarder
Posts: 8
Joined: 23.01.2006, 12:26

Fixed command "set quoted_identifier on" in MS-SQL

Post by rpelisson »

The ZConnection using a fixed command for the parameter quoted_identifier in MS-SQL

In the servers with SQL Server 2000 this is working with succes, but in MS-SQL 7.0 what use almost commands using double quotes generate a SQL error and not was executed.

The new propertie for ZConnection solve this problem.

See the attachment
You do not have the required permissions to view the files attached to this post.
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

rpelisson,

I know, this is a very old post...
Time to do something about it.

I just checked it. And I have a question. You propose

Code: Select all

// alterado Rafael 11/07/2006
// - O parametro estava Fixo, foi criada para habilitar a opção de quoted OFF
//  InternalExecuteStatement('set textsize 2147483647 set quoted_identifier on');

  S:= Info.Values['quoted_identifier'];

  If S='' Then
    S:='on';

  InternalExecuteStatement('set textsize 2147483647 set quoted_identifier '+S);
Is it necessary to have a parametrizable identifierquote setting?

My impression is that it would be better to use

Code: Select all

  InternalExecuteStatement('set textsize 2147483647 set quoted_identifier '+GetMetaData.GetIdentifierQuoteString);
Because this is the constant Zeoslib uses when it has to create statements including quoted identifiers.
When Mssql supports custom quoting characters and you want the feature in Zeoslib, this should be implemented using the Metadata objects. eg. By setting the value of the GetIdentifierQuoteString in the Metadata object. That way automatically generated queries also use the right quoting.

Mark
Image
Post Reply