On 8/26/06, Igor Tandetnik <[EMAIL PROTECTED]> wrote:
rockdawg <[EMAIL PROTECTED]> wrote: > Here are some entries: > > smb://MSHOME;kevin:@Movie-server/D/Gladiator/VIDEO_TS > smb://MSHOME;kevin:@Movie-server/D/Rocky/VIDEO_TS > smb://MSHOME;kevin:@Movie-server/E/Saw/VIDEO_TS > smb://MSHOME;kevin:@Movie-server/F/Analyze This/VIDEO_TS > > Therefore, I need to insert the string > "Movies/" between the strings "/D/" and "/Rocky/" (for example) in > the db so it reads like this: > > smb://MSHOME;kevin:@Movie-server/D/Movies/Rocky/VIDEO_TS > > I have tried this command: > > REPLACE(smb://MSHOME;kevin:@Movie-server/D/Rocky/VIDEO_TS,'D/','D/Movies/') > > But i get an error message. What is the proper syntax for the REPLACE > command in my situation?There ain't no such thing as REPLACE command. You need something like this: update paths set strPaths= substr(strPaths,1,35) || 'Movies/' || substr(strPaths,36,length(strPaths)-35);
Well, actually there is a REPLACE command, sort of a replacement (!) for an INSERT or REPLACE. If the target is present, it is replaced, else a new entry is made. That said, the above suggestion is correct. In this case, REPLACE is inappropriate as replacement of a portion of a column value is required. Substr and Length are your friend. -- Puneet Kishor http://punkish.eidesis.org/ Nelson Inst. for Env. Studies, UW-Madison http://www.ies.wisc.edu/ Open Source Geospatial Foundation https://edu.osgeo.org/ ----------------------------------------------------------------------------- To unsubscribe, send email to [EMAIL PROTECTED] -----------------------------------------------------------------------------

