Remove duplicates from existing database?

jamon
Posts: 163
Joined: Wed Jun 26, 2002 9:35 am

Remove duplicates from existing database?

Post by jamon »

I put the novars into all the insert statements. (It never occurred to me that values would be returned by an insert.) Anyway...

It didn't change the behavior. The sections of the code that are not doing a substring substitution in the URL are working fine. Those sections that ARE doing the substring substitution, aren't working.

The html and refs that are being copied are the same in both cases. It's just that in one case, the URL already says ".../Consumer/...," so no substitution is needed. In the other section, the middle of the URL has to be changed from "/Consumer/" to "/Wholesaler/" for consistency with the rest of what's in the destination database.

There's something else going on.

By the way, the substring substitution piece was working fine before we started doing the hash comparison to eliminate duplicates that came from the copy operation.
jamon
Posts: 163
Joined: Wed Jun 26, 2002 9:35 am

Remove duplicates from existing database?

Post by jamon »

Obviously, in the example code above, the substring substitution is from '/Consumer/' to '/Retailer/' (not to '/Wholesaler/' as stated in the latest message). We are actually copying data from our online catalog search databases into seven different user profiles. Again, those without the extra code for the substring translation are working.

Does the call to sandr actually change the value of $Url? Or, is the changed result only available via $ret?

Maybe I can fix this with a judicious use of temporary storage variables.
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

Remove duplicates from existing database?

Post by mark »

Try adding some debug statements (print out variable values) at various key places to see what's it's doing.
jamon
Posts: 163
Joined: Wed Jun 26, 2002 9:35 am

Remove duplicates from existing database?

Post by jamon »

Oh, you're going to love this! My .bat file was calling a modified copy of the script, one that didn't include those other sections. Duh!

But, now there's a different issue. See the next response.
jamon
Posts: 163
Joined: Wed Jun 26, 2002 9:35 am

Remove duplicates from existing database?

Post by jamon »

This code, with or without added debug statements, causes the following error:

000 Jun 24 09:16:29 d:\thunderstonesoftware\moen\scripts\copycat:158: texis ABEND exception 0xC0000005 (ACCESS_VIOLATION)

Line 158 is the "<if $loop eq 0..." line.

<A NAME=Rt_To_Rt>
<$sourcedb=$rtcatdb>
<$destdb=$retdb>
<sql db=$sourcedb row "select * from html">
<sandr "/Consumer/" "/Retailer/" $Url>
<$TmpUrl = $ret>
<sql db=$destdb novars max=1 "select * from html where Hash=$Hash"></sql>
<if $loop eq 0 or $Hash eq 0><!-- not found -->
<sql db=$destdb novars "insert into html values(counter,$Hash,$Size,$Visited,$Dlsecs,$Depth,$TmpUrl,$Title,$Body,$Keywords,$Description,$Meta,$Catno)"></sql>
<sql db=$sourcedb row "select * from refs where Url=$Url">
<sandr "/Consumer/" "/Retailer/" $Ref>
<$TmpRef = $ret>
<sql db=$destdb novars "insert into refs values($TmpUrl,$TmpRef)"></sql>
</sql>
</if>
</sql>
</A> <!-- end Rt_To_Rt -->
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

Remove duplicates from existing database?

Post by mark »

What's your texis version (full output of texis -version)?
Try this instead
<if $loop eq 0 or $Hash eq '000000000'><!-- not found -->
jamon
Posts: 163
Joined: Wed Jun 26, 2002 9:35 am

Remove duplicates from existing database?

Post by jamon »

Version:

Texis Web Script (Vortex) Copyright (c) 1996-2002 Thunderstone - EPI, Inc.
Commercial Webinator Version 4.02.1031937844 of Sep 13, 2002

The suggested modification worked.
Post Reply