473,396 Members | 1,666 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

using sql to update a table

**** Post for FREE via your newsreader at post.usenet.com ****

Hello,

I am using sql+ to try and update a table and am having some trouble.

Below is a select statement with the result I want to acheive. I want to
get this result by using update to update my table. I have attempted to
create the update sql statement, see below.

I guess my major problem is concatenating results from the same table into
an update.

I'm new at sql and am wondering if this best be done using plsql?

Any suggestions would be great!

Thanks Julie

________________________select statement ______________________
select a.part_no, a.mat_sfty_data_sht_no || '_' ||b.mat_sfty_data_sht_no as
RESULTS
FROM part_seg_jp a,
part_seg_jp b
where a.part_no = b.part_no
and soundex(a.mat_sfty_data_sht_no) = soundex('K%')
and a.seg_no = 16
and soundex(b.mat_sfty_data_sht_no) != soundex('K%')
and b.seg_no = 11

______________________This is what the sql result is____________________

Part_NO Results

28 K2_SXW
47 K2_SXW
71 K2_SXW

_____________________The update statement________________________

update part_seg_jp b
set b.mat_sfty_data_sht_no = mat_sfty_data_sht_no || '_' ||
b.mat_sfty_data_sht_no
where mat_sfty_data_sht_no in (select a.mat_sfty_data_sht_no
FROM part_seg_jp a
WHERE soundex(a.mat_sfty_data_sht_no) = soundex('K%')
and a.seg_no = '16'
and a.mat_sfty_data_sht_no != 'NULL')
and b.mat_sfty_data_sht_no not like '%K%'
and b.seg_no = '11'

______________________The update result_____________________

0 rows updated.



-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
*** Usenet.com - The #1 Usenet Newsgroup Service on The Planet! ***
http://www.usenet.com
Unlimited Download - 19 Seperate Servers - 90,000 groups - Uncensored
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Jul 19 '05 #1
0 2827

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: banz | last post by:
Hello I have a problem to resolve: I wrote a Perlscript which caches data from a server (local on my machine) I would like to have a other connection to a remote server but I don't know how to...
3
by: GL | last post by:
Hi, Is there a way to add a field to an existing table using a query of some sort (without needing to manually add a field to the table). I know how to do it with a make table query, but I have...
1
by: Bennett Haselton | last post by:
Suppose I add a new row to a table in a dataset, and then I use an OleDbDataAdapter to add that new row to a SQL Server database using OleDbDataAdapter.Update(), as in the following code: ...
1
by: Robert Fitzpatrick | last post by:
I am running PostgreSQL 7.4.5 and have a trigger on a table called tblriskassessors which inserts, updates or delete a corresponding record in tblinspectors by lookup of a contact id and license...
4
by: fmatamoros | last post by:
I sometimes get the following error from an update statement in a stored procedure: Transaction (Process ID 62) was deadlocked on thread | communication buffer resources with another process and...
7
by: Serge Rielau | last post by:
Hi all, Following Ian's passionate postings on problems with ALTOBJ and the alter table wizard in the control center I'll try to explain how to use ALTOBJ with this thread. I'm not going to get...
16
by: Ian Davies | last post by:
Hello Needing help with a suitable solution. I have extracted records into a table under three columns 'category', 'comment' and share (the category column also holds the index no of the record...
1
by: TonyJ | last post by:
Hello! I trying to update a table using sql server but no update will be done. I don't get any error at all. Here is an extract from the code. Does this seems to be right.
1
by: adithi | last post by:
My Table Structure is: Table A Table B Table C colA -PK Col B-PK Col C-PK Col B-FK ...
6
by: insirawali | last post by:
Hi all, I have this problem, i need to know is there a way i cn use the data adapter's update method in this scenario. i have 3 tables as below create table table1{ id1 int identity(1,1)...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.