PL/SQL (MOSC)

MOSC Banner

SQL update assistance needed

edited Jun 3, 2016 5:01AM in PL/SQL (MOSC) 3 commentsAnswered

Trying to remove trailing spaces on four lab instruments from various tables and not sure this is the proper syntax.  Any help would be greatly appreciated.  Thanks

DECLARE
@OldName nvarchar(20);
@NewName nvarchar(20);

BEGIN

SET @OldName := 'PEOptima A ';
SET @NewName := 'PEOptima A';

UPDATE ELM.Instrument SET Instrument=@NewName WHERE Instrument=@OldName;
UPDATE ELM.Batch SET Instrument = @NewName WHERE Instrument = @OldName;
UPDATE ELM.QCAnalysis SET Instrument = @NewName WHERE Instrument = @OldName;
UPDATE ELM.Calibration SET Instrument = @NewName WHERE Instrument = @OldName;
UPDATE ELM.SampleAnalysis SET Instrument = @NewName WHERE Instrument = @OldName;
UPDATE ELM.InstrumentAnalyte SET Instrument = @NewName WHERE Instrument = @OldName;
UPDATE ELM.InstrumentElement SET Instrument =

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center