[Solved] Search & Replace

Discuss the database features
Post Reply
danielhmichaud
Posts: 2
Joined: Thu Nov 16, 2017 8:19 pm

[Solved] Search & Replace

Post by danielhmichaud »

Control F (Does no work)
What I want to do is Querry and have it only pick up one field that has East Millinocket as one entry and Millinocket as another for example. There is nothing there in the querry that would isolate juse one of them as it picks up both. Need to pick up exactly one, if I want just the one with Millinocket it pulls both in.

There is a function for SEARCH AND REPLACE but I can't find it. Thanks
Last edited by danielhmichaud on Sat Nov 18, 2017 5:57 pm, edited 1 time in total.
Daniel H. Michaud, Sr.
OpenOffice 4.1.4
Windows 10
UnklDonald418
Volunteer
Posts: 1547
Joined: Wed Jun 24, 2015 12:56 am
Location: Colorado, USA

Re: Search & Replace

Post by UnklDonald418 »

To display only those records with the string 'Millinocket' you could use a query like

Code: Select all

SELECT * FROM "YourTableName" WHERE "TableColumnName" = 'Millinocket';
Of course you would need to substitute your values for "YourTableName" and "TableColumnName"
Likewise this query would only display those records containing 'East Millinocket'

Code: Select all

SELECT * FROM "YourTableName" WHERE "TableColumnName" = 'East Millinocket';
Or to display both

Code: Select all

SELECT * FROM "YourTableName" WHERE "TableColumnName" LIKE '%Millinocket';
Another option would be to enter a Filter property on Data tab of a Form properties dialog.

Base has no Search and Replace function, however you could execute something like this using Tools->SQL to replace all records containing 'East Millinocket' with 'Millinocket'

Code: Select all

UPDATE "YourTableName" set "TableColumnName" = 'Millinocket' WHERE "TableColumnName" = 'East Millinocket';
If your problem has been solved, please edit this topic's initial post and add "[Solved]" to the beginning of the subject line
Apache OpenOffice 4.1.14 & LibreOffice 7.6.2.1 (x86_64) - Windows 10 Professional- Windows 11
danielhmichaud
Posts: 2
Joined: Thu Nov 16, 2017 8:19 pm

Re: Search & Replace

Post by danielhmichaud »

Sorry I'm not understanding: Not sure if I have to do anything with the Code: Select All Expand viewCollapse view
I assume on my Main Screen I have Tables Quueries Forms Reports
The only way I can get to the Sql is not open the table but to highlight Talbes and my table within Tables.
I have copied exactly your SELETC info etc and ran the sql and it accepted it. I then go into my table and nothing has changed. I'm sure there is something little I am doing wrong..... Thanks
Daniel H. Michaud, Sr.
OpenOffice 4.1.4
Windows 10
UnklDonald418
Volunteer
Posts: 1547
Joined: Wed Jun 24, 2015 12:56 am
Location: Colorado, USA

Re: Search & Replace

Post by UnklDonald418 »

Any SQL statement beginning with SELECT is a query. Queries are used to tell the database engine to get some results from the table(s) and display them in a tabular format on the screen.
Since you didn't give us any details about your table we can only give you generalized examples of the SQL for the queries (SELECT) and UPDATE command. For any of those SQL commands to actually work you must replace "YourTableName" with the name of the table in your database surrounded by the double quotation marks. Likewise you must replace "TableColumnName" with the name of the column in your table that might contain the string 'Millinocket'.
If you provide the name of your table, and at the very minimum the name of the table field that might contain the string 'Millinocket' we might be able provide something that would work directly.

Because an UPDATE command can modify the data in your tables it would be wise to make a backup of your database or at least the table before executing any UPDATE command just in case something goes wrong.

Perhaps reading the Getting Started with Base Guide would be helpful.
https://wiki.openoffice.org/wiki/Docume ... e_Chapters
Since Apache Open Office Base and Libre Office Base are nearly the same, there is a more comprehensive guide
https://wiki.documentfoundation.org/ima ... ndbook.pdf
If you search there are several free online SQL tutorials.
If your problem has been solved, please edit this topic's initial post and add "[Solved]" to the beginning of the subject line
Apache OpenOffice 4.1.14 & LibreOffice 7.6.2.1 (x86_64) - Windows 10 Professional- Windows 11
Post Reply