[Show all top banners]

piranha
Replies to this thread:

More by piranha
What people are reading
Subscribers
:: Subscribe
Back to: Computer/IT Refresh page to view new replies
 sql server vs oracle help me
[VIEWED 4184 TIMES]
SAVE! for ease of future access.
Posted on 06-27-08 3:02 PM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

Can anyone help me re write this sql server code into Oracle PL/SQL code.. ...I am using oracle 8i which is quite old and i am not so good in coding.

UPDATE A
 SET STDCOST = B.Cost
  FROM Table_A A
  INNER JOIN Table_B B
  ON (A.ITEM = B.Item) AND (A.Location = B.Location) ;

 

PS: remember syntax (table_a inner join table_b) dont work in 8i

 


 
Posted on 06-30-08 8:41 AM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

Any expert in oracle 8i.


 
Posted on 06-30-08 12:43 PM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

UPDATE A
SET STDCOST = B.Cost
FROM Table_A A, Table_B B WHERE
A.ITEM = B.Item AND A.Location = B.Location;
 
Posted on 06-30-08 1:11 PM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

Thanks gurkha's but that dont seem to work in oracle 8i...maybe that works on higher version..anyone using oracle 8i..this shit is really frustrating.
 
Posted on 06-30-08 1:39 PM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

piranha,

not sure in 8i, but can you try any one of the followings:

UPDATE
(
SELECT
 A.STDCOST A_STDCOST,
 B.COST B_COST
FROM
 Table_A A,
 Table_B B
WHERE
 A.ITEM = B.Item AND
 A.Location = B.Location 
)
SET
 A_STDCOST = B_COST;

(OR)

MERGE INTO Table_A A USING Table_B B
ON (A.ITEM = B.Item AND A.Location = B.Location)
WHEN MATCHED THEN A.STDCOST=B.COST ;

 

 


 
Posted on 06-30-08 3:38 PM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

Thanks pkshr...it might work in later version and might even work in sql server..It dint work in my case...MERGE feature was introduced in 9i so i dint tried at all..maybe someday id use MERGE....thanks for tips ...... was .8i really sucks..

I really appreciate every ones help...even it could not match my solution i think it will be helpful sometime later..coz most of them might work on later versions...

SOLUTION :  I used the cursor , looped and updated the table A...i hope this would work let me know if you have any other suggestions of comment on my solution.I know it takes too long.

declare

CURSOR cur IS SELECT B.cost cost,A.item item,A.loc loc FROM table_a A, table_b B

WHERE A.ITEM = B.Item AND A.LOC = B.Location;

BEGIN

FOR C1 in cur

LOOP

UPDATE TABLE_A

SET STDCOST = c1.Cost

WHERE item = c1.item

AND loc = c1.loc;

END LOOP;

COMMIT;

END;


 
Posted on 07-01-08 9:49 AM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

FYI: Case Statement dont work on PL/SQL of  oracle 8i ..however it can be used with sql..


 
Posted on 07-02-08 7:51 PM     Reply [Subscribe]
Login in to Rate this Post:     0       ?    
 

visist this site

 

www.asp.net

may be this help u..


 


Please Log in! to be able to reply! If you don't have a login, please register here.

YOU CAN ALSO



IN ORDER TO POST!




Within last 200 days
Recommended Popular Threads Controvertial Threads
शीर्षक जे पनि हुन सक्छ।
NRN card pros and cons?
What are your first memories of when Nepal Television Began?
TPS Re-registration
Democrats are so sure Trump will win
TPS Re-registration case still pending ..
Basnet or Basnyat ??
nrn citizenship
Sajha has turned into MAGATs nest
Nas and The Bokas: Coming to a Night Club near you
ChatSansar.com Naya Nepal Chat
डीभी परेन भने खुसि हुनु होस् ! अमेरिकामाधेरै का श्रीमती अर्कैसँग पोइला गएका छन् !
3 most corrupt politicians in the world
अमेरिकामा बस्ने प्राय जस्तो नेपालीहरु सबै मध्यम बर्गीय अथवा माथि (higher than middle class)
if you are in USA illegally and ask for asylum it is legal
Returning to Nepal with us citizenship. Property ownership
Travelling to Nepal - TPS AP- PASSPORT
Top 10 Anti-vaxxers Who Got Owned by COVID
आज बाट तिहारको सेल सकियो
निगुरो थाहा छ ??
Nas and The Bokas: Coming to a Night Club near you
Mr. Dipak Gyawali-ji Talk is Cheap. US sends $ 200 million to Nepal every year.
Harvard Nepali Students Association Blame Israel for hamas terrorist attacks
TPS Update : Jajarkot earthquake
NOTE: The opinions here represent the opinions of the individual posters, and not of Sajha.com. It is not possible for sajha.com to monitor all the postings, since sajha.com merely seeks to provide a cyber location for discussing ideas and concerns related to Nepal and the Nepalis. Please send an email to admin@sajha.com using a valid email address if you want any posting to be considered for deletion. Your request will be handled on a one to one basis. Sajha.com is a service please don't abuse it. - Thanks.

Sajha.com Privacy Policy

Like us in Facebook!

↑ Back to Top
free counters