'No column name was specified for column 1 of 'sp'
I have following query:
SELECT s."Description",
sp.*
FROM "Supplier" as s
OUTER APPLY (
SELECT p."Id", p."Description", p."Price"
FROM "Products" as p
WHERE p."SupplierId" = s."Id"
FOR JSON auto
) as sp
I'm trying to build json array according to OUTER APPLY result but I stuck here because there is an error No column name was specified for column 1 of 'sp'. I found similar question here on stackoverflow, but there is no example with outer apply.
Can you explain me what is wrong with this query?
Solution 1:[1]
Are you setting a tab value for a tab that is in the template already?
In that case, your JSON looks good to me, with the caveat that your API call's value for the tabLabel attribute must exactly match the Data label value set for the tab in the template.
So in the DocuSign web app, you need to check that the Data label field is set to exactly field1 with the same capitalization.
Here's a live working example that sets the value of a tab defined in the template. The example also changes a recipient in the template to become an embedded recipient. But that's beside the point.
Dynamically adding a new tab
You can also use composite templates to add a brand new tab to the envelope. You just need to define the tab and include the document ID that the tab will be placed on, the page number, x, and y values. Example:
"envelopeDefinition": {
"status": "sent",
"compositeTemplates": [
{
"compositeTemplateId": "1",
"serverTemplates": [
{
"sequence": "1",
"templateId": "36f7e831-9228-4273-929e-f047c133c08b"
}
],
"inlineTemplates": [
{
"sequence": "1",
"recipients": {
"signers": [
{
"clientUserId": "1000",
"email": "[email protected]",
"name": "Signer Name",
"roleName": "signer",
"recipientId": "1",
"tabs": {
"textTabs": [
{
"tabLabel": "signer_title",
"value": "Manager"
},
{
"documentId": "1",
"locked": "true",
"value": "Added via the API. Office:",
"font": "Helvetica",
"fontSize": "Size12",
"pageNumber": "3",
"xPosition": "40",
"yPosition": "428"
}
],
"listTabs": [
{
"documentId": "1",
"font": "Helvetica",
"fontSize": "Size12",
"locked": "false",
"required": "false",
"pageNumber": "3",
"xPosition": "190",
"yPosition": "428",
"listItems": [
{
"text": "San Francisco",
"value": "SF"
},
{
"text": "London",
"value": "LON"
},
{
"text": "Paris",
"value": "PAR"
},
{
"text": "Jerusalem",
"value": "JLM"
},
{
"text": "São Paulo",
"value": "SP"
}
]
}
]
}
}
]
}
}
]
}
]
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Larry K |
