difficulty with long string vars

Post Reply
tboyer
Posts: 68
Joined: Mon Aug 28, 2006 4:43 pm

difficulty with long string vars

Post by tboyer »

Hi all,

I'm trying to compare some very long strings (document sized) and I get the following error:

FOP 136 failed

The error occurs in the following line, which is comparing a long string to another long string:

<if $text eq $text2>

Sounds like I'm bumping up against a memory limit.

Maybe there's a better way to compare strings? I can avoid trouble by hashing the documents but in this case I would prefer to use the original because I want the result to be definitive.

Thoughts?

Tom
User avatar
Kai
Site Admin
Posts: 1272
Joined: Tue Apr 25, 2000 1:27 pm

difficulty with long string vars

Post by Kai »

You may very well be running out of memory if the strings are large. You could try using <strcmp>:

<strcmp $text $text2>
<if $ret eq 0>
...

which may or may not use less memory.
User avatar
John
Site Admin
Posts: 2622
Joined: Mon Apr 24, 2000 3:18 pm
Location: Cleveland, OH
Contact:

difficulty with long string vars

Post by John »

Were there any other messages, which I would expect if it was a memory issue? Not sure why it would fail. You can use the <strcmp> function in Vortex which may be more efficient.
John Turnbull
Thunderstone Software
tboyer
Posts: 68
Joined: Mon Aug 28, 2006 4:43 pm

difficulty with long string vars

Post by tboyer »

Thanks much.

I also found that presence of a $ in the field (varchar) was getting in the way -- I assume because the program was confusing it for another variable. If I sandr it into $$ it behaves -- and maybe strcmp won't get confused that way?
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

difficulty with long string vars

Post by mark »

The $ thing doesn't make sense. The content shouldn't matter. Maybe you could open a tech support ticket so we can arrange to get your actual data etc to see what's going on.
tboyer
Posts: 68
Joined: Mon Aug 28, 2006 4:43 pm

difficulty with long string vars

Post by tboyer »

Just FYI <strcmp> does NOT get confused by dollar signs in a text field. Seems to solve the problem elegantly. Thanks.
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

difficulty with long string vars

Post by mark »

I'm not able to replicate that problem at all.
How big are these fields?
What's your texis version and platform? (full output of texis -version)
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

difficulty with long string vars

Post by mark »

For the record the problem turned out to be related to data types, not content. A blob should be converted to varchar for the comparison. Sandring and strcmping caused implicit conversions.
tboyer
Posts: 68
Joined: Mon Aug 28, 2006 4:43 pm

difficulty with long string vars

Post by tboyer »

Yes, here's the fix we use:

For a blob field called Textfield

<sql "select id, convert(Texfield,'varchar') Textfield etc
Post Reply