Re: [U2] Non-SQL re-entrant query calls are not allowed??? (UV 10.0.2 )

2013-11-07 Thread Peter Cheney
Hi George,
I was curious so I tried it on my workstation running UniVersePE 11.1.12 with 
same results.
So I put a debug statement in the CRM.RETURN.PROFESSION subroutine.
JUNK var contains `Non-SQL re-entrant query calls are not allowed.þ'
So it certainly seems to be the SELECT as Andy just mentioned.
Regards,
Peter



Peter Cheney

Universe Engineer

t 07 3017 8837 | f 07 3002 8400

e peter.che...@firstmac.com.au | w www.firstmac.com.au




From: u2-users-boun...@listserver.u2ug.org 
 on behalf of George Gallen 

Sent: Friday, 8 November 2013 5:05 AM
To: U2 Users
Subject: [U2] Non-SQL re-entrant query calls are not allowed??? (UV 10.0.2 )

OK.

I Setup a Subroutine that if I call from an IDESC Gives me the following error:
Non-SQL re-entrant query calls are not allowed'

Am I to take this as, you can't do a SELECT on a file, from an IDESC Subroutine?

However, If I call it from another basic program, it works just fine.

The program runs the following code:
   CMD="SELECT FRED-XREF-FILE WITH FILENAME = '":FILENAME:"' TO 5"
   PRINT CMD
   EXECUTE CMD RTNLIST CAPTURING JUNK
   PRINT JUNK
   PRINT @SELECTED:" SELECTED"
   SIDNO=""
   LOOP
  READNEXT ID FROM 5 ELSE EXIT
  PRINT ID
  SIDNO=FIELD(ID,"_",2)
   REPEAT
*

And the IDESC:
0001: I
0002: SUBR('*CRM.RETURN.PROFESSION','MASTER.HEMONC',@ID)
0003:
0004: PROFESSION
0005: 30L
0006: S

It's the SELECT that fails - but only when run from the IDESC

Example:

0001: FILE="MASTER.HEMONC"
0002: ID="123456"
0003: CALL *CRM.RETURN.PROFESSION(PROFESSION,FILE,ID)
0004: PRINT PROFESSION



George Gallen
Senior Programmer/Analyst
Accounting/Data Division, EDI Administrator
ggal...@wyanokegroup.com
ph:856.848.9005 Ext 220
The Wyanoke Group
http://www.wyanokegroup.com

___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

 ---
Note: 
This email (inc all attachments) is for the use of the intended recipient(s) 
only.
Privileged or confidential information may be contained in this communication. 
If you have received this email in error, please notify the sender immediately 
and then delete all copies of this message from your computer network. If you 
are not the intended recipient, you must not keep, use, disclose, copy or 
distribute this email without the author's prior permission. If you are the 
intended recipient and you do not wish to receive similar electronic messages 
from us in future, then please respond to the sender to this effect. 
We have taken precautions to minimise the risk of transmitting software 
viruses, but advise you to carry out your own virus checks on this email and 
its attachments. We do not accept liability for any loss or damage caused by 
software viruses and do not represent that this transmission is free from 
viruses or other defects. 
Firstmac Limited (ABN 59 094 145 963) (AFSL 290600) 
 ---
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] Non-SQL re-entrant query calls are not allowed??? (UV 10.0.2 )

2013-11-07 Thread andy baum
George,

See my answer to Bjorn Behr when he asked the same question in April 2009.

[Begin]
This is the error you get when the I-Descriptor calls a subroutine that does a 
SELECT. See this reply from Glenn Herbert to the same problem in March 2004. 

"Yeah. It's actually a bug in the program/itype unloading code that won't allow 
you to do this. I ran upon this in May 2003 and, subsequently, put in a fix 
within the DataStage engine so that it works. Should be an easy fix once its 
understood." 

Guess they've not got around to fixing it yet. Dependant on the select in the 
subroutine it can usually be worked around by using UniBasic commands like 
SELECTINDEX. 

[End]

Cheers,
Andy



 From: George Gallen 
To: U2 Users  
Sent: Thursday, 7 November 2013, 19:05
Subject: [U2] Non-SQL re-entrant query calls are not allowed??? (UV 10.0.2 )
 

OK.

I Setup a Subroutine that if I call from an IDESC Gives me the following error:
Non-SQL re-entrant query calls are not allowed'

Am I to take this as, you can't do a SELECT on a file, from an IDESC Subroutine?

However, If I call it from another basic program, it works just fine.

The program runs the following code:
   CMD="SELECT FRED-XREF-FILE WITH FILENAME = '":FILENAME:"' TO 5"
   PRINT CMD
   EXECUTE CMD RTNLIST CAPTURING JUNK
   PRINT JUNK
   PRINT @SELECTED:" SELECTED"
   SIDNO=""
   LOOP
      READNEXT ID FROM 5 ELSE EXIT
      PRINT ID
      SIDNO=FIELD(ID,"_",2)
   REPEAT
*

And the IDESC:
0001: I
0002: SUBR('*CRM.RETURN.PROFESSION','MASTER.HEMONC',@ID)
0003:
0004: PROFESSION
0005: 30L
0006: S

It's the SELECT that fails - but only when run from the IDESC

Example:

0001: FILE="MASTER.HEMONC"
0002: ID="123456"
0003: CALL *CRM.RETURN.PROFESSION(PROFESSION,FILE,ID)
0004: PRINT PROFESSION



George Gallen
Senior Programmer/Analyst
Accounting/Data Division, EDI Administrator
ggal...@wyanokegroup.com
ph:856.848.9005 Ext 220
The Wyanoke Group
http://www.wyanokegroup.com

___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users
___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


[U2] Non-SQL re-entrant query calls are not allowed??? (UV 10.0.2 )

2013-11-07 Thread George Gallen
OK.

I Setup a Subroutine that if I call from an IDESC Gives me the following error:
Non-SQL re-entrant query calls are not allowed'

Am I to take this as, you can't do a SELECT on a file, from an IDESC Subroutine?

However, If I call it from another basic program, it works just fine.

The program runs the following code:
   CMD="SELECT FRED-XREF-FILE WITH FILENAME = '":FILENAME:"' TO 5"
   PRINT CMD
   EXECUTE CMD RTNLIST CAPTURING JUNK
   PRINT JUNK
   PRINT @SELECTED:" SELECTED"
   SIDNO=""
   LOOP
  READNEXT ID FROM 5 ELSE EXIT
  PRINT ID
  SIDNO=FIELD(ID,"_",2)
   REPEAT
*

And the IDESC:
0001: I
0002: SUBR('*CRM.RETURN.PROFESSION','MASTER.HEMONC',@ID)
0003:
0004: PROFESSION
0005: 30L
0006: S

It's the SELECT that fails - but only when run from the IDESC

Example:

0001: FILE="MASTER.HEMONC"
0002: ID="123456"
0003: CALL *CRM.RETURN.PROFESSION(PROFESSION,FILE,ID)
0004: PRINT PROFESSION



George Gallen
Senior Programmer/Analyst
Accounting/Data Division, EDI Administrator
ggal...@wyanokegroup.com
ph:856.848.9005 Ext 220
The Wyanoke Group
http://www.wyanokegroup.com

___
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users


Re: [U2] UV Basic parsing xml with XDOM commands

2013-11-07 Thread Symeon Breen
I have found in the past the handling of namespaces in both the XDOM
commands and the EXT files, is not well documented, and does not always work
how I expect.  So I usually preprocess any such XML files with xsltproc to
remove the namespaces - an example xsl to do this is 

http://www.w3.org/1999/XSL/Transform";>
  

 
 

  

  

  


  
  


  

  
  

  



-Original Message-
From: u2-users-boun...@listserver.u2ug.org
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Peter Cheney
Sent: 06 November 2013 02:01
To: U2 Users List
Subject: [U2] UV Basic parsing xml with XDOM commands

Hi Everyone,

Thought I'd post a solution to a task I've been working on in the hope it
will assist someone else with similar requirements. Thanks also to those
who've previously posted on this as I found the following to be most helpful
as well:
http://www.mail-archive.com/u2-users@listserver.u2ug.org/msg18895.html
https://gdoesu2.wordpress.com/tag/xdomlocate/
http://listserver.u2ug.org/pipermail/u2-users/2010-September/004713.html
http://www.mvdeveloper.com/kb/docs/kb10.pdf


I had to parse some xml returned via a soap request to an IIS server:

http://schemas.xmlsoap.org/soap/envelope/";>
  
http://tempuri.org/";>
  http://schemas.datacontract.org/2004/07/FirstMac.Services.Category.
Contracts" xmlns:i="http://www.w3.org/2001/XMLSchema-instance";>
Some group data
Some name data
  

  

There are only ever 2 value nodes returned if the soap query is successful
with the SuggestResult node containing 'i:nil="true"' if the query is not
successful.
e.g. 

The xml contains a default namespace and after much searching and trial and
error I discovered I needed to use the following xpathString and nsMAP
parameters in the XDOMLocate function:
Notes re the XDOMLocate function.
I found the UV11.1 Basic Commands Reference and Basic Extensions documents
for XDOMLocate to be scarce on detail for the following:

  *   Each additional namespace in the string must also be space delimited.
  *   The double quotes enclosing the http url must be removed for each
namespace defined in the nsMAP parameter. The description given has double
quotes in the wrong places. e.g. if you have http://schemas.xmlsoap.org/soap/envelope/";> then the namespace you
need to specify is nsMAP =
'xmlns:s=http://schemas.xmlsoap.org/soap/envelope/'


xpathStr  = '/s:Envelope/s:Body'

nsMAP  = 'xmlns:s=http://schemas.xmlsoap.org/soap/envelope/ '
nsMAP :=
'xmlns:a=http://schemas.datacontract.org/2004/07/FirstMac.Services.Category.
Contracts '
nsMAP := 'xmlns=http://tempuri.org/ '
nsMAP := 'xmlns:i=http://www.w3.org/2001/XMLSchema-instance'

OK = XDOMOpen( RespData, XML.FROM.STRING, hDOM ) if OK = XML.SUCCESS then
   crt 'XML document opened'
   OK = XDOMLocate( hDOM, xpathStr, nsMAP, hRoot )
   if OK = XML.SUCCESS then
  crt 'Found ':xpathStr

  OK = XDOMGetNodeName( hRoot, NodeName )
  crt 'Root node=':NodeName
  OK = XDOMLocateNode( hRoot, XDOM.CHILD, XDOM.FIRST.CHILD,
XDOM.ELEMENT.NODE, hParent )
  if OK = XML.SUCCESS then
 OK = XDOMGetNodeName( hParent, NodeName )
 crt 'Parent node = ':NodeName ;*
'SuggestResponse'
 OK = XDOMLocateNode( hParent, XDOM.CHILD, XDOM.FIRST.CHILD,
XDOM.ELEMENT.NODE, hChild )
 if OK = XML.SUCCESS then
OK = XDOMGetNodeName( hChild, NodeName )
crt 'Child node = ':NodeName   ;*
'SuggestResult'
OK = XDOMLocateNode( hChild, XDOM.CHILD, XDOM.FIRST.CHILD,
XDOM.ELEMENT.NODE, hValueNode )
if OK = XML.SUCCESS then
   OK = XDOMGetNodeName( hValueNode, NodeName )
   crt 'Value node1 = ':NodeName   ;*
'a:CategoryGroup'
   OK = XDOMLocateNode(hValueNode, XDOM.CHILD, XDOM.FIRST.CHILD,
XDOM.TEXT.NODE, hTextNode )
   if OK = XML.SUCCESS then
  OK = XDOMGetNodeValue(hTextNode, Value )
  crt 'Payload1 = ':Value  ;* 'Some
group data'
   end else
  gosub ShowError
   end
end
OK = XDOMLocateNode( hChild, XDOM.CHILD, 2, XDOM.ELEMENT.NODE,
hValueNode )
if OK = XML.SUCCESS then
   OK = XDOMGetNodeName( hValueNode, NodeName )
   crt 'Value node2 = ':NodeName   ;*
'a:CategoryName'
   OK = XDOMLocateNode(hValueNode, XDOM.CHILD, XDOM.FIRST.CHILD,
XDOM.TEXT.NODE, hTextNode )
   if OK = XML.SUCCESS then
  OK = XDOMGetNodeValue(hTextNode, Value )
  crt 'Payload2 = ':Value  ;* 'Some name
data'
   end else
  gosub ShowError
   end
end else
   gosub ShowError
end
 end else
gosub ShowError
 end
  end else