Solved

Simple Oracle Update Syntax

Posted on 2008-06-23
3
856 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
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

I'm trying, I really am. But I've seen so many wrong approaches involving date(time) boundaries I despair about my inability to explain it. I've seen quite a few recently that define a non-leap year as 364 days, or 366 days and the list goes on. …
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 how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
This video shows how to recover a database from a user managed backup

895 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

11 Experts available now in Live!

Get 1:1 Help Now