473,320 Members | 1,817 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,320 software developers and data experts.

could this be done in SQL???

7
how could this psuedocode be accomplished in SQL

foreach record( table_1){

Select x.table2 FROM table_2
WHERE y.table_2 = y.table_1

update set x.table_1 = x.table_2
}
Jun 26 '07 #1
1 993
how could this psuedocode be accomplished in SQL

foreach record( table_1){

Select x.table2 FROM table_2
WHERE y.table_2 = y.table_1

update set x.table_1 = x.table_2
}

Hi, it is to do with cursor, example:

declare @x int,
@y int
declare cl cursor for select x, y from table1

open cl
fetch next from cl into @x, @y
while @@fetch_status = 0
begin
update table2 set y=@y where x=@x
fetch next from cl into @x, @yend
end

close cl
deallocate cl


greatings
Zibi
Jul 4 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Mark Wilson CPU | last post by:
I upgraded my local Nuspere installation with the newer PHP (see notes below); I installed the 4.3.2 version, using the installer ("blind", since I never heard back from anyone who'd done it...
1
by: Afaq | last post by:
Hi, After adding large number of empty resource files (which will be updated later), we are not able to compile the project. the following is the output of the build process. It fails while...
9
by: Steven T. Hatton | last post by:
This was written for the gnu.g++.help list. It rather clearly spells out the most important feature of Java that I believe C++ lacks. I really don't believe the C++ Standard sepcifies enough for a...
5
by: Norberto Rivera | last post by:
Is there another option that allows me to do what I want to do? Javascript does not allow me (as far as I could see: I don't know much) to delete, rename, or copy a file at the web hosting side....
1
by: Koen | last post by:
Hi all, I created a little database to manage my e-books. The program will synchronize a table with the contents of a directory. Works great. Because I keep additional info (like keywords) to...
2
by: Shimon Sim | last post by:
Hi I started using SharePoint services and noticed that it works great with Word - just open doc and edit. could it be done with ASP.NET by regular people? May be someone can give a hint in right...
13
by: Thom Little | last post by:
My first ASP.NET application on Visual Studio 2005 and .NET Framework 2.0 The application compiles and executes correctly on the development machine. I then publish it to an empty directory on...
0
by: Derek | last post by:
I am creating an intranet using Visual Web Developer Express Edition. Everything has been working OK until yesterday when I started getting 62 messages all beginning "Could not find schema...
22
by: Zytan | last post by:
I have public methods in a form. The main form calls them, to update that form's display. This form is like a real-time view of data that is changing. But, the form may not exist (it is...
1
by: Mufasa | last post by:
I have a couple of fields that are autopostback and I want to make tab work correctly between them. But whenever somebody changes the value and clicks somewhere else the page reloads as it should...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...

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.