?
Solved

Simple Oracle Update Syntax

Posted on 2008-06-23
3
Medium Priority
?
863 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 16

Accepted Solution

by:
Milleniumaire earned 2000 total points
ID: 21845236
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
ID: 21845268
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
ID: 21845763
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
Suggested Courses

765 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