Timport XML and blob

skalyanaraman
Posts: 109
Joined: Tue May 29, 2001 9:13 pm

Timport XML and blob

Post by skalyanaraman »

Here is a good sample,
<xml>
<rs:data>
<z:row DOCID='ALC0001' BATES='BAC0001' AUTHOR='Srini' DOCTEXT='ALC Documents 01'/>
<z:row DOCID='ALC0002' BATES='BAC0002' AUTHOR='George Bush' DOCTEXT='ALC Documents 02'/>
</rs:data>
</xml>

The records I am trying to get out of these are,

DOCID BATES AUTHOR DOCTEXT
ALC0001 BAC0001 Srini ALC Documents 01
ALC0002 BAC0002 George Bush ALC Documents 02

So that I can put this record in a Texis table with the fields above.

So, what do I do now without getting any memory issues and so on?

Thanks!!
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

Timport XML and blob

Post by mark »

Strip one of the outer nest level tags "<xml>" or "<rs:data>" then pass the result to timport. Something like this:

<sandr "<=/?rs:data>" "" $data><$data=$ret>
<timport row "
xml
field docid varchar xml/z:row/DOCID ''
field author varchar xml/z:row/AUTHOR ''
" $data>
...
skalyanaraman
Posts: 109
Joined: Tue May 29, 2001 9:13 pm

Timport XML and blob

Post by skalyanaraman »

I tried this, actually, that was the same thing I tried before and got the "Not enough space" problem. Please see item 5 of the conversation above. Here it is, what I tried,

<sandr "<=/?rs:data>" "" $data><$data=$ret>

<timport row "xml
field DOCID varchar(255) xml/z:row@DOCID
field AUTHOR varchar(255) xml/z:row@AUTHOR
field DOCTEXT blob xml/z:row@DOCTEXT" $data>

DOCID: $DOCID
AUTHOR: $AUTHOR
DOCTEXT: $DOCTEXT
</timport>

interestingly I kinda figured out the problem is having the DOCTEXT with the blob there. The error I get is,
DOCID: CRD000000001_MSG
<!-- 011 skimport:18: Not enough space -->

If I take out the line ,
field DOCTEXT blob xml/z:row@DOCTEXT
from the schema it works.
skalyanaraman
Posts: 109
Joined: Tue May 29, 2001 9:13 pm

Timport XML and blob

Post by skalyanaraman »

It seems to work with using a varchar in the place of blob of the schema, like
field DOCTEXT varchar xml/z:row@DOCTEXT
instead of
field DOCTEXT blob xml/z:row@DOCTEXT

But do you think I will miss any data if I do this?
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

Timport XML and blob

Post by mark »

There's no real difference between varchar and blob in timport. They only control how texis ultimately stores the data on disk. Since timport in vortex never stores any data it doesn't matter. Use whichever works for you.
Post Reply