简体   繁体   中英

Setting string value through substring operator in Informix?

I have to migrate an Informix DB to PostgreSQL DB and I'm looking for the documentation of a function, but I can't find anything.

My Issue - I have this line of Informix SQL:

update tab1 set mycolumn[7, 10] = "abcd";

I assume mycolumn gets the "abcd" from character position 7 to 10 and the rest of mycolumn remains untouched. But I have to verify it; that's the reason, why I need the documentation. Original IBM documentation would be the best.

From the IBM Informix 14.10 documentation for the UPDATE SQL statement follow the links for the SET Clause and then Single-Column Format and Expression where there is a link to the Column Expressions . On that page is a description for the [first, last] syntax which is described as an Informix extension.

Here is an example:

create table tab1(mycolumn char(12));
insert into tab1 values("123456789abc");
update tab1 set mycolumn[7,10] = "ABCD";
select * from tab1;

with the result:

mycolumn

123456ABCDbc

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM