jomali wrote: > Your answer leads me to believe that you haven't really investigated the > possibilities of using the database facilities for solving your problem, > since you aren't even aware that OOo provides HSQLDB as its default, not > MySQL. If you really need to use a database to manage your data, you might > investigate more thoroughly how you might solve your problem using SQL. > > John > > On Fri, Dec 11, 2009 at 8:00 AM, Jonathan Kaye <[email protected]> wrote: > >> jomali wrote: >> >> > On Wed, Dec 9, 2009 at 4:49 AM, Jonathan Kaye <[email protected]> >> wrote: >> > >> >> This is a simple question but hours of searching various documents >> hasn't >> >> turned up an answer yet. In a spreadsheet I can assign a function >> >> whose argument is a cell to perform an operation that is displayed in >> >> the cell containing the function call. Thus, if cell B1 has the >> >> formula >> =upper(A1) >> >> and A1 has a string "Hello world", then B1 will display "HELLO WORLD". >> >> I can >> >> also use a macro in a similar fashion to map one string of characters >> >> onto another. >> >> >> >> My question is: how do I do this in a database? I would like to define >> >> a field in a query whose value is calculated by applying my macro to >> >> the value >> >> of another field. I have a field called "ENTRY" in my database and I >> >> would like to create another field whose value is FIXSORT(ENTRY) where >> >> FIXSORT is a macro that I've written which maps one string onto >> >> another one. I assume this is done using a query but I've been unable >> >> to figure out how to create the calculated field. >> >> >> >> Thanks for any help. >> >> Jonathan >> >> -- >> >> Registerd Linux user #445917 at http://counter.li.org/ >> >> Please do not send me copies of list mail. I read the lists. Thanks! >> >> >> >> I doubt that you can do it with an OOo macro (others may know more). >> > However, you can probably do what you want with SQL, depending on the >> DBMS >> > you are using and the actual substitution you would like to make. In >> > your example, you can formulate an SQL query using the UPPER function >> > to display Hello World as HELLO WORLD. For a more complex query, you >> > might want to consider using the stored procedure or function >> > capabilities of you DBMS. >> > >> > John >> Thanks John. My macros are extremely specific to a given task and could >> only >> be created via a macro programming language (such a the variety of basic >> used in openoffice). I use the dbms supplied by openoffice (mysql?). I >> have not been able to find any mention of how to use macros created in >> openoffice >> for calculated fields. I guess it can't be done. >> Thanks again. >> Jonathan >> >> -- >> Registerd Linux user #445917 at http://counter.li.org/ >> Please do not send me copies of list mail. I read the lists. Thanks! >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [email protected] >> For additional commands, e-mail: [email protected] >> >> Actually I was aware of that, John. It indicates HSQL Database Engine on the lower window border of the data window. I didn't have it opened when I posted my last message hence the question mark following "mysql" in brackets in my posting. I'm terribly sorry I wasn't clear but I don't see how this correction contributes to finding a solution. Thanks, Jonathan
-- Registerd Linux user #445917 at http://counter.li.org/ Please do not send me copies of list mail. I read the lists. Thanks! --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
