![]() | ![]() Products ![]() ![]() ![]() ![]() |
Home » Technical Support » ElevateDB Technical Support » Support Forums » ElevateDB SQL » View Thread |
Messages 1 to 10 of 16 total |
![]() |
Mon, Mar 5 2007 2:03 PM | Permanent Link |
Roy Lambert NLH Associates ![]() | Tim
I decided to look to see if I could do something to remove trailing spaces via a trigger. Naturally I have no idea what I'm doing, but even so I think this is your's as a bug. Look at the attached jpeg and you'll see I'm told _ID is not a column, but it is! Roy Lambert ps I like this as a form of bug reporting. Saves me a lot of explaining, shows you all the info. pps variableorname would benefit from a few spaces ![]() Attachments: xx.jpg |
Mon, Mar 5 2007 3:10 PM | Permanent Link |
"Ole Willy Tuv" | Roy,
<< Look at the attached jpeg and you'll see I'm told _ID is not a column, but it is! >> It's not a bug. You need to reference columns through the transition variables NEWROW or OLDROW: SET NEWROW._ID = RTRIM(NEWROW._ID); Another problem is that ElevateDB doesn't seem to like spaces in delimited identifiers. I needed to change "REmove Trailing Spaces" to "REmove_Trailing_Spaces" to get the trigger definition work. This I believe is a bug. Ole Willy Tuv |
Mon, Mar 5 2007 3:38 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. ![]() | Ole,
<< Another problem is that ElevateDB doesn't seem to like spaces in delimited identifiers. I needed to change "REmove Trailing Spaces" to "REmove_Trailing_Spaces" to get the trigger definition work. This I believe is a bug. >> Yep, but it's only an issue with routines, i.e. triggers, jobs, functions, and stored procedures. Those do some "reformatting" of the routine for storage in the catalog and they don't include the name in double quotes like they should. A fix will be in 1.01 build 2. -- Tim Young Elevate Software www.elevatesoft.com |
Tue, Mar 6 2007 3:57 AM | Permanent Link |
Roy Lambert NLH Associates ![]() | Ole
Thanks. I knew I would be missing something, and I'm sure now I know the answer the manual/OLH will tell the same. Always they're right after I know what I'm talking about. I need an "ElevateDB for Dummies" ![]() Roy Lambert |
Tue, Mar 6 2007 8:44 AM | Permanent Link |
Roy Lambert NLH Associates ![]() | Ole
I've tried your code, and tried altering it to SET NEWROW._ID = RTRIM(OLDROW._ID); with a before update trigger. But in neither case does it do what I want ie remove the trailing spaces from the field. Any ideas? Roy Lambert |
Tue, Mar 6 2007 9:47 AM | Permanent Link |
"Ole Willy Tuv" | Roy,
<< I've tried your code, and tried altering it to SET NEWROW._ID = RTRIM(OLDROW._ID); with a before update trigger. But in neither case does it do what I want ie remove the trailing spaces from the field. Any ideas? >> It works here with 1.01 build 1. Is the _ID column defined as VARCHAR ? Ole Willy Tuv |
Tue, Mar 6 2007 10:04 AM | Permanent Link |
Roy Lambert NLH Associates ![]() | Ole
Yup. The way I've been testing it is to edit it in EDBMan, post it 1. I should get a PK violation (this is the primary index) and don't and 2. when I try re-editing it the spaces are still at the end as best as I can tell. Roy Lambert |
Tue, Mar 6 2007 10:21 AM | Permanent Link |
"Ole Willy Tuv" | Roy,
<< Yup. The way I've been testing it is to edit it in EDBMan, post it 1. I should get a PK violation (this is the primary index) and don't and 2. when I try re-editing it the spaces are still at the end as best as I can tell. >> Well, it works flawlessly here. Are you requesting a sensitive cursor ? Also, could you try the following SQL statements in EDB Manager and see what you get: create table test (col1 char varying(10)); create trigger test_before_update before update on test begin set newrow.col1 = rtrim(newrow.col1); end; insert into test values ('Roy '); -- length 5 select col1, length(col1) length_col1 -- length 5 from test; update test set col1 = col1; select col1, length(col1) length_col1 -- length 3 from test Ole Willy Tuv |
Tue, Mar 6 2007 11:34 AM | Permanent Link |
Roy Lambert NLH Associates ![]() | Ole
Naturally that works. Roy Lambert |
Tue, Mar 6 2007 12:34 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. ![]() | Roy,
<< with a before update trigger. But in neither case does it do what I want ie remove the trailing spaces from the field. Any ideas? >> I tried it yesterday with a before-insert trigger and it worked fine also. Are you editing from within a table, or via an UPDATE statement ? I did it with a table. -- Tim Young Elevate Software www.elevatesoft.com |
Page 1 of 2 | Next Page » | |
Jump to Page: 1 2 |
This web page was last updated on Wednesday, August 14, 2024 at 07:31 PM | Privacy Policy![]() © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? ![]() |