13.07.2015 Views

Caché Transact-SQL (TSQL) Migration Guide - InterSystems ...

Caché Transact-SQL (TSQL) Migration Guide - InterSystems ...

Caché Transact-SQL (TSQL) Migration Guide - InterSystems ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Supported FunctionsThe date separator must be a hyphen (-). Dates in any other format return 0.The date can also be specified in <strong>Caché</strong> $HOROLOG date format, such as 60703 (March 14, 2007).6.1.45 NCHARNCHAR(num)Returns the character corresponding to the integer value num. Thus NCHAR(65) returns A.NCHAR is functionally identical to CHAR. The reverse of this function is ASCII.6.1.46 NEWIDNEWID()Returns a unique value of a type compatible with the <strong>SQL</strong> Server UNIQUEIDENTIFIER data type. UNIQUEIDENTIFIERis a system-generated 16-byte binary string, also known as a GUID (Globally Unique ID). <strong>Caché</strong> T<strong>SQL</strong> does not supportUNIQUEIDENTIFIER; it instead uses VARCHAR(32) as the data type for a Globally Unique ID.NEWID() can be used to specify the DEFAULT value when defining a field.6.1.47 NULLIFNULLIF(expr1,expr2)Returns NULL if expr1 is equivalent to expr2. Otherwise, returns expr1.6.1.48 OBJECT_IDOBJECT_ID(objname)Takes the object name as a quoted string and returns the corresponding object ID of the specified object as an integer.Returns the empty string if objname does not exist. Can be used within procedure code or trigger code. The inverse ofOBJECT_NAME.CREATE PROCEDURE GetNameAS SELECT OBJECT_ID('Person')GO6.1.49 OBJECT_NAMEOBJECT_NAME(id)Takes the object ID integer and returns the corresponding object name of the specified object. Returns the empty string ifid does not exist. Can be used within procedure code or trigger code. The inverse of OBJECT_ID.CREATE PROCEDURE GetIDAS SELECT OBJECT_NAME(22)GO<strong>Caché</strong> <strong>Transact</strong>-<strong>SQL</strong> (T<strong>SQL</strong>) <strong>Migration</strong> <strong>Guide</strong> 45

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!