Solved

Simple Oracle Update Syntax

Posted on 2008-06-23
3
857 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. …
Confronted with some SQL you don't know can be a daunting task. It can be even more daunting if that SQL carries some of the old secret codes used in the Ye Olde query syntax, such as: (+)     as used in Oracle;     *=     =*    as used in Sybase …
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
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

773 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