Solved

Simple Oracle Update Syntax

Posted on 2008-06-23
3
855 Views
Last Modified: 2013-12-18
Can someone please correct the syntax below?   Oracle's SQL Worksheet does not like it....

begin transaction;

update emrcontent.page_images
set emrcontent.page_images.path = '\\OCH52523\D$\AppData\CCMS\PAGES\',
from emrcontent.centera_migration, emrcontent.page_images
 where
 centera_migration.filename = page_images.pagefilename;


update emrcontent.centera_migration
set emrcontent.centera_migration.reindexed = 'Y'
from emrcontent.centera_migration, emrcontent.page_images
 where
 centera_migration.filename = page_images.pagefilename;


end transaction;


Thanks.
0
Comment
Question by:codefinger
  • 2
3 Comments
 
LVL 16

Accepted Solution

by:
Milleniumaire earned 500 total points
Comment Utility
Your update statement syntax is incorrect.

Try the following:

update emrcontent.page_images
set emrcontent.page_images.path = '\\OCH52523\D$\AppData\CCMS\PAGES\',
where page_images.pagefilename in (select centera_migration.filename
                                                             from emrcontent.centera_migration);
 

update emrcontent.centera_migration
set emrcontent.centera_migration.reindexed = 'Y'
where centera_migration.filename in (select page_images.pagefilename
                                                            from emrcontent.page_images);
0
 
LVL 16

Expert Comment

by:Milleniumaire
Comment Utility
Also...

begin transaction;

and

end transaction;

are not valid Oracle statements.  It looks like you're trying to write SQL Server code on an Oracle database.  There's no need to explicitly start and stop a transaction on Oracle as this is done for you.  The commit or rollback statements end the transaction, issuing any sql statement will start it.
0
 
LVL 10

Expert Comment

by:dbmullen
Comment Utility
there is a comma at the end of line 2


update emrcontent.page_images
set emrcontent.page_images.path = '\\OCH52523\D$\AppData\CCMS\PAGES\'        ---  remove this comma  ","
where page_images.pagefilename in (select centera_migration.filename
                                                             from emrcontent.centera_migration);
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
Via a live example, show how to take different types of Oracle backups using RMAN.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now