× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



This is a multipart message in MIME format.
--
[ Picked text/plain from multipart/alternative ]
One update:

update rob/casetest
set testfld=
case
when substr(testfld,1,3)='300'
 then ('400' || substr(testfld,4,7))
when substr(testfld,1,3)='310'
 then ('410' || substr(testfld,4,7))
else
 testfld
end

Previously I forgot the 'else'.  I didn't fail in my earlier test because
I had all records covered.  But when I added a record that didn't meet the
when's it horfed.  The else fixed it.

This SQL allows you to update a file in one pass.  If it is a large file,
this may be significant.

Rob Berendt
--
"They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety."
Benjamin Franklin




rob@dekko.com
Sent by: midrange-l-admin@midrange.com
04/18/2002 08:33 AM
Please respond to midrange-l


        To:     midrange-l@midrange.com
        cc:
        Fax to:
        Subject:        Re: SQL Update ?


This is a multipart message in MIME format.
--
[ Picked text/plain from multipart/alternative ]
select * from rob/casetest

KEYFLD  TESTFLD
  A     300-12
  B     310-23

update rob/casetest
set testfld=
case
when substr(testfld,1,3)='300'
 then ('400' || substr(testfld,4,7))
when substr(testfld,1,3)='310'
 then ('410' || substr(testfld,4,7))
end

select * from rob/casetest
KEYFLD  TESTFLD
  A     400-12
  B     410-23


Rob Berendt
--
"They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety."
Benjamin Franklin




Mike.Collins@syan.co.uk
Sent by: midrange-l-admin@midrange.com
04/18/2002 08:04 AM
Please respond to midrange-l


        To:     midrange-l@midrange.com
        cc:
        Fax to:
        Subject:        Re: SQL Update ?



You can certainly do it one at a time:

UPDATE myfile SET myfield = '341' || substr(myfield,4,14)
WHERE substr(myfield,1,3) = '300'

_______________________________________________
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/midrange-l
or email: MIDRANGE-L-request@midrange.com
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.



_______________________________________________
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/midrange-l
or email: MIDRANGE-L-request@midrange.com
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.





As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.