473,404 Members | 2,137 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,404 software developers and data experts.

updating all tables with a column column

Hi,

I am currently using the below script to generate another sql script to
scramble all columns in our development databases.
The problem I'm having are the larger tables are erroring with "...rollback
segment...". So, it was suggested that I create
a dynamic PL/SQL script to commit after every 1000 rows. They problem I'm
having (not being a PL/SQL export for one),
but apparently you can't use the table name as a variable. So, I'm having
problems getting it started so I can update all
tables with this common column. I'd appreciated any pointers.

Thanks!
set pages 0
spo scramble_ssns.sql
select 'update '||table_name||' set '||column_name||' = TRANSLATE
(''915482376'',''123456789'',TRANSLATE('||column_n ame||',
''1234567890'',''9732581406''));'
from user_tab_columns where column_name = 'SSN'
/
Jul 19 '05 #1
1 2923
On Fri, 30 Jan 2004 22:28:59 -0700, "Shawn" <sp*******@qwest.net>
wrote:
Hi,

I am currently using the below script to generate another sql script to
scramble all columns in our development databases.
The problem I'm having are the larger tables are erroring with "...rollback
segment...". So, it was suggested that I create
a dynamic PL/SQL script to commit after every 1000 rows. They problem I'm
having (not being a PL/SQL export for one),
but apparently you can't use the table name as a variable. So, I'm having
problems getting it started so I can update all
tables with this common column. I'd appreciated any pointers.

Thanks!
set pages 0
spo scramble_ssns.sql
select 'update '||table_name||' set '||column_name||' = TRANSLATE
(''915482376'',''123456789'',TRANSLATE('||column_ name||',
''1234567890'',''9732581406''));'
from user_tab_columns where column_name = 'SSN'
/


Check out EXECUTE IMMEDIATE in the documentation.
--
Bob Hairgrove
No**********@Home.com
Jul 19 '05 #2

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

Similar topics

0
by: cwbp17 | last post by:
Have two tables that have a FK relationship on ID column. Have one datagrid that displays all of the columns of both tables. What's the best approach on updating a row from the datagrid back to...
2
by: Basic | last post by:
Why doesn't this code work: -------------------------code snippet----------------- Dim categorysource As String categorysource = "SELECT ., ., ." & _ " FROM KSTUDY_KSTUDY " & _ " WHERE . = "...
1
by: Luis Esteban Valencia | last post by:
Hello Everyone, Iam an intermediate ASP.Net programmer and iam facing a challenging task. I have a table in MS-SQL server database called 'Members'. The table has following fields... ...
0
by: cwbp17 | last post by:
I'm having trouble updating individual datagrid cells. Have two tables car_master (columns include Car_ID, YEAR,VEHICLE) and car_detail (columns include Car_ID,PRICE,MILEAGE,and BODY);both tables...
0
by: Steve Amey | last post by:
Hi all I am having a problem when I am updating my database. I am using a strong DS and the PK column is an Identity column, but when I am udating my database I am getting the exception 'Column...
6
by: Geoff | last post by:
Hi This question has just occurred to me and I'm hoping somebody can help me. Suppose I have a table in an Access database. I have access to this table via a data adaptor i.e. I create a data...
4
by: Geoff | last post by:
Hi I'm hoping somebody can help me with the following problem that has occurred to me. Suppose I have two tables in an SQL Server database. Let's call these tables A and B. Assume that A has...
2
by: tshad | last post by:
Is there a way to update a DataSet Object? I have a Dataset Object (DataSetObj.Tables(0) - one table) that I read in from a .csv file. I normally do the following to get my data from the .csv:...
33
by: bill | last post by:
In an application I am writing the user can define a series of steps to be followed. I save them in a sql database using the field "order" (a smallint) as the primary key. (there are in the range...
2
by: Sid Price | last post by:
I have an application that has already been deployed and we need to add a new column to some of the tables in the application database. We are using an access database. We have a solution working...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.