Join IIUG
 for   
 

Informix News
18 Nov 13 - ZDNet - Top 20 mobile skills in demand... Read
09 Sep 13 - telecompaper - Shaspa and Tatung have shown a new smart home platform at Ifa in Berlin. Powered by the IBM Informix software... Read
06 Sep 13 - IBM data magazine - Mission Accomplished - Miami, Florida will be the backdrop for the 2014 IIUG Informix Conference... Read
01 Feb 13 - IBM Data Magazine - Are your database backups safe? Lester Knutsen (IBM Champion) writes about database back up safety using "archecker"... Read
14 Nov 12 - IBM - IBM's Big Data For Smart Grid Goes Live In Texas... Read
3 Oct 12 - The Financial - IBM and TransWorks Collaborate to Help Louisiana-Pacific Corporation Achieve Supply Chain Efficiency... Read
28 Aug 12 - techCLOUD9 - Splunk kicks up a SaaS Storm... Read
10 Aug 12 - businessCLOUD9 - Is this the other half of Cloud monitoring?... Read
3 Aug 12 - IBM data management - Supercharging the data warehouse while keeping costs down IBM Informix Warehouse Accelerator (IWA) delivers superior performance for in-memory analytics processing... Read
2 Aug 12 - channelbiz - Oninit Group launches Pay Per Pulse cloud-based service... Read
28 May 12 - Bloor - David Norfolk on the recent Informix benchmark "pretty impressive results"... Read
23 May 12 - DBTA - Informix Genero: A Way to Modernize Informix 4GL Applications... Read
9 Apr 12 - Mastering Data Management - Upping the Informix Ante: Advanced Data Tools... Read
22 Mar 12 - developerWorks - Optimizing Informix database access... Read
14 Mar 12 - BernieSpang.com - International Informix User Group set to meet in San Diego... Read
1 Mar 12 - IBM Data Management - IIUG Heads West for 2012 - Get ready for sun and sand in San Diego... Read
1 Mar 12 - IBM Data Management - Running Informix on Solid-State Drives.Speed Up Database Access... Read
26 Feb 12 - BernieSpan.com - Better results, lower cost for a broad set of new IBM clients and partners... Read
24 Feb 12 - developerWorks - Informix Warehouse Accelerator: Continuous Acceleration during Data Refresh... Read
6 Feb 12 - PRLOG - Informix port delivers unlimited database scalability for popular SaaS application ... Read
2 Feb 12 - developerWorks - Loading data with the IBM Informix TimeSeries Plug-in for Data Studio... Read
1 Feb 12 - developerWorks - 100 Tech Tips, #47: Log-in to Fix Central... Read
13 Jan 12 - MC Press online - Informix Dynamic Server Entices New Users with Free Production Edition ... Read
11 Jan 12 - Computerworld - Ecologic Analytics and Landis+Gyr -- Suitors Decide to Tie the Knot... Read
9 Jan 12 - planetIDS.com - DNS impact on Informix / Impacto do DNS no Informix... Read
8 Sep 11 - TMCnet.com - IBM Offers Database Solution to Enable Smart Meter Data Capture... Read
1 Aug 11 - IBM Data Management Magazine - IIUG user view: Happy 10th anniversary to IBM and Informix... Read
8 Jul 11 - Database Trends and Applications - Managing Time Series Data with Informix... Read
31 May 11 - Smart Grid - The meter data management pitfall utilities are overlooking... Read
27 May 11 - IBM Data Management Magazine - IIUG user view: Big data, big time ( Series data, warehouse acceleration, and 4GLs )... Read
16 May 11 - Business Wire - HiT Software Announces DBMoto for Enterprise Integration, Adds Informix. Log-based Change Data Capture... Read
21 Mar 11 - Yahoo! Finance - IBM and Cable&Wireless Worldwide Announce UK Smart Energy Cloud... Read
14 Mar 11 - MarketWatch - Fuzzy Logix and IBM Unveil In-Database Analytics for IBM Informix... Read
11 Mar 11 - InvestorPlace - It's Time to Give IBM Props: How many tech stocks are up 53% since the dot-com boom?... Read
9 Mar 11 - DBTA - Database Administration and the Goal of Diminishing Downtime... Read
2 Feb 11 - DBTAs - Informix 11.7 Flexible Grid Provides a Different Way of Looking at Database Servers... Read
27 Jan 11 - exactsolutions - Exact to Add Informix Support to Database Replay, SQL Monitoring Solutions... Read
25 Jan 11 - PR Newswire - Bank of China in the UK Works With IBM to Become a Smarter, Greener Bank... Read
12 Oct 10 - Database Trends and Applications - Informix 11.7: The Beginning of the Next Decade of IBM Informix... Read
20 Sep 10 - planetIDS.com - ITG analyst paper: Cost/Benefit case for IBM Informix as compared to Microsoft SQL Server... Read
20 Jul 10 - IBM Announcements - IBM Informix Choice Edition V11.50 helps deploy low-cost scalable and reliable solutions for Apple Macintosh and Microsoft Windows... Read
20 Jul 10 - IBM Announcements - Software withdrawal: Elite Support for Informix Ultimate-C Edition... Read
24 May 10 - eWeek Europe - IBM Supplies Database Tech For EU Smart Grid... Read
23 May 10 - SiliconIndia - IBM's smart metering system allows wise use of energy... Read
21 May 10 - CNET - IBM to help people monitor energy use... Read
20 May 10 - ebiz - IBM Teams With Hildebrand To Bring Smart Metering To Homes Across Britain... Read
19 May 10 - The New Blog Times - Misurare il consumo energetico: DEHEMS è pronto... Read
19 May 10 - ZDNet - IBM software in your home? Pact enables five-city smart meter pilot in Europe... Read
17 March 10 - ZDNet (blog) David Morgenstern - TCO: New research finds Macs in the enterprise easier, cheaper to manage than... Read
17 March 2010 - Virtualization Review - ...key components of Big Blue's platform to the commercial cloud such as its WebSphere suite of application ser vers and its DB2 and Informix databases... Read
10 February 2010 - The Wall Street Journal - International Business Machines is expanding an initiative to win over students and professors on its products. How do they lure the college crowd?... Read


End of Support Dates

IIUG on Facebook IIUG on Twitter

[ View Thread ] [ Post Response ] [ Return to Index ] [ Read Prev Msg ] [ Read Next Msg ]

IDS Forum

Re: RES: Collation Type doubts

Posted By: John Miller iii
Date: Wednesday, 20 July 2011, at 11:38 a.m.

In Response To: RES: Collation Type doubts (Alberto Romeu Pessonio Filho)

You are probably executing the wrong function. This is generally due t=
o
the implicit cast of data types. What is the column type of descricao?=

If it is not ichar then you have a problem. Try the following:

select * from tbdominiotiss where descricao::ichar like "%procedimento%=
"

If descricao is already an ichar then make sure you dropped the cast wh=
ich
are automatically created when you create an implicit type.

John F. Miller III
STSM, Embedability Architect
miller3@us.ibm.com
503-578-5645
IBM Informix Dynamic Server (IDS)

ids-bounces@iiug.org wrote on 07/20/2011 07:46:00 AM:

> From: "Alberto Romeu Pessonio Filho" <arfilho@orizonbrasil.com.br>
> To: ids@iiug.org
> Date: 07/20/2011 07:46 AM
> Subject: RES: Collation Type doubts [24412]
> Sent by: ids-bounces@iiug.org
>
> Hi John!!!
>
> Im my case, I've created the function that you sent me and the functi=
on
is
> working exactly like the function "LIKE".
>
> Look the examples:
>
> Table tbdominiotiss:
>
> I need to return 174 rows with this words in case sensitive:
>
> select * from tbdominiotiss where descricao like '%procedimento%'
> union all
> select * from tbdominiotiss where descricao like '%Procedimento%'
> union all
> select * from tbdominiotiss where descricao like '%PROCEDIMENTO%';
>
> When I execute:
> select * from tbdominiotiss where descricao like '%procedimento%';
> returns 113 rows
>
> When I execute:
> select * from tbdominiotiss where descricao like '%Procedimento%';
> returns 61 rows
>
> When I execute:
> select * from tbdominiotiss where descricao like '%PROCEDIMENTO%';
> returns 61 rows
>
> OK... The function was published succesfully, and look the output of =
the
> executions using "matches" function:
>
> When I execute:
> select * from tbdominiotiss where descricao matches "*procedimento*"
> Returns 113 rows
>
> When I execute:
> select * from tbdominiotiss where descricao matches "*Procedimento*"
> Returns 61 rows
>
> The expected result must be 174 rows for any query using matches, ins=
't
it?
>
> Tks,
> Alberto.
>
> -----Mensagem original-----
> De: ids-bounces@iiug.org [mailto:ids-bounces@iiug.org] Em nome de Joh=
n
Miller
> iii
> Enviada em: ter=E7a-feira, 19 de julho de 2011 21:11
> Para: ids@iiug.org
> Assunto: Re: Collation Type doubts [24409]
>
> Here is what you are looking to do. Please check the code for your se=
lf
as
> I
> just threw this together. I did make this a little more complicated a=
s I
> used
> the UDR fast path execute model to exeute the matches code faster. Th=
is
> saves the overhead of the SQL code for simple udr executtion. You can=

> make this run even faster by saving the handle to the udr in session
memory
> the first time and not retrieving it on every evaluation, but that is=

> another
> exercise.
>
> Of course you can just move to version 11.70 and all this is already
there
> -:)
>
> drop database if exists d1;
>
> create database d1 with log;
> {*
> **********************************
> **** TIME ZONE ****
> ***********************************
> *}
>
> CREATE DISTINCT TYPE ichar AS lvarchar;
>
> DROP CAST( lvarchar as ichar );
> DROP CAST( ichar as lvarchar );
>
> CREATE FUNCTION matches(ichar, char(20))
>
> RETURNS BOOLEAN
>
> WITH (NOT VARIANT)
>
> EXTERNAL NAME '$INFORMIXDIR/lib/c_udr_lib.so(jfm_imatch)'
>
> LANGUAGE C;
>
> create table t1
>
> (
>
> c1 serial,
>
> c2 ichar,
>
> c3 lvarchar
>
> );
>
> insert into t1 values (0,"JOHN","John");
> insert into t1 values (0,"MILLER","miller");
> insert into t1 values (0,"JOHN","miller");
>
> select * from t1 where c2 matches "mill*";
>
> {*
> *************************
> **** OUTPUT ******
> *************************
> c1 2
> c2 MILLER
> c3 miller
>
> 1 row(s) retrieved.
>
> *}
>
> mi_boolean
> jfm_imatch(mi_lvarchar *v1,mi_lvarchar *v2, MI_FPARAM *fparam)
> {
>
> mi_string *s1,*s2;
>
> MI_FUNC_DESC *funcdesc=3DNULL;
>
> mi_string funcsig[2*IDENTSIZE+20];
>
> char msg[3*IDENTSIZE+20];
>
> MI_CONNECTION *conn =3D NULL;
>
> MI_DATUM funcresult;
>
> int funcerror;
>
> mi_string *str1,*str2;
>
> conn =3D mi_open(NULL, NULL, NULL);
>
> if (conn =3D=3D NULL)
>
> mi_db_error_raise(NULL, MI_EXCEPTION, "Bad connection");
>
> if ( mi_switch_mem_duration(PER_ROUTINE) =3D=3D MI_ERROR ||
>
> mi_fp_argisnull(fparam,0) =3D=3D MI_TRUE ||
>
> mi_fp_argisnull(fparam,1) =3D=3D MI_TRUE ||
>
> ( s1 =3D mi_lvarchar_to_string(v1)) =3D=3D NULL ||
>
> ( s2 =3D mi_lvarchar_to_string(v2)) =3D=3D NULL )
>
> {
>
> mi_fp_setreturnisnull(fparam, 0 , MI_TRUE);
>
> return 0;
>
> }
>
> rdownshift(s1);
>
> rdownshift(s2);
>
> str1 =3D mi_string_to_lvarchar(s1);
>
> str2 =3D mi_string_to_lvarchar(s2);
>
> if ( str1=3D=3DNULL || str2 =3D=3D NULL )
>
> mi_db_error_raise(NULL, MI_EXCEPTION, "Out of memory.");
>
> sprintf(funcsig, "matches(lvarchar,lvarchar)");
>
> if((funcdesc=3Dmi_routine_get(conn, 0, funcsig)) =3D=3D (MI_FUNC_DESC=
*)NULL)
>
> {
>
> snprintf(msg, sizeof(msg),"Unable to find routine [%s].",funcsig);
>
> mi_db_error_raise(NULL, MI_EXCEPTION, msg);
>
> }
>
> /* =3D=3D=3D=3D=3D 3. Execute the function */
>
> funcresult =3D mi_routine_exec(conn, funcdesc, &funcerror, str1, str2=
);
>
> if (funcerror =3D=3D MI_ERROR)
>
> {
>
> if (funcdesc) mi_routine_end(conn, funcdesc);
>
> snprintf(msg, sizeof(msg), "Unable to execute function [ %s ] ",
> funcsig);
>
> mi_db_error_raise(NULL, MI_EXCEPTION, msg);
>
> }
>
> if (funcdesc) mi_routine_end(conn, funcdesc);
>
> return (mi_boolean)funcresult;
> }
>
> John F. Miller III
> STSM, Embedability Architect
> miller3@us.ibm.com
> 503-578-5645
> IBM Informix Dynamic Server (IDS)
>
> ids-bounces@iiug.org wrote on 07/19/2011 05:38:32 AM:
>
> > From: "ALBERTO ROMEU PESSONIO FILHO" <arfilho@orizonbrasil.com.br>
> > To: ids@iiug.org
> > Date: 07/19/2011 05:39 AM
> > Subject: Re: Collation Type doubts [24405]
> > Sent by: ids-bounces@iiug.org
> >
> > Hi John!
> >
> > I've found your C sample code. Check if is this code:
> >
> > mi_integer
> >
> > jfm_icompare(mi_lvarchar *v1,mi_lvarchar *v2,MI_FPARAM *fparam) {
> >
> > mi_string *s1,*s2;
> >
> > if ( mi_switch_mem_duration(PER_ROUTINE)=3D=3DMI_ERROR ||
> >
> > ( s1 =3D mi_lvarchar_to_string(v1)) =3D=3D NULL ||
> >
> > ( s2 =3D mi_lvarchar_to_string(v2)) =3D=3D NULL )
> >
> > {
> >
> > mi_fp_setreturnisnull(fparam, 0 , MI_TRUE);
> >
> > return 0;
> >
> > }
> >
> > return strcasecmp(s1,s2);
> > }
> >
> > mi_boolean
> >
> > jfm_iequal(mi_lvarchar *v1,mi_lvarchar *v2, MI_FPARAM *fparam) {
> >
> > return (mi_boolean) (jfm_icompare(v1,v2,fparam)=3D=3D0 ?
> >
> > MI_TRUE : MI_FALSE);
> > }
> > mi_boolean
> >
> > jfm_inotequal(mi_lvarchar *v1,mi_lvarchar *v2, MI_FPARAM *fparam) {=

> >
> > return (mi_boolean) (jfm_icompare(v1,v2,fparam)!=3D0 ?
> >
> > MI_TRUE : MI_FALSE );
> > }
> >
> > Ok... I tested your first example described on the presentation(tha=
t
> seemed
> > more clear to me... lol...) But could you give me an example of how=
can
I
> use
> > that function to transform the string that I gave as an argument in=

case
> > insensitive, based on the query that I listed below?
> >
> > Select * from tbdominiotiss where descricao like '%Procedimento%'
> >
> > I wonder how this is pretty easy for you, but this is my first time=

using
> UDR
> > routines. So please, show me how to use.
> >
> > Thanks in advance,
> > Alberto Pessonio.
> >
> >
> >
>
>
>
***********************************************************************=
********

>
> > Forum Note: Use "Reply" to post a response in the discussion forum.=

> >
>
>
>
***********************************************************************=
********

> Forum Note: Use "Reply" to post a response in the discussion forum.
>
>
>
***********************************************************************=
********

> Forum Note: Use "Reply" to post a response in the discussion forum.=

>=

Messages In This Thread

[ View Thread ] [ Post Response ] [ Return to Index ] [ Read Prev Msg ] [ Read Next Msg ]

IDS Forum is maintained by Administrator with WebBBS 5.12.