The document summarizes new features in Informix Dynamic Server (IDS) version 11.10. Key features include:
1) Full support for subqueries in the FROM clause of SQL statements and enhancements to distributed queries.
2) New data types like Node and Binary, and a basic text search index for full text search capabilities.
3) Performance improvements to the SQL optimizer including an index self-join access method and directives for ANSI joins.
4) Enhancements to stored procedures, functions, isolation levels and utilities like SYSDBOPEN and SYSDBCLOSE.
B.COM Unit – 4 ( CORPORATE SOCIAL RESPONSIBILITY ( CSR ).pptx
IBM Informix dynamic server 11 10 Cheetah Sql Features
1. New Application Development features in IDS 11.10. Keshava Murthy, Architect, Informix Development [email_address]
2.
3.
4.
5. Enhancements to Distributed Queries Application IDS Server: lenexa Database: geardb Table: winter_gear with Boolean, lvarchar and distinct types C, SPL, Java functions IDS Server: portland Database:geardb Table: rain_gear with Boolean, lvarchar, and distinct types C, SPL, Java functions IDS Server: menlo Database: geardb Table: winter_gear with Boolean, lvarchar and distinct types C, SPL, Java functions ISTAR: Distributed query connections SQL and result set exchange Multiple IDS server setup IDS Server: toronto Database:geardb C, SPL, Java functions
6. Trigger Enhancements employee_tab Insert trigger Delete trigger employee_tab Pre 11.10 server 11.10 server Single insert and delete triggers, and multiple update and select triggers on mutually exclusive columns Multiple insert, update, delete and select triggers without exclusivity rule. The multiple insert and delete triggers feature is new in Cheetah. Update triggers Insert triggers Delete triggers Update triggers Select triggers New Feature: Multiple Triggers New feature: No column Exclusivity rule Select triggers
7.
8. Index Self-Join Access Method SELECT * FROM tab WHERE c1 >= 1 AND c1 <= 3 AND c2 >= 10 AND c2 <= 11 AND c3 >= 100 AND c3 <= 102; leafpage leafpage leafpage leafpage leafpage leafpage leafpage Root View of the index on (c1, c2, c3) Leaf level
9. Prior Releases Lower Filter c1 >= 1 Upper Filter c1 <= 3 Index Scan Region Eliminated range on c1
10. With This Feature Lead Keys: c1, c2 Lower Filter c1 = c1 and c2 = c2 and c3 >= 100 Upper Filter c3 <= 102 Index Scan Regions Regions eliminated by Index Self Join strategy
11.
12.
13.
14.
15. Committed Read Last Committed -- do more -- do more --will return 850.00 -- do more -- do more -- Status: lock wait Commit work; -- Continue processing -- Continue processing -- Status: lock wait insert into daily_tab(“transfer”, 1234, 3456, 400); select balance from cust_tab where custid = 1234; -- No waiting -- will return 1250.00 select balance from cust_tab where custid = 1234; -- No waiting. will return 850.00. select balance from cust_tab where custid = 1234; -- wait for the lock on row for customer 1234 update cust_tab set balance = balance + 400 where cust_id = 3456; -- balance of customer 1234 is 850.00 begin work; begin work; begin work; update cust_tab set balance =balance – 400 where cust_id = 1234; begin work; set isolation to read committed; -- Current balance of customer 1234 is 1250.00 Transaction4 LAST COMMITTED (New in IDS 11.10) Transaction3 DIRTY READ Transaction2 COMMITTED READ (default in logged database) Transaction1 Event
16. Committed Read Last Committed S3:reconstruct 1234 1250 customerid balance S1: start a transaction 1234 850 S1:Withdraw $400 Lock the record and create Log for subtractting 400. 1234 850 S1:Read the updated record S2: committed read: RequestRead the record being updated Result: lock error or wait, if requested S3: Dirty Read request Result: The value returned is time sensitive. Wait for the update to complete and then return 850 S4: Last committed read Result: Recognizes the lock on the row. Goes to the log, returns the old row [1234, 1250] Last Committed Read, Visually
17. Websphere MQ Messaging Support MQI Connection Queue1 Websphere MQ Informix Dynamic Server Order Entry Application Queue2 Shipping Application MQ Functions and MQ VTI table.
18.
19.
20. Named Parameters Support for JDBC Here is the same code rewritten using named parameter notation: // Set parameters (named notation) cstmt.setInt(" cust_id ", 5739 ); Chapter 9. SQL Language 275 cstmt.setInt(" item_id ", 8294); cstmt.setString(" shipping_addr ", "345, University ave."); cstmt.setInt(" shipping_zip ", 94303); cstmt.setString(" billing_addr ","4100 Bohannon Dr."); cstmt.setInt(" billing_zip ", 94025); cstmt.setInt(" count ", 5); // Execute cstmt.execute();
21. New Functions and Expressions ASCII(character_expression) The ASCII function returns the decimal representation of the first character in a character string. ASCII(‘a’) returns: 97 ASCII(‘Hello World!’) returns: 72 ASCII ADD_MONTHS(date/datetime expression , integer ) Adds months to a date or datetime value or expression. The first argument is date or datetime expression and second is an integer. Return type is same as first argument. ADD_MONTHS('4/16/2004', 20) returns: 12/16/2005 ADD_MONTHS(CURRENT, 3) returns: 2007-09-19 10:04:11.00000 ADD_MONTHS()
22. New Functions and Expressions CEIL (numerical_expession) returns the DECIMAL(32) representation of the smallest integer that is greater than or equal to its single argument. FLOOR(numerical_expression) returns the DECIMAL(32) representation of the largest integer that is smaller than or equal to its single argument. CEIL(-54.232) returns -54 FLOOR(-54.232) returns -55 CEIL(54.232) returns 55 FLOOR(54.232) returns 54 CEIL FLOOR BITAND(num1, num2) – returns the bitwise ANDed value. BITOR(num1, num2) – returns the bitwise ORed value. BITXOR(num1, num2) – returns the bitwise XORed value. BITNOT(num1) – returns the bitwise ANDed value. BITANDNOT(num1, num2) – is a short form for BITAND(arg1, BITNOT(arg2)) Bitwise functions
23. New Functions and Expressions LAST_DAY(date or datetime expression) Returns last day of the month in the argument. SELECT TODAY AS today, CURRENT AS current, LAST_DAY(TODAY) AS last_from_today, LAST_DAY(CURRENT) AS last_from_current FROM systables WHERE tabid = 1; today 06/19/2007 current 2007-06-19 10:23:01.000 last_from_today 06/30/2007 last_from_current 2007-06-30 10:23:01.00000 LAST_DAY FORMAT_UNITS(number, precision, units) Helps formatting of numbers in kilobytes to peta bytes. Detailed explanation with examples is in IDS SQL Syntax guide. SELECT FORMAT_UNITS( SUM(chksize), 'P') size, FORMAT_UNITS( SUM(nfree), 'p') free FROM syschunks; size 117 MB free 8.05 MB FORMAT_UNITS
24. New Functions and Expressions MONTHS_BETWEEN(date/datetime expr, date/datetime expr) Returns the difference between two date or datetime expressions in decimal, based on 31day months. SELECT CURRENT, MONTHS_BETWEEN(TODAY, LAST_DAY(CURRENT)) FROM systables WHERE tabid = 1; (expression) (expression) 2007-06-19 10:51:57.000 -0.3694433243728 MONTHS_BETWEEN LTRIM(source_string, pad_string) Returns the source_string after removing specified leading pad characters from a string. LTRIM will remove leading blanks when you simply pass the source string. LTRIM(‘Hello Cheetah!’, ‘Hello ‘) returns: Cheetah! LTRIM
25. New Functions and Expressions TO_NUMBER(character or numeric expression) converts a number or a character expression representing a number value to a DECIMAL. TO_NUMBER NULLIF(arg1, arg2) Returns NULL if arg1 and arg2 are equal, else returns arg1. If both are NULL – they won’t be equal – but still returns NULL because arg1 is NULL. NULLIF Next_day(date or datetime expr, abbreviated day of the week) Returns the date or datetime for next day matching the second argument. EXECUTE FUNCTION NEXT_DAY(TODAY, 'Mon') returns: 06/25/2007 EXECUTE FUNCTION NEXT_DAY(CURRENT, 'Mon') returns: 2007-06-25 6:57:52.00000 NEXT_DAY
26. Enhancements to Functions Works same as POW() function. POWER Returns the same value as CURRENT DATETIME year to fraction(5) SYSDATE These two functions can now take date and datetime expressions. IDS Syntax guide explains this in detail. TRUNC ROUND TO_CHAR(numeric expression) In addition to exisiting functionality, in IDS v11.10, this function will convert a number into a charater string. TO_CHAR
27.
28.
29.
30. Node Data Type -- create employees table CREATE TABLE Employees(Employee_Id NODE, desc VARCHAR(60)); -- insert the hierarchical information. INSERT INTO Employees VALUES ('1.0', "CEO"); INSERT INTO Employees VALUES ('1.1', "VP1"); INSERT INTO Employees VALUES ('1.1.1', "Admin for VP1"); INSERT INTO Employees VALUES ('1.2', "VP2"); INSERT INTO Employees VALUES ('1.2.1', "Manager1"); INSERT INTO Employees VALUES ('1.2.2', "Manager2"); INSERT INTO Employees VALUES ('1.2.2.1', "Admin for Manager2"); -- Retrieve the hierarchy for the “Admin for Manager2” SELECT * FROM Employees E WHERE isAncestor(Employee_Id, '1.2.2.1') ORDER BY E.Employee_Id ; employee_id desc 1.0 CEO 1.2 VP2 1.2.2 Manager2
31.
32.
33. Basic Text Search Index Invocation of LUCENE for text index operations IDS Client IDS Client BTS: Basic Text Search Index Interface Informix Dynamic Server C-LUCENE text search index analyze and arts behavior cut … with your 0, 8, 12, 15 1, 9, 15, 22, 44, 23, 1, 8, 10 1 2, 22 … … … Index Access method Query processing and Optimizer
34. Basic Text Search Index mkdir /work/myapp/bts_expspace_directory -- Create an external space to hold the index onspaces -c -x bts_extspace -l /work/myappbts_expspace_directory onmode –p +1 bts --Create a table with a BTS index CREATE TABLE article_tab(id integer, title lvarchar(512)); -- Load the data below Informix and Open source: database defense against the dark political arts 1 Understanding locking behavior and analyze lock conflicts in IDS 0 title id
35. Basic Text Search Index CREATE INDEX title_index ON article_tab(title bts_lvarchar_ops ) USING bts IN bts_extspace; SELECT id FROM article_tab WHERE bts_contains(title, 'informix'); -- with the AND Boolean operator (&& and + are allowed as well) SELECT id FROM article_tab WHERE bts_contains (title, 'informix AND dynamic'); SELECT id FROM article_tab WHERE bts_contains (title, 'inf*rmix'); SELECT id FROM article_tab WHERE bts_contains (title,'"java"~10');
36.
37.
38.
39.
40.
41.
42.
43. XML Publishing UDR invoking the XSLT4C and XML4C libraries within IDS IDS Client IDS Client Extract functions extract() extracevalue() existsnode() idsXMLParse() genxml functions genxml() genxmlelem() genxmlqueryhdr() XSLT4C Processor XML4C Parser ICU Informix Dynamic Server XSLT4C and XML4C