Clicky

Hi Experts,

Hope you can help me out here.I am attempting to update a table value with a value from another table value through an inner join. This is done in the Mimer batch SQL console.

I have tried the usual SQL commands only to get error code 12259.
“UPDATE operation not permitted because the joined table”

Here are some of the commands I have tried. Could someone please help me in the right direction.

UPDATE PBARCMAS SET PBARCMAS.PATIENTNAME = PABRCMAS.PATIENTNAME || ' ' || PBPATMAS.POSTCODE FROM PBARCMAS INNER JOIN PBPATMAS ON PBARCMAS.PATNUMBER = PBPATMAS.PATNUMBER ;
UPDATE PBARCMAS AS A INNER JOIN PBPATMAS AS B ON A.PATNUMBER =  B.PATNUMBER  SET A.PATIENTNAME = A.PATIENTNAME || ' ' || B.POSTCODE ;

Your help is much appreciated.


Sean

asked 11/25/2011 01:10

meperera's gravatar image

meperera ♦♦


2 Answers:
I don't know Mimer SQL, so not sure if it is actually possible.
for other DBMS, here is my article with syntaxes from those (oracle, MySQL, MSSQL, MS access) ...
http://www.qa.downappz.com/A_1517.html
link

answered

angelIII's gravatar image

angelIII

Mimer SQL does not support JOIN in update statements. Try to achieve the desired results using inner query. Following query may work:
UPDATE PBARCMAS SET PBARCMAS.PATIENTNAME = IsNull((SELECT TOP 1 PABRCMAS.PATIENTNAME || ' ' || PBPATMAS.POSTCODE FROM PBARCMAS INNER JOIN PBPATMAS ON PBARCMAS.PATNUMBER = PBPATMAS.PATNUMBER),PBARCMAS.PATIENTNAME)
link

answered 2011-11-26 at 03:36:16

devlab2012's gravatar image

devlab2012

Your answer
[hide preview]

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Tags:

×3
×1
×132
×9

Asked: 11/25/2011 01:10

Seen: 290 times

Last updated: 12/14/2011 11:53