Home > Archive > SQL Anywhere database > October 2005 > Re: Proxy tables trimming - The Solution









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: Proxy tables trimming - The Solution
Pavel

2005-10-28, 7:23 am

For everyone interested in this I think *heavy* bug, here
are some further notes:

Since I was getting troubles reducing the comparison to the
variable level, I did just a little more research and found
out, that ANY working with proxy table columns is working
with trimmed columns.

Here's how it "works" (I'm assuming things previous
examples):

First, let's do a regular concatenation:
SELECT '[' || name || ']' FROM proxy_t;
Result: [Joseph ]

The result is alright. But let's put it into a variable:
BEGIN
DECLARE @jname VARCHAR(100);
SELECT name INTO @jname FROM proxy_t;
MESSAGE '[' || @jname || ']' TO CLIENT;
END
Result: [Joseph] !!

This "works" both for DECLARE and CREATE VARIABLE. Let's try
to use a variable that's automatically created by FOR
(avoiding user-creating or declaring):
BEGIN
FOR names AS namecur CURSOR FOR
SELECT name FROM proxy_t
DO
MESSAGE '[' || name || ']' TO CLIENT;
END FOR;
END
Result: [Joseph]

So this won't work either.

The question is: Is there a way how to regularly compare
data from proxy columns in ASA 8 and higher?
The answer is: Yes. Since 1) ASA 8 and higher does proxy
column trimming (I hope) only, 2) it trims only from the
right (exactly as RTRIM)!! 3) and the pure SELECTs are
alright, there is a solution:

SELECT name || ']' FROM proxy_t;

....and to work only with SUBSTR(name,1,LENGTH
(name)-1) or
put this into a variable right away and further work with
that variable.

Kindda fuzzy - I know - but I haven't found a better
solution yet.
Pavel
Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com