Solved

Simple Oracle Update Syntax

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

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

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

If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
Shell script to create broker configuration file using current broker Configuration, solely for purpose of backup on Linux. Script may need to be modified depending on OS-installation. Please deploy and verify the script in a test environment.
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 information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…

733 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