OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Search and Replace Macro?

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Base
View previous topic :: View next topic  
Author Message
kitkeiper
Newbie
Newbie


Joined: 21 Mar 2006
Posts: 1

PostPosted: Thu Mar 23, 2006 12:33 pm    Post subject: Search and Replace Macro? Reply with quote

I have a really simple local database that stores sales information, among other data, for our coffeeshop. The descriptions of many of our items have changed over time and I would love a simple way to search and replace all the outdated entries with the new descriptions.

I realize that a search and replace button is still on the waiting list for Base.

I wonder if anyone has a simple macro that will search a single column in a single table in a local database and replace a string with a new one. I have never written a macro in my life and don't really have a working knowledge of Basic. I am running OOo 2.0.2 on WinXP.
_________________
- |<:+ -
(kit)
Back to top
View user's profile Send private message Send e-mail AIM Address MSN Messenger
probe1
Moderator
Moderator


Joined: 18 Aug 2004
Posts: 2560
Location: Chonburi Thailand Asia

PostPosted: Mon Mar 27, 2006 2:26 pm    Post subject: Reply with quote

I think you do use the internal data base HSQL.
You should be able to use SQL statements like
Code:

UPDATE table
SET ( column1 = 100, column2 = "New Description" )
WHERE id in ( 47, 48, 49 )


if not many changes affected.
How many items and text are we talking?
_________________
Cheers
Winfried
My Macros
DateTime2 extension: insert date, time or timestamp, formatted to your needs
Back to top
View user's profile Send private message Visit poster's website
trenkler
Power User
Power User


Joined: 21 May 2005
Posts: 55

PostPosted: Mon Mar 27, 2006 10:00 pm    Post subject: Reply with quote

probe1 wrote:
I think you do use the internal data base HSQL.
You should be able to use SQL statements like
Code:

UPDATE table
SET ( column1 = 100, column2 = "New Description" )
WHERE id in ( 47, 48, 49 )


if not many changes affected.
How many items and text are we talking?


To be more precise for begginer you must go throught Tools-SQL and write

Code:

UPDATE "tablename"
SET ( "column1" = 100, "column2" = 'New Description' )
WHERE "id" in ( 47, 48, 49 )


So "tablename" instead of tablename and 'New Description' instead of "New Description"

juraj
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Base All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group