PhenixID

Write and Match to SQL

Version: 1.3

Category: Process

Extended Category: SQL

Action Package: Standard Actions

Description

Match and update or create records and values to a SQL data source.

Parameter

Description

Example

Force User Data Source

Always match and write to this data source.

MS SQL 2008

SQL Match Query:

Match a session object with an SQL data source. Use SESSION(attributeName) to insert attribute names into the SQL query.

SELECT USERNAME FROM IDMAPPING WHERE OBJECTID=’SESSION(ObjectId)’

SQL Update Query:

This query will be executed if Match query found a result. Leave blank if no update should be executed. Use SESSION(attributeName) to insert attribute names into the SQL query.

UPDATE Person SET LastName=’SESSION(LastName)’, FirstName=’SESSION(FirstName)’ WHERE Userid=’SESSION(Userid)’

SQL Create Query:

This query will be executed if no Match was found. Leave blank if no create should be executed. Use SESSION(attributeName) to insert attribute names into the SQL query.

IINSERT INTO IDMAPPING (USERNAME, OBJECTID) VALUES(‘SESSION(samaccountname)’, ‘SESSION(objectid)’)

Set isNew Flag (true/false):

If set to true, the isNew flag will be set if the SQL Create query is executed. Default: false.

true

Use Cases

Example 1: Create or Update in SQL

This action will create user if not exist otherwise it will update the entity in the data source.

Parameter

Value

Force User Data Source

MS SQL EXPRESS 2005

SQL Match Query:

SELECT * From Person WHERE Userid=’SESSION(Userid)’

SQL Update Query:

UPDATE Person SET LastName=’SESSION(LastName)’, FirstName=’SESSION(FirstName)’ WHERE Userid=’SESSION(Userid)’

SQL Create Query:

INSERT INTO Person (Userid, LastName, FirstName, Password) VALUES (‘SESSION(Userid)’, ‘SESSION(LastName)’, ‘SESSION(FirstName)’,’SESSION(Password)’)

Set isNew Flag (true/false):

[BLANK]


DISCLAIMER
Information provided in this document is for your information only. PhenixID makes no explicit or implied claims to the validity of this information. Any trademarks referenced in this document are the property of their respective owners.

The origin of this information may be internal or external to PhenixID. PhenixID makes all reasonable efforts to verify this information.

PhenixID - support.phenixid.se