Barbara Duprey wrote:


andrew wrote:
Barbara,

I sure don't feel preached at, just informed. Would you by any chance know the SQL to remove leading and trailing blanks from FIELDA in TABLEB? I'm sure it's all somewhere in there, but I can't face that learning curve right now!


UPDATE TABLEB SET FIELDA = TRIM( FIELDA )

Because your table and column names are all upper case there is no need for the double quote characters.

One note of caution: Base defaults to AUTO_COMMIT = TRUE in the GUI. Therefore when an UPDATE or DELETE statement such as the one above is executed in the SQL window the changes are immediately made permanent in the database. There is often no easy way to say - oops, didn't mean to do that exactly, undue please So before you begin mass data manipulations it really is a good idea to make a backup copy of your Base file - just in case.


Hmm. In the Execute SQL Statement dialog, I had
UPDATE "Addresses" SET ADDR = TRIM ( ADDR )

What I got was an error:
2: Unexpected token in statement [UPDATE "Addresses" SET ADDR = TRIM ( ADDR]

Note that it seems to have dropped the closing paren, and the preceding blank - I have no idea why. Certainly I can see why that would be an unexpected token, when the term never closed, but where did the paren I had there go? I tried with and without a trailing blank on the command, and various other blanks inserted/deleted. I also tried both with the Table list visible and the Addresses table selected, and with the Query list visible, but I got the same response each time. Suggestions? I'd really love to learn how to use this capability, it's obviously very powerful.


OK, I saw in the Help that only admin commands are allowed in the Execute SQL Statement dialog, so I created a query. Same result, except that the whole statement is there. So what token is it complaining about?

SQL Status: 37000
Error code: -11

Unexpected token in statement [UPDATE "Addresses" SET "ADDR" = TRIM( "ADDR" )]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to