PATH  WebObjects 4.0 Documentation > ODBCEOAdaptor Reference

[TOC]  [Prev]  [Next]  [Show Frames]  [Hide Frames]

ODBCSQLExpression

Inherits From:
EOSQLExpression : NSObject

Declared in: ODBCEOAdaptor/ODBCSQLExpression.h


Class Description

ODBCSQLExpression defines how to build SQL statements for ODBCChannels.


Bind Variables

The ODBCAdaptor uses bind variables. A bind variable is a placeholder used in an SQL statement that is replaced with an actual value after the database server determines an execution plan. You use the following methods to operate on bind variables:


Instance Methods


bindVariableDictionaryForAttribute:value:

- (NSMutableDictionary *)bindVariableDictionaryForAttribute:(EOAttribute *)attribute
value:value

Overrides the EOSQLExpression method bindVariableDictionaryForAttribute:value: to return the receiver's bind variable dictionaries. For more information on bind variables, see the discussion in the class description.

See also: - mustUseBindVariableForAttribute:, - shouldUseBindVariableForAttribute:


lockClause

- (NSString *)lockClause

Overrides the EOSQLExpression method lockClause to return the SQL string used in a SELECT statement to lock selected rows. If you're using the Microsoft SQL Server, this method returns @"HOLDLOCK". Otherwise, it returns @"FOR UPDATE".


mustUseBindVariableForAttribute:

- (BOOL)mustUseBindVariableForAttribute:(EOAttribute *)attribute

Overrides the EOSQLExpression method mustUseBindVariableForAttribute: to return YES since in the ODBC adaptor, the receiver must always use bind variables for attribute. A returned value of YES indicates that the underlying RDBMS requires that bind variables be used for attributes with attribute's external type.

See also: - shouldUseBindVariableForAttribute:, - bindVariableDictionaryForAttribute:value:


prepareSelectExpressionWithAttributes:lock:fetchSpecification:

- (void)prepareSelectExpressionWithAttributes:(NSArray *)attributes lock:(BOOL)lock fetchSpecification:(EOFetchSpecification *)fetchSpec

Overrides the EOSQLExpression method prepareSelectExpressionWithAttributes:lock:fetchSpecification:to generate a SELECT statement. For a more complete description of what this entails, see the prepareSelectExpressionWithAttributes:lock:fetchSpecification: method description in the EOSQLExpression class specification.


shouldUseBindVariableForAttribute:

- (BOOL)shouldUseBindVariableForAttribute:(EOAttribute *)attribute

Overrides the EOSQLExpression method shouldUseBindVariableForAttribute: to return YES since in the ODBC adaptor, the receiver must always be able to provide a bind variable dictionary for attribute. A returned value of YES indicates that the receiver should use bind variables for attributes with attribute's external type.

See also: - mustUseBindVariableForAttribute:, - bindVariableDictionaryForAttribute:value:



[TOC] [Prev] [Next]

Copyright © 1998, Apple Computer, Inc. All rights reserved.