This is a discussion on Re: dummy update within the Informix forums, part of the Database Server Software category; --> On Wed, 2005-11-16 at 12:28, vasilis wrote: > > unload to "executeme.sql" > > select "update "||x1.tabname||" set "||x2.colname||"="||x2.colname ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| On Wed, 2005-11-16 at 12:28, vasilis wrote: > > unload to "executeme.sql" > > select "update "||x1.tabname||" set "||x2.colname||"="||x2.colname > > ||" where 1=1;--" > > from systables x1, syscolumns x2 > > where x1.tabid = x2.tabid and x1.tabid>=100 > > and x2.colno = 1; > > Good script, but 1-st column is serial type often and you will find > message > " 232: A SERIAL column (....) may not be updated" Indeed, I didn't think about that. Let's use the leftmost non-serial column then: unload to "executeme.sql" select "update "||x1.tabname||" set "||x2.colname||"="||x2.colname ||" where 1=1;--" from systables x1, syscolumns x2 where x1.tabid = x2.tabid and x1.tabid>=100 and x2.colno = ( select min(x3.colno) from syscolumns x3 where x3.tabid = x1.tabid and mod(x3.coltype, 256) not in (6,18) ); -Carsten sending to informix-list |
| Thread Tools | |
| Display Modes | |
|
|