Author |
Message
|
polydegmon |
Posted: Wed Nov 28, 2012 4:14 am Post subject: Create Statement Issue |
|
|
Novice
Joined: 07 Oct 2011 Posts: 11
|
Hi, I'm trying to use the CREATE statement to create an XMLNSC folder out of an Environment Variable tree structure, however when I include the FROM clause an error is generated.
Code: |
CREATE LASTCHILD OF OutputRoot DOMAIN('XMLNSC')
TYPE 'XMLNSC.Folder'
NAMESPACE gpd
NAME 'GetProducerDetailsResponse';
FROM Environment.Variables.GPDVariables.Response.MSGSTATUS;
|
Does anyone have any ideas on how to get this to work? |
|
Back to top |
|
 |
McueMart |
Posted: Wed Nov 28, 2012 4:40 am Post subject: |
|
|
 Chevalier
Joined: 29 Nov 2011 Posts: 490 Location: UK...somewhere
|
Are you trying to make it extra fun for us by not telling us the error you are seeing ? |
|
Back to top |
|
 |
polydegmon |
Posted: Wed Nov 28, 2012 4:50 am Post subject: |
|
|
Novice
Joined: 07 Oct 2011 Posts: 11
|
Code: |
Description Resource Path Location Type
Syntax error. Valid options include: identifier BEGIN CALL CASE CREATE DECLARE DELETE ELSE ELSEIF END
EVAL FOR IDENTIFIER IF INSERT ITERATE LEAVE LOOP PASSTHRU REPEAT
RETURN UNTIL VALUES WHEN WHILE GetProducerDetails.esql GetProducerDetails_MFP line 478 ESQL
|
That's the error but it's not the most helpful error message in the world. |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Nov 28, 2012 4:51 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Does your actual code have that extra semicolon after the name clause? or is that a typo here? |
|
Back to top |
|
 |
polydegmon |
Posted: Wed Nov 28, 2012 4:59 am Post subject: |
|
|
Novice
Joined: 07 Oct 2011 Posts: 11
|
Yes sorry that's a typo.
This is the code
Code: |
CREATE LASTCHILD OF OutputRoot DOMAIN('XMLNSC')
TYPE 'XMLNSC.Folder'
NAMESPACE gpd
NAME 'GetProducerDetailsResponse'
FROM Environment.Variables.GPDVariables.Response.MSGSTATUS;
|
and this is the error
Code: |
Description Resource Path Location Type
Syntax error. Valid options include: || / = >= > <= < - <> + ; *
AND BETWEEN DAY HOUR IN IS LIKE MINUTE MONTH NOT
OR SECOND VALUE YEAR GetProducerDetails.esql GetProducerDetails_MFP line 478 ESQL
|
|
|
Back to top |
|
 |
mqjeff |
Posted: Wed Nov 28, 2012 5:09 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Try replacing the Type, Namespace and Name clauses with an Identity clause
Code: |
CREATE LASTCHILD OF OutputRoot Domain('XMLNSC')
IDENTITY (XMLNSC.Folder)gpd:GetProducerDetailsResponse
FROM Enviornment.Variables.GPDVariables.Response.MSGSTATUS; |
But I think you'll find that you need the last child of OutputRoot to actually be named XMLNSC and your gpd:GetProducerDetailsResponse to be the first (and only) child of that (i.e. you need OutputRoot.XMLNSC.gpd:getProducerDetailsResponse, not OutputRoot.gpd:GetProducerDetailsResponse, which your code currently creates) |
|
Back to top |
|
 |
polydegmon |
Posted: Wed Nov 28, 2012 6:41 am Post subject: |
|
|
Novice
Joined: 07 Oct 2011 Posts: 11
|
I tried the method you suggested, however the FROM clause doesn't seem to work with the IDENTITY clause
Code: |
CREATE LASTCHILD OF OutputRoot.XMLNSC
DOMAIN('XMLNSC')
IDENTITY (XMLNSC.Folder)gpd:GetProducerDetailsResponse
FROM Environment.Variables.GPDVariables.Response.MSGSTATUS.*;
|
The code above gives the following error
Code: |
Description Resource Path Location Type
Syntax error. Valid options include: ; VALUE GetProducerDetails.esql GetProducerDetails_MFP line 478 ESQL
|
I was able to get it to work with the VALUE clause, but that doesn't copy the tree structure, it only takes the value of the element given, which in this case is NULL.
Code: |
CREATE LASTCHILD OF OutputRoot.XMLNSC
DOMAIN('XMLNSC')
IDENTITY (XMLNSC.Folder)gpd:GetProducerDetailsResponse
VALUE Environment.Variables.GPDVariables.Response.MSGSTATUS.*
|
Do you know of a way to get the VALUE clause to use the tree structure rather than the element itself? |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Nov 28, 2012 6:49 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
If you want to copy the tree structure, you either need to use SET or use CREATE... FROM... as you were trying to do.
I don't know why it doesn't like the FROM clause with TYPE NAME and NAMESPACE. You can maybe try reordering where you put the FROM, but other than that I'm out of ideas. |
|
Back to top |
|
 |
|