NetTalk Central

Author Topic: xml load with xfiles  (Read 4004 times)

joep

  • Newbie
  • *
  • Posts: 48
    • View Profile
    • Email
xml load with xfiles
« on: February 22, 2013, 06:47:52 AM »
Hi all,

I want to load an xml file into 2 queue’s which should be related.
I have got a master record and one or more child records.
I thought I could do this with 2 load commands.
The first on the master is no problem, but the second one on the child I can’t get right.
I would suppose I do a load(BagQueue,file,’antwoord’,’object’) for the master
And a load(TgoQueue,file,’antwoord’,’gerelateerde’) for the child, but then I always get the last one only.
Another question is how to get the multiple "gebruiksdoel" into the TgoQueue.

These are my queue’s:
Child queue:
TgoQueue                 QUEUE,PRE(tgo)
identificatie              STRING(20)
identificatie_bag          STRING(20)
puntGeometrie            STRING(20)
gebruiksdoel               STRING(30)         (I should probably make 5 of these, see the example)
bouwjaar                   STRING(10)
                         END
Master queue:
BagQueue                 QUEUE,PRE(bg)
identificatie              STRING(20)
woonplaatsNaamNen          STRING(30)
identificatie_opr          STRING(20),NAME('opr.identificatie')
openbareRuimteNaam         STRING(30)
huisnummer                 STRING(10)
huisletter                     STRING(10)
huisnummertoevoeging  STRING(10)
postcode                   STRING(10)
StraatNaam                 STRING(30)
                         END
Can anyone help me?

Regards
Joep

[attachment deleted by admin]

Rene Simons

  • Hero Member
  • *****
  • Posts: 649
    • View Profile
Re: xml load with xfiles
« Reply #1 on: February 23, 2013, 11:16:22 AM »
Hi Joep,

Queues are not thread safe.
I suggest you use In memory tables where the session id is a key component or filterable element .
Also it is easier to assign more keys to these files.

Rene (nl)
Rene Simons
NT14.14

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11183
    • View Profile
Re: xml load with xfiles
« Reply #2 on: February 24, 2013, 11:10:18 PM »
I agree - don't use queues.

cheers
Bruce

joep

  • Newbie
  • *
  • Posts: 48
    • View Profile
    • Email
Re: xml load with xfiles
« Reply #3 on: March 11, 2013, 07:25:53 AM »
Hi all,

I now use memory tables but i'am still not able to load my xml.
I have bin looking at the inv example from nettalk.
Both memory tables are loaded like the "inv" example, but I can't get the relationship wright.
The assignfield embed works because the child table is loaded with the correct fields.
The problem for now is the addqueuerecord for the child table.
Somehow this embed is not fired.
Does anyone know what the problem could be?

Regards Joep

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11183
    • View Profile
Re: xml load with xfiles
« Reply #4 on: March 11, 2013, 10:31:53 PM »
It's _really_ hard to comment without seeing an app Joep.

cheers
Bruce

joep

  • Newbie
  • *
  • Posts: 48
    • View Profile
    • Email
Re: xml load with xfiles
« Reply #5 on: March 11, 2013, 11:03:43 PM »
Hi Bruce

I have included an app called loadxml63.
Clarion version 6.3

Cheers Joep

[attachment deleted by admin]

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11183
    • View Profile
Re: xml load with xfiles
« Reply #6 on: March 12, 2013, 04:37:23 AM »
Hi Joep,

ok - couple things.
a) you probably should have mentioned this is a non-web-server app. You asked the question in a Web Server forum, so I assumed it was a web server app (as did Rene I suspect.) The note about queues is more applicable to WebServer apps than Windows apps.

b) ok - I've compiled the app, and pressed the "load" button. Some stuff appears. So what's the problem? (what should I be seeing that I'm not seeing?)

cheers
Bruce


joep

  • Newbie
  • *
  • Posts: 48
    • View Profile
    • Email
Re: xml load with xfiles
« Reply #7 on: March 12, 2013, 05:37:36 AM »
Hi Bruce ,

THE identicatie in THE parent should appear in THE child under identificatie_bag

Cheers Joep

joep

  • Newbie
  • *
  • Posts: 48
    • View Profile
    • Email
Re: xml load with xfiles
« Reply #8 on: March 12, 2013, 11:49:54 AM »
Hi Bruce,

I was not at my office this afternoon, that's why I did a quick reply.
Like I said before I want to get the key of the parent table in the child table.
In my example BagAOA is the parent and BagTGO the child.
The field identificatie is put into the field identificatie_bag by the embed AddQueueRecord.
The only thing is that it is not getting there and the field identificatie_bag stays empty.
Besides that I need to find a way to read the multiple "gebruiksdoel" tag's.

cheers Joep

Rene Simons

  • Hero Member
  • *****
  • Posts: 649
    • View Profile
Re: xml load with xfiles
« Reply #9 on: March 12, 2013, 01:43:19 PM »
Hi Joep,

Is it okay when I contact you wedneday (13 MAR 2013) morning?

Rene Simons
Kudelstaart NL
Rene Simons
NT14.14

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11183
    • View Profile
Re: xml load with xfiles
« Reply #10 on: March 12, 2013, 10:44:06 PM »
Thanks Joep.

you were so, so close - you only made one mistake as far as I can see.

you embedded in AddQueueRecord, but BagTGO is a File not a Queue.

Move that code up one method to
InsertFileRecord (and _also_ possibly down one method to UpdateFileRecord if you're going to allow files to be re-imported) and you should be fine.

cheers
Bruce


joep

  • Newbie
  • *
  • Posts: 48
    • View Profile
    • Email
Re: xml load with xfiles
« Reply #11 on: March 13, 2013, 12:29:22 AM »
Thanks Bruce

That was indeed the problem.
I have been working with queue's all along and did forget to use a simular file embed.
At least now I can move on to the multiple "gebruiksdoel" tags challenge.

@Rene you me contact me of course
my mail is firstname dot borghans at bentis dot ourcountry.
[bruce edited the email to prevent spam]
« Last Edit: March 13, 2013, 12:46:37 AM by Bruce »