CatalogManager3.SetJoinTable Method (PIA)

Use this method to join an external table to a table in the Product Catalog System.

Definition

[Visual Basic .NET]

Imports Microsoft.CommerceServer.Interop.Catalog
…
Public Sub SetJoinTable(strTargetTableName As String,
  strSourceJoinKey As String,strTargetJoinKey As String,
  eJoinType As CatalogJoinTypeEnum,)

[C#]

using Microsoft.CommerceServer.Interop.Catalog;
using ADODB26Lib;                              //For _Recordset
…
public void SetJoinTable(Public Sub SetJoinTable(stringstrTargetTableNamestringstrSourceJoinKeystringstrTargetJoinKeyCatalogJoinTypeEnum eJoinType);

Parameters

[Visual Basic .NET]

  • strTargetTableName
    A String that contains the name of the external table or view with which to join.
  • strSourceJoinKey
    A String that contains the name of the product property to join on.
  • strTargetJoinKey
    A String that contains the name of the column in the external table or view to join against.
  • eJoinType
    A CatalogJoinTypeEnum enumeration that specifies the join type. See the Remarks section for valid values.

[C#]

  • strTargetTableName
    A string that contains the name of the external table or view with which to join.
  • strSourceJoinKey
    A string that contains the name of the product property to join on.
  • strTargetJoinKey
    A string that contains the name of the column in the external table or view to join against.
  • eJoinType
    A CatalogJoinTypeEnum enumeration that specifies the join type. See the Remarks section for valid values.

Exceptions

This method may throw one of many mapped exceptions or an exception of type COMException. See Standard COM Errors for additional details.

The following table shows the custom COM errors that a COMException can wrap.

Name Value Description
E_CAT_CATMGR_NOT_INITIALIZED

[C#] 0x889800B

[Visual Basic .NET] &H8898005

The CatalogManager object has not been initialized. The CatalogManager object should be initialized before calling this method.
E_CAT_INVALID_PARAMETER

[C#] 0x889800B

[Visual Basic .NET] &H8898006

The input parameter <parameter number> is invalid.
E_CAT_INVALID_JOIN_TYPE

[C#] 0x889800C

[Visual Basic .NET] &H8898008

The specified join type is either invalid or not supported.
E_CAT_INVALID_TARGET_TABLE

[C#] 0x889800C

[Visual Basic .NET] &H8898009

The target (join) table that was specified could not be found in the database.
E_CAT_INVALID_SOURCE_JOIN_KEY

[C#] 0x889800C

[Visual Basic .NET] &H889800A

The specified source join-key is invalid.
E_CAT_INVALID_TARGET_JOIN_KEY

[C#] 0x889800C

[Visual Basic .NET] &H889800B

The specified target join-key is invalid.

Remarks

You cannot set multiple join keys for a given source field. For example, you cannot use "ProductCode, VariantCode" as a valid string for the strTargetJoinKey parameter.

After you have called the SetJoinTable method, any method that returns product data will join the normal output of the method with the external table. That is, the join will occur after any sorting or filtering specified in the method call is completed. This means that you cannot sort or filter on columns in the external table. All columns of the external table will be returned.

Join table information does not persist beyond the life of the CatalogManager object.

The following table shows the values in the CatalogJoinTypeEnum enumeration, and shows their associated names, and describes their use.

Name Value Description
CMS_INNER_JOIN 0 Returns only rows where the keys are equal.
CMS_OUTER_JOIN_LEFT 1 Returns all rows in the Product Catalog System and matching rows in the target table.
CMS_OUTER_JOIN_RIGHT 2 Returns matching rows in the Product Catalog System and all rows in the target table.
CMS_OUTER_JOIN_FULL 3 Returns all rows in both tables.
CMS_NO_JOIN -1 Turns off the join with the external table.

When you use the ProductID, VariantID, or other indexed column in the CatalogProducts table as a join key, it is recommended that you index the join key column in the external joined table for better performance.

If you pass a parameter containing spaces to the SetJoinTable method, that parameter must be enclosed by square brackets([]).

For more information about memory ownership issues related to COM property and method parameters, see Managing COM Parameter Memory.

Requirements

Namespace: Microsoft.CommerceServer.Interop.Catalog

Platforms: Windows 2000, Windows Server 2003

Assembly: cataloglib (in cataloglib.dll)

See Also

CatalogManager3 Class

CatalogManager3.CreateProperty

Copyright © 2005 Microsoft Corporation.
All rights reserved.