13.07.2015 Views

Caché Upgrade Checklists - InterSystems Documentation

Caché Upgrade Checklists - InterSystems Documentation

Caché Upgrade Checklists - InterSystems Documentation

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

Developers7.2.7.4 Computed Property Self-ReferenceBeginning with this version, computed properties can use {*} to refer to the current property in the compute code. Thisallows for more easily transportable compute code. For example, the following would be displayed in StudioProperty FOO As %String [ Calculated, SqlComputeCode = { s {*}="bar"}, SqlComputed];7.2.7.5 Duplicate Fields In Update or Insert Statements No Longer AllowedStarting with this release, an SQL INSERT or UPDATE statement that contains duplicate fields will now be reported asbeing in error when the statement is prepared or compiled. For example, the following statement will result in an SQL errorcode:insert into sample.person (name, Name) values ('Dave','tom')insert into sample.person set name = 'Dave', Name = 'Tom'update sample.person (name, Name) values ('Dave','tom')update sample.person set name = 'Dave', Name = 'Tom'The new error code value is -377; its message is “Field name '%1' appears more than once in assignment list of insert orupdate statement”.7.2.7.6 SQL COALESCE Function Requires Compatible TypesIn SQL,when preparing or compiling a query that contains the COALESCE function, <strong>Caché</strong> will now return an error(SQLCODE = -378) if the datatypes of arguments are not compatible with each other. Compatibility is judged accordingto the ODBC type of the data. If the type are compatible, but different, the COALESCE function will return a value of thetype with the highest precedence. All the numeric types are compatible and have the following precedence:• DOUBLE• NUMERIC• BIGINT• INTEGER• SMALLINT• TINYINTFor example, in a COALESCE function call with arguments of type TINYINT, INTEGER, and NUMERIC, the type ofthe column will be NUMERIC because NUMERIC has the highest precedence.All of the other ODBC types are currently not compatible with other types, so they must be explicitly CAST in the functionargument in order to mix types.Note:Normalizing the type to the one with the highest common precedence may change the way numbers are displayed.Changing the apparent type from INTEGER to NUMERIC, for example, will display the results with decimalpoints.7.2.7.7 SQL UNION Enforces Type CompatibilityIn previous versions an SQL query such asSELECT 0 AS var1 FROM Table1UNION ALLSELECT 0.1 AS var1 FROM table2<strong>Caché</strong> <strong>Upgrade</strong> <strong>Checklists</strong> 189

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

Saved successfully!

Ooh no, something went wrong!