SlideShare a Scribd company logo
New Application Development features in IDS 11.10. Keshava Murthy, Architect, Informix Development [email_address]
SQL Features in IDS v11 Language features Full support for subqueries in FROM clause Optimizer features Index self-join access method Utility Features sysdbopen()/sysdbclose() ADD_MONTHS(), ASCII(), etc., functions New Types and Indices. Node datatype Basic Text Search Index Stored Procedure Enhancements GO TO and LOOP statements XML Support
Language Features Full support for subqueries in FROM Clause Enhancements to distributed queries Trigger Enhancements
Support For Subqueries in FROM Clause SELECT * FROM (SELECT tab1.a, tab2.x, tab2.y FROM tab1, tab2 WHERE tab1.a = tab2.z ORDER BY tab1.b ) vt(va, vb, vc), emptab WHERE vt.va = emptab.id; SELECT * FROM ((SELECT c1,c2 FROM t3) AS vt3(v31,v32) LEFT OUTER JOIN ((SELECT c1,c2 FROM t1) AS vt1(vc1,vc2) LEFT OUTER JOIN   (SELECT c1,c2 FROM t2) AS vt2(vc3,vc4)   ON vt1.vc1 = vt2.vc3) ON vt3.v31 = vt2.vc3); SELECT * FROM table(foo(5)) AS vt(a), tab1 t WHERE vt.a = t.x;
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
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
Optimizer Features Index Self-join Access method Optimizer directives for ANSI joins Improvements to IDS statistics collection Explain enhancements Dynamic explain enhancements Refresher features Subquery flattening View folding More on IDS Redbook
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
Prior Releases Lower Filter c1 >= 1  Upper Filter c1 <= 3 Index Scan Region Eliminated range on c1
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
Optimizer Directives for ANSI Joins Previously ANSI join queries allowed EXPLAIN, AVOID_EXECUTE and FIRST_ROWS/ALL_ROWS IDS v11 Adds Access method directives: FULL, INDEX.. Join method directives: USE_HASH, USE_NL.. Join  Order directive: ORDERED SELECT  --+ FULL(t2), INDEX(t1, t1i1), ORDERED *   FROM  t1 LEFT OUTER JOIN t2 ON (t1.c1=t2.c1 AND t1.c1=2) WHERE t2.c1 IS NOT NULL DIRECTIVES FOLLOWED: FULL ( t2 ) INDEX ( t1 t1i1 ) ORDERED DIRECTIVES NOT FOLLOWED: Estimated Cost: 7 Estimated # of Rows Returned: 1 ...
Improvements to IDS Statistics Collection Automatic creation of distribution on leading key of the index Implicit UPDATE STATISTICS LOW SAMPLING SIZE UPDATE STATISTICS MEDIUM FOR TABLE tab(c1, c2)  SAMPLING SIZE 500  RESOLUTION 2; UPDATE STATISTICS MEDIUM FOR TABLE tab(c1, c2)  SAMPLING SIZE .2  RESOLUTION 2; Additional info in sysdistrib
Explain Enhancements Explain enhancements Query Optimization Time Distributed query support Estimated and Actual cardinalities Controlled by EXPLAIN_STAT Dynamic explain enhancements Prints the location the explain file in online.log Provides any errors while trying to create the file onmode –Y <sid> 0|1|2  [filename] Specify the location of the dynamic explain Specify whether you need query stats
Utility Features New Isolation level: Committed Read  Last Committed Websphere MQ Messaging support Automatic repreparation of SQL statements Named Parameters support for JDBC New functions and expressions Disabling logging for temporary tables. SYSDBOPEN() and SYSDBCLOSE() procedures
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
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
Websphere MQ Messaging Support MQI Connection Queue1 Websphere MQ Informix Dynamic Server Order Entry Application Queue2 Shipping Application MQ Functions and MQ VTI table.
Automatic Re-Preparation of SQL The dreaded -710 error Make -710 disappear fetch open cursor  --  IDS 10 used to raise -710 error.  IDS 11.10 automatically re-prepares and gets new plan for this and subsequent execution.  do something else  -- continuing with create index close  -- continuing with create index fetch CREATE INDEX ONLINE icln ON customers(lname) fetch fetch open cursor; declare cusor on s1;  -- creates and uses the FirstPlan below. Prepare the statement s1; Session2 Session1
Named Parameters Support for JDBC This is an example of implicit positional binding: CallableStatement cstmt = con.prepareCall(&quot;call order_item(?, ?, ?, ?, ?,?, ?)&quot;); // Set parameters (positional notation) cstmt.setInt( 1 , 5739 ); cstmt.setInt( 2 , 8294); cstmt.setString( 6 , &quot;345, University ave.&quot;); cstmt.setInt( 7 , 94303); cstmt.setString( 4 ,&quot;4100 Bohannon Dr.&quot;); cstmt.setInt( 5 , 94025); cstmt.setInt( 3 ,5); // Execute cstmt.execute();
Named Parameters Support for JDBC Here is the same code rewritten using named parameter notation: // Set parameters (named notation) cstmt.setInt(&quot; cust_id &quot;, 5739 ); Chapter 9. SQL Language 275 cstmt.setInt(&quot; item_id &quot;, 8294); cstmt.setString(&quot; shipping_addr &quot;, &quot;345, University ave.&quot;); cstmt.setInt(&quot; shipping_zip &quot;, 94303); cstmt.setString(&quot; billing_addr &quot;,&quot;4100 Bohannon Dr.&quot;); cstmt.setInt(&quot; billing_zip &quot;, 94025); cstmt.setInt(&quot; count &quot;, 5); // Execute cstmt.execute();
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()
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
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
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
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
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
Disabling Logging for Temporary Tables Logging on all temporary tables can be disabled by either of the following two ways: ONCONFIG TEMPTAB_NOLOG  1  # 0 (logging on) is the default value. Dynamically onmode -Wf &quot;TEMPTAB_NOLOG=1&quot; onmode -Wm &quot;TEMPTAB_NOLOG=1&quot;
SYSDBOPEN() and SYSDBCLOSE()  CREATE PROCEDURE  public.sysdbopen (); SET pdqpriority 1; SET ENVIRONMENT OPTCOMPIND '1'; SET ISOLATION COMMITTED READ; SET ENVIRONMENT USELASTCOMMITTED 'ALL'; SYSTEM &quot;echo Logged IN: &quot; || USER || &quot; &quot; || CURRENT || &quot; >> /tmp/mylog&quot;; END PROCEDURE; -- log the entry. CREATE PROCEDURE  public.sysdbclose (); SYSTEM &quot;echo Logged OUT: &quot; || USER || &quot; &quot; || CURRENT || &quot; >> /tmp/mylog&quot;; END PROCEDURE;
New Types and Indices Node Data Type Binary Data Type Basic Text Search Index
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',  &quot;CEO&quot;); INSERT INTO Employees VALUES ('1.1',  &quot;VP1&quot;); INSERT INTO Employees VALUES ('1.1.1',  &quot;Admin for VP1&quot;); INSERT INTO Employees VALUES ('1.2',  &quot;VP2&quot;); INSERT INTO Employees VALUES ('1.2.1',  &quot;Manager1&quot;); INSERT INTO Employees VALUES ('1.2.2',  &quot;Manager2&quot;); INSERT INTO Employees VALUES ('1.2.2.1', &quot;Admin for Manager2&quot;); -- 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
Node Functions Equals NotEqual LessThan LessThanOrEqual GreaterThan GreaterThanOrEqual Compare Increment Length Depth NewLevel GetParent IsParent IsChild Ancestors Graft IsDecendant GetMember
Binary Data Type BINARY18 and BINARYVAR CREATE TABLE bin18_test (int_col INTEGER, bdt_col BINARY18); INSERT INTO bin18_test VALUES (0, '0102'); INSERT INTO bin18_test VALUES (1, '01020304'); CREATE INDEX idx_bin18 ON bin18_test(bdt_col); CREATE INDEX  idx_binvar  ON  bindata(bin_col); Functions on binary types Length() Octet_length() Bit_and() Bit_or() Bit_xor() Bit_complement()
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
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
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,'&quot;java&quot;~10');
Stored Procedure Enhancements GO TO Statement LOOP Statement Stored procedure recompilation
GO TO Statement CREATE PROCEDURE simple_goto(a int) RETURNS int; IF a < 50 THEN GOTO lessval;   -- jump to lessval. END IF; RETURN a * a;  -- return something <<lessval>>   -- define the label lessval RETURN a * -1; END PROCEDURE;
LOOP Statement CREATE PROCEDURE plusnum(a int) RETURNS int; DEFINE x int; LET x = a;  LOOP   -- start the loop LET x = x + 1; IF x < 0 THEN CONTINUE; -- increment until +ve number. ELIF x < 1000 THEN  RETURN x WITH RESUME; -- return and come back. END IF; EXIT LOOP WHEN x = 1000; -- exit loop at 1000. END LOOP;  END PROCEDURE;
LOOP Statement CREATE PROCEDURE sumto_a(a int) RETURNS int; DEFINE x int; DEFINE total int; LET total = 0; FOR x IN (1 TO a)  LOOP   -- start the loop LET total = total + x; END LOOP;  END PROCEDURE;
LOOP Statement CREATE PROCEDURE facto(a int) RETURNS int AS x, int AS factx; DEFINE x,y, factx int; DEFING total int; LET total = 0; LET x = 1; <<main_loop>> WHILE (x <= a)  LOOP  -- start the loop LET factx = 1; <<facto_loop>> FOR y IN (1 TO x) LOOP -- Abruptly stop at 10 EXIT main_loop WHEN x = 10; LET factx = factx * y; END LOOP facto_loop; RETURN x, factx WITH RESUME;  LET X = x+1; END LOOP  main_loop;  END PROCEDURE;
Stored Procedure Recompilation  This is in 10.00.xC7 and 11.10.xC2  Wells Fargo situation -211 error: Cannot read system catalog sysprocplan Happens after altering the table or creating/dropping indices. Also happens if you lock procedure plans when you UPDATE STATISTICS for procedures within BEGIN– COMMIT. Automatic Recompilation Automatically recognize and recompile the required statements  Write back the plan in a separate transaction so the locks are release. Automatically available. Nothing for applications to do.
XML Support XML Publishing functions Genxml Genxmlelem Genxmlschema Genxmlquery genxmlqueryhdr XPath Support Extract ExtractValue ExistsNode IDSXMLParse() function
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
XML Publishing functions SELECT  genxml( ROW(customer_num, fname, lname, address1, city, state, zipcode, phone),  'customer' )  FROM customer WHERE customer_num < 105; genxml  < customer  customer_num=&quot;101&quot; fname=&quot;Ludwig  &quot; lname=&quot;Pauli  &quot; company=&quot;All Sports Supplies &quot; address1=&quot;213 Erstwild Court  &quot; city=&quot;Sunnyvale  &quot; state=&quot;CA&quot; zipcode=&quot;94086&quot; phone=&quot;408-789-8075&quot;/> < customer  customer_num=&quot;102&quot; fname=&quot;Carole  &quot; lname=&quot;Sadler  &quot; company=&quot;Sports Spot  &quot; address1=&quot;785 Geary St  &quot; city=&quot;San Francisco  &quot; state=&quot;CA&quot; zipcode=&quot;94117&quot; phone=&quot;415-822-1289&quot;/> < customer  customer_num=&quot;103&quot; fname=&quot;Philip  &quot; lname=&quot;Currie  &quot; company=&quot;Phil&apos;s Sports  &quot; address1=&quot;654 Poplar  &quot; address2=&quot;P. O. Box 3498  &quot; city=&quot;Palo Alto  &quot; state=&quot;CA&quot; zipcode=&quot;94303&quot; phone=&quot;415-328-4543&quot;/> < customer  customer_num=&quot;104&quot; fname=&quot;Anthony  &quot; lname=&quot;Higgins  &quot; company=&quot;Play Ball!  &quot; address1=&quot;East Shopping Cntr. &quot; address2=&quot;422 Bay Road  &quot; city=&quot;Redwood City  &quot; state=&quot;CA&quot; zipcode =&quot;94026&quot; phone=&quot;415-368-1100&quot;/> 1 row(s) retrieved.
XML Publishing functions EXECUTE FUNCTION  genxmlqueryhdr('manufact_set', 'SELECT * FROM manufact'); (expression) <?xml version=&quot;1.0&quot; encoding=&quot;en_US.819&quot; ?> <xs:schema xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot;> <manufact_set> <row> <manu_code>SMT</manu_code> <manu_name>Smith  </manu_name> <lead_time>  3</lead_time> </row> ...
XPath Support SELECT  extract(booklist, '/bookstore/book[1]') FROM books WHERE bookstore_id =1234; (expression)  <book category=&quot;COOKING&quot;> <title lang=&quot;en&quot;>Everyday Italian</title> <author>Giada De Laurentiis</author> <year>2005</year>  <price>30.00</price> </book>  SELECT  extractvalue(booklist, '/bookstore/book[last()]') FROM books where bookstore_id =1234; (expression)  Learning XML Erik T. Ray 2003 39.95  SELECT docid FROM books  WHERE  existsnode(booklist, '/bookstore/book[author=&quot;Kurt Cagle&quot;]/title') = 1   AND bookstore_id =1234; docid  1
Q & A
Resources Infocentre http://publib.boulder.ibm.com/infocenter/idshelp/v111/index.jsp IDS v11 Redbook http://www.redbooks.ibm.com/abstracts/sg247465.html Keshava Murthy rkeshav@us.ibm.com Thank You

More Related Content

PDF
New Java Date/Time API
DOCX
.net progrmming part2
PDF
Firebird 3 Windows Functions
DOCX
C# console programms
PDF
New SQL Features in Firebird 3, by Vlad Khorsun
DOCX
C# labprograms
PDF
OOP and FP - Become a Better Programmer
PPS
CS101- Introduction to Computing- Lecture 29
New Java Date/Time API
.net progrmming part2
Firebird 3 Windows Functions
C# console programms
New SQL Features in Firebird 3, by Vlad Khorsun
C# labprograms
OOP and FP - Become a Better Programmer
CS101- Introduction to Computing- Lecture 29

What's hot (19)

PDF
SQL Server SQL Server
PDF
From object oriented to functional domain modeling
PPT
JDBC
PPSX
Analytic & Windowing functions in oracle
PDF
DOCX
.net progrmming part3
PDF
Martin Fowler's Refactoring Techniques Quick Reference
PDF
Spark 4th Meetup Londond - Building a Product with Spark
PPT
C++ functions
PPT
Single row functions
PPT
PDF
SQL Functions and Operators
PDF
Isc computer project final upload last
PPT
Grokking Monads in Scala
PDF
DSU C&C++ Practical File Diploma
PDF
Data structure and algorithm.(dsa)
PDF
SQL Macros - Game Changing Feature for SQL Developers?
PDF
Programming Fundamentals Arrays and Strings
SQL Server SQL Server
From object oriented to functional domain modeling
JDBC
Analytic & Windowing functions in oracle
.net progrmming part3
Martin Fowler's Refactoring Techniques Quick Reference
Spark 4th Meetup Londond - Building a Product with Spark
C++ functions
Single row functions
SQL Functions and Operators
Isc computer project final upload last
Grokking Monads in Scala
DSU C&C++ Practical File Diploma
Data structure and algorithm.(dsa)
SQL Macros - Game Changing Feature for SQL Developers?
Programming Fundamentals Arrays and Strings
Ad

Similar to IBM Informix dynamic server 11 10 Cheetah Sql Features (20)

PPT
Advance Features In Procedues And Triggers
PDF
What’s New For SQL Optimization In DB2 9 And DB2 10 For z/OS
PDF
SQL tips and techniques April 2014
PDF
The Top 12 Features new to Oracle 12c
PDF
Time Travelling With DB2 10 For zOS
PDF
Improve speed &amp; performance of informix 11.xx part 1
PDF
Microsoft SQL Server Filtered Indexes & Sparse Columns Feb 2011
PDF
Oracle 12c Application development
PPTX
Sql 2016 - What's New
PPTX
MySQL 8 - UKOUG Techfest Brighton December 2nd, 2019
PDF
MariaDB Server 10.3 - Temporale Daten und neues zur DB-Kompatibilität
PDF
Find it. Fix it. Real-World SQL Tuning Cases with Karen Morton
PPTX
SQL Server 2012 Best Practices
PDF
Temporal And Other DB2 10 For Z Os Highlights
PPT
Mssql
PPT
Sql server introduction to sql server
PPT
MS SQL Server.ppt
PPT
12c Database new features
PPTX
Sql server
PDF
Advance Features In Procedues And Triggers
What’s New For SQL Optimization In DB2 9 And DB2 10 For z/OS
SQL tips and techniques April 2014
The Top 12 Features new to Oracle 12c
Time Travelling With DB2 10 For zOS
Improve speed &amp; performance of informix 11.xx part 1
Microsoft SQL Server Filtered Indexes & Sparse Columns Feb 2011
Oracle 12c Application development
Sql 2016 - What's New
MySQL 8 - UKOUG Techfest Brighton December 2nd, 2019
MariaDB Server 10.3 - Temporale Daten und neues zur DB-Kompatibilität
Find it. Fix it. Real-World SQL Tuning Cases with Karen Morton
SQL Server 2012 Best Practices
Temporal And Other DB2 10 For Z Os Highlights
Mssql
Sql server introduction to sql server
MS SQL Server.ppt
12c Database new features
Sql server
Ad

More from Keshav Murthy (20)

PDF
N1QL New Features in couchbase 7.0
PPTX
Couchbase Tutorial: Big data Open Source Systems: VLDB2018
PPTX
N1QL+GSI: Language and Performance Improvements in Couchbase 5.0 and 5.5
PPTX
XLDB Lightning Talk: Databases for an Engaged World: Requirements and Design...
PDF
Couchbase 5.5: N1QL and Indexing features
PPTX
N1QL: Query Optimizer Improvements in Couchbase 5.0. By, Sitaram Vemulapalli
PPTX
Couchbase N1QL: Language & Architecture Overview.
PPTX
Couchbase Query Workbench Enhancements By Eben Haber
PPTX
Mindmap: Oracle to Couchbase for developers
PPTX
Couchbase N1QL: Index Advisor
PPTX
N1QL: What's new in Couchbase 5.0
PPTX
From SQL to NoSQL: Structured Querying for JSON
PPTX
Tuning for Performance: indexes & Queries
PPTX
Understanding N1QL Optimizer to Tune Queries
PPTX
Utilizing Arrays: Modeling, Querying and Indexing
PPTX
Extended JOIN in Couchbase Server 4.5
PPTX
Bringing SQL to NoSQL: Rich, Declarative Query for NoSQL
PPTX
Query in Couchbase. N1QL: SQL for JSON
PPTX
SQL for JSON: Rich, Declarative Querying for NoSQL Databases and Applications 
PPTX
Introducing N1QL: New SQL Based Query Language for JSON
N1QL New Features in couchbase 7.0
Couchbase Tutorial: Big data Open Source Systems: VLDB2018
N1QL+GSI: Language and Performance Improvements in Couchbase 5.0 and 5.5
XLDB Lightning Talk: Databases for an Engaged World: Requirements and Design...
Couchbase 5.5: N1QL and Indexing features
N1QL: Query Optimizer Improvements in Couchbase 5.0. By, Sitaram Vemulapalli
Couchbase N1QL: Language & Architecture Overview.
Couchbase Query Workbench Enhancements By Eben Haber
Mindmap: Oracle to Couchbase for developers
Couchbase N1QL: Index Advisor
N1QL: What's new in Couchbase 5.0
From SQL to NoSQL: Structured Querying for JSON
Tuning for Performance: indexes & Queries
Understanding N1QL Optimizer to Tune Queries
Utilizing Arrays: Modeling, Querying and Indexing
Extended JOIN in Couchbase Server 4.5
Bringing SQL to NoSQL: Rich, Declarative Query for NoSQL
Query in Couchbase. N1QL: SQL for JSON
SQL for JSON: Rich, Declarative Querying for NoSQL Databases and Applications 
Introducing N1QL: New SQL Based Query Language for JSON

Recently uploaded (20)

PPTX
Amazon (Business Studies) management studies
PDF
MSPs in 10 Words - Created by US MSP Network
PDF
Lecture 3 - Risk Management and Compliance.pdf
PDF
Types of control:Qualitative vs Quantitative
PPTX
Presentation model for business presentations
PDF
The FMS General Management Prep-Book 2025.pdf
PDF
Leading with Vision_ How Mohit Bansal Is Shaping Chandigarh’s Real Estate Ren...
PPTX
ICG2025_ICG 6th steering committee 30-8-24.pptx
PDF
The Digital Culture Challenge; Bridging the Employee-Leadership Disconnect
PDF
KornFerry Presentation hbkjbkjbk bjkbkbk.pdf
PPTX
HR Introduction Slide (1).pptx on hr intro
PPTX
5 Stages of group development guide.pptx
PDF
HOT DAY CAFE , Café Royale isn’t just another coffee shop
PDF
A Brief Introduction About Julia Allison
PPTX
Untitled presentation (2).quiz presention
PDF
Reconciliation AND MEMORANDUM RECONCILATION
PPTX
AI-assistance in Knowledge Collection and Curation supporting Safe and Sustai...
PDF
Business model innovation report 2022.pdf
PDF
A Brief Introduction About - Stacey Soans
PDF
Dr. Enrique Segura Ense Group - A Self-Made Entrepreneur And Executive
Amazon (Business Studies) management studies
MSPs in 10 Words - Created by US MSP Network
Lecture 3 - Risk Management and Compliance.pdf
Types of control:Qualitative vs Quantitative
Presentation model for business presentations
The FMS General Management Prep-Book 2025.pdf
Leading with Vision_ How Mohit Bansal Is Shaping Chandigarh’s Real Estate Ren...
ICG2025_ICG 6th steering committee 30-8-24.pptx
The Digital Culture Challenge; Bridging the Employee-Leadership Disconnect
KornFerry Presentation hbkjbkjbk bjkbkbk.pdf
HR Introduction Slide (1).pptx on hr intro
5 Stages of group development guide.pptx
HOT DAY CAFE , Café Royale isn’t just another coffee shop
A Brief Introduction About Julia Allison
Untitled presentation (2).quiz presention
Reconciliation AND MEMORANDUM RECONCILATION
AI-assistance in Knowledge Collection and Curation supporting Safe and Sustai...
Business model innovation report 2022.pdf
A Brief Introduction About - Stacey Soans
Dr. Enrique Segura Ense Group - A Self-Made Entrepreneur And Executive

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. SQL Features in IDS v11 Language features Full support for subqueries in FROM clause Optimizer features Index self-join access method Utility Features sysdbopen()/sysdbclose() ADD_MONTHS(), ASCII(), etc., functions New Types and Indices. Node datatype Basic Text Search Index Stored Procedure Enhancements GO TO and LOOP statements XML Support
  • 3. Language Features Full support for subqueries in FROM Clause Enhancements to distributed queries Trigger Enhancements
  • 4. Support For Subqueries in FROM Clause SELECT * FROM (SELECT tab1.a, tab2.x, tab2.y FROM tab1, tab2 WHERE tab1.a = tab2.z ORDER BY tab1.b ) vt(va, vb, vc), emptab WHERE vt.va = emptab.id; SELECT * FROM ((SELECT c1,c2 FROM t3) AS vt3(v31,v32) LEFT OUTER JOIN ((SELECT c1,c2 FROM t1) AS vt1(vc1,vc2) LEFT OUTER JOIN (SELECT c1,c2 FROM t2) AS vt2(vc3,vc4) ON vt1.vc1 = vt2.vc3) ON vt3.v31 = vt2.vc3); SELECT * FROM table(foo(5)) AS vt(a), tab1 t WHERE vt.a = t.x;
  • 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. Optimizer Features Index Self-join Access method Optimizer directives for ANSI joins Improvements to IDS statistics collection Explain enhancements Dynamic explain enhancements Refresher features Subquery flattening View folding More on IDS Redbook
  • 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. Optimizer Directives for ANSI Joins Previously ANSI join queries allowed EXPLAIN, AVOID_EXECUTE and FIRST_ROWS/ALL_ROWS IDS v11 Adds Access method directives: FULL, INDEX.. Join method directives: USE_HASH, USE_NL.. Join Order directive: ORDERED SELECT --+ FULL(t2), INDEX(t1, t1i1), ORDERED * FROM t1 LEFT OUTER JOIN t2 ON (t1.c1=t2.c1 AND t1.c1=2) WHERE t2.c1 IS NOT NULL DIRECTIVES FOLLOWED: FULL ( t2 ) INDEX ( t1 t1i1 ) ORDERED DIRECTIVES NOT FOLLOWED: Estimated Cost: 7 Estimated # of Rows Returned: 1 ...
  • 12. Improvements to IDS Statistics Collection Automatic creation of distribution on leading key of the index Implicit UPDATE STATISTICS LOW SAMPLING SIZE UPDATE STATISTICS MEDIUM FOR TABLE tab(c1, c2) SAMPLING SIZE 500 RESOLUTION 2; UPDATE STATISTICS MEDIUM FOR TABLE tab(c1, c2) SAMPLING SIZE .2 RESOLUTION 2; Additional info in sysdistrib
  • 13. Explain Enhancements Explain enhancements Query Optimization Time Distributed query support Estimated and Actual cardinalities Controlled by EXPLAIN_STAT Dynamic explain enhancements Prints the location the explain file in online.log Provides any errors while trying to create the file onmode –Y <sid> 0|1|2 [filename] Specify the location of the dynamic explain Specify whether you need query stats
  • 14. Utility Features New Isolation level: Committed Read Last Committed Websphere MQ Messaging support Automatic repreparation of SQL statements Named Parameters support for JDBC New functions and expressions Disabling logging for temporary tables. SYSDBOPEN() and SYSDBCLOSE() procedures
  • 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. Automatic Re-Preparation of SQL The dreaded -710 error Make -710 disappear fetch open cursor -- IDS 10 used to raise -710 error. IDS 11.10 automatically re-prepares and gets new plan for this and subsequent execution. do something else -- continuing with create index close -- continuing with create index fetch CREATE INDEX ONLINE icln ON customers(lname) fetch fetch open cursor; declare cusor on s1; -- creates and uses the FirstPlan below. Prepare the statement s1; Session2 Session1
  • 19. Named Parameters Support for JDBC This is an example of implicit positional binding: CallableStatement cstmt = con.prepareCall(&quot;call order_item(?, ?, ?, ?, ?,?, ?)&quot;); // Set parameters (positional notation) cstmt.setInt( 1 , 5739 ); cstmt.setInt( 2 , 8294); cstmt.setString( 6 , &quot;345, University ave.&quot;); cstmt.setInt( 7 , 94303); cstmt.setString( 4 ,&quot;4100 Bohannon Dr.&quot;); cstmt.setInt( 5 , 94025); cstmt.setInt( 3 ,5); // Execute cstmt.execute();
  • 20. Named Parameters Support for JDBC Here is the same code rewritten using named parameter notation: // Set parameters (named notation) cstmt.setInt(&quot; cust_id &quot;, 5739 ); Chapter 9. SQL Language 275 cstmt.setInt(&quot; item_id &quot;, 8294); cstmt.setString(&quot; shipping_addr &quot;, &quot;345, University ave.&quot;); cstmt.setInt(&quot; shipping_zip &quot;, 94303); cstmt.setString(&quot; billing_addr &quot;,&quot;4100 Bohannon Dr.&quot;); cstmt.setInt(&quot; billing_zip &quot;, 94025); cstmt.setInt(&quot; count &quot;, 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. Disabling Logging for Temporary Tables Logging on all temporary tables can be disabled by either of the following two ways: ONCONFIG TEMPTAB_NOLOG 1 # 0 (logging on) is the default value. Dynamically onmode -Wf &quot;TEMPTAB_NOLOG=1&quot; onmode -Wm &quot;TEMPTAB_NOLOG=1&quot;
  • 28. SYSDBOPEN() and SYSDBCLOSE() CREATE PROCEDURE public.sysdbopen (); SET pdqpriority 1; SET ENVIRONMENT OPTCOMPIND '1'; SET ISOLATION COMMITTED READ; SET ENVIRONMENT USELASTCOMMITTED 'ALL'; SYSTEM &quot;echo Logged IN: &quot; || USER || &quot; &quot; || CURRENT || &quot; >> /tmp/mylog&quot;; END PROCEDURE; -- log the entry. CREATE PROCEDURE public.sysdbclose (); SYSTEM &quot;echo Logged OUT: &quot; || USER || &quot; &quot; || CURRENT || &quot; >> /tmp/mylog&quot;; END PROCEDURE;
  • 29. New Types and Indices Node Data Type Binary Data Type Basic Text Search Index
  • 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', &quot;CEO&quot;); INSERT INTO Employees VALUES ('1.1', &quot;VP1&quot;); INSERT INTO Employees VALUES ('1.1.1', &quot;Admin for VP1&quot;); INSERT INTO Employees VALUES ('1.2', &quot;VP2&quot;); INSERT INTO Employees VALUES ('1.2.1', &quot;Manager1&quot;); INSERT INTO Employees VALUES ('1.2.2', &quot;Manager2&quot;); INSERT INTO Employees VALUES ('1.2.2.1', &quot;Admin for Manager2&quot;); -- 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. Node Functions Equals NotEqual LessThan LessThanOrEqual GreaterThan GreaterThanOrEqual Compare Increment Length Depth NewLevel GetParent IsParent IsChild Ancestors Graft IsDecendant GetMember
  • 32. Binary Data Type BINARY18 and BINARYVAR CREATE TABLE bin18_test (int_col INTEGER, bdt_col BINARY18); INSERT INTO bin18_test VALUES (0, '0102'); INSERT INTO bin18_test VALUES (1, '01020304'); CREATE INDEX idx_bin18 ON bin18_test(bdt_col); CREATE INDEX idx_binvar ON bindata(bin_col); Functions on binary types Length() Octet_length() Bit_and() Bit_or() Bit_xor() Bit_complement()
  • 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,'&quot;java&quot;~10');
  • 36. Stored Procedure Enhancements GO TO Statement LOOP Statement Stored procedure recompilation
  • 37. GO TO Statement CREATE PROCEDURE simple_goto(a int) RETURNS int; IF a < 50 THEN GOTO lessval; -- jump to lessval. END IF; RETURN a * a; -- return something <<lessval>> -- define the label lessval RETURN a * -1; END PROCEDURE;
  • 38. LOOP Statement CREATE PROCEDURE plusnum(a int) RETURNS int; DEFINE x int; LET x = a; LOOP -- start the loop LET x = x + 1; IF x < 0 THEN CONTINUE; -- increment until +ve number. ELIF x < 1000 THEN RETURN x WITH RESUME; -- return and come back. END IF; EXIT LOOP WHEN x = 1000; -- exit loop at 1000. END LOOP; END PROCEDURE;
  • 39. LOOP Statement CREATE PROCEDURE sumto_a(a int) RETURNS int; DEFINE x int; DEFINE total int; LET total = 0; FOR x IN (1 TO a) LOOP -- start the loop LET total = total + x; END LOOP; END PROCEDURE;
  • 40. LOOP Statement CREATE PROCEDURE facto(a int) RETURNS int AS x, int AS factx; DEFINE x,y, factx int; DEFING total int; LET total = 0; LET x = 1; <<main_loop>> WHILE (x <= a) LOOP -- start the loop LET factx = 1; <<facto_loop>> FOR y IN (1 TO x) LOOP -- Abruptly stop at 10 EXIT main_loop WHEN x = 10; LET factx = factx * y; END LOOP facto_loop; RETURN x, factx WITH RESUME; LET X = x+1; END LOOP main_loop; END PROCEDURE;
  • 41. Stored Procedure Recompilation This is in 10.00.xC7 and 11.10.xC2 Wells Fargo situation -211 error: Cannot read system catalog sysprocplan Happens after altering the table or creating/dropping indices. Also happens if you lock procedure plans when you UPDATE STATISTICS for procedures within BEGIN– COMMIT. Automatic Recompilation Automatically recognize and recompile the required statements Write back the plan in a separate transaction so the locks are release. Automatically available. Nothing for applications to do.
  • 42. XML Support XML Publishing functions Genxml Genxmlelem Genxmlschema Genxmlquery genxmlqueryhdr XPath Support Extract ExtractValue ExistsNode IDSXMLParse() function
  • 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
  • 44. XML Publishing functions SELECT genxml( ROW(customer_num, fname, lname, address1, city, state, zipcode, phone), 'customer' ) FROM customer WHERE customer_num < 105; genxml < customer customer_num=&quot;101&quot; fname=&quot;Ludwig &quot; lname=&quot;Pauli &quot; company=&quot;All Sports Supplies &quot; address1=&quot;213 Erstwild Court &quot; city=&quot;Sunnyvale &quot; state=&quot;CA&quot; zipcode=&quot;94086&quot; phone=&quot;408-789-8075&quot;/> < customer customer_num=&quot;102&quot; fname=&quot;Carole &quot; lname=&quot;Sadler &quot; company=&quot;Sports Spot &quot; address1=&quot;785 Geary St &quot; city=&quot;San Francisco &quot; state=&quot;CA&quot; zipcode=&quot;94117&quot; phone=&quot;415-822-1289&quot;/> < customer customer_num=&quot;103&quot; fname=&quot;Philip &quot; lname=&quot;Currie &quot; company=&quot;Phil&apos;s Sports &quot; address1=&quot;654 Poplar &quot; address2=&quot;P. O. Box 3498 &quot; city=&quot;Palo Alto &quot; state=&quot;CA&quot; zipcode=&quot;94303&quot; phone=&quot;415-328-4543&quot;/> < customer customer_num=&quot;104&quot; fname=&quot;Anthony &quot; lname=&quot;Higgins &quot; company=&quot;Play Ball! &quot; address1=&quot;East Shopping Cntr. &quot; address2=&quot;422 Bay Road &quot; city=&quot;Redwood City &quot; state=&quot;CA&quot; zipcode =&quot;94026&quot; phone=&quot;415-368-1100&quot;/> 1 row(s) retrieved.
  • 45. XML Publishing functions EXECUTE FUNCTION genxmlqueryhdr('manufact_set', 'SELECT * FROM manufact'); (expression) <?xml version=&quot;1.0&quot; encoding=&quot;en_US.819&quot; ?> <xs:schema xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot;> <manufact_set> <row> <manu_code>SMT</manu_code> <manu_name>Smith </manu_name> <lead_time> 3</lead_time> </row> ...
  • 46. XPath Support SELECT extract(booklist, '/bookstore/book[1]') FROM books WHERE bookstore_id =1234; (expression) <book category=&quot;COOKING&quot;> <title lang=&quot;en&quot;>Everyday Italian</title> <author>Giada De Laurentiis</author> <year>2005</year> <price>30.00</price> </book> SELECT extractvalue(booklist, '/bookstore/book[last()]') FROM books where bookstore_id =1234; (expression) Learning XML Erik T. Ray 2003 39.95 SELECT docid FROM books WHERE existsnode(booklist, '/bookstore/book[author=&quot;Kurt Cagle&quot;]/title') = 1 AND bookstore_id =1234; docid 1
  • 47. Q & A
  • 48. Resources Infocentre http://publib.boulder.ibm.com/infocenter/idshelp/v111/index.jsp IDS v11 Redbook http://www.redbooks.ibm.com/abstracts/sg247465.html Keshava Murthy [email protected] Thank You