Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Cursor is empty
Message
 
 
À
24/04/2014 10:43:15
Luis Santos
Biglevel-Soluções Informáticas, Lda
Portugal
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01598937
Message ID:
01598976
Vues:
36
>Hello Naomi
>
>could give me an example on how to return the String ?
>
>i change to :
>
>IF u_sqlexec(msel)
>msg(meuXML) -- the message was empty
>Else
>msg(msel)
>Endif
>
>Many thanks,
>Best regards
>Luis Santos

May be:
declare @xml XML

select @xml = (SELECT(
SELECT top 1
    1 AS Versao,
    220 AS coddoc,
    5 AS tipodoc,
    'EUR' as codmoeda,
    c.obrano AS numdoc,
    c.dataobra AS datadoc,
    Rtrim(c.nome) AS localentrega,
    Rtrim(c.morada) AS moradaentrega,
    Rtrim(c.local) AS loclocalalentrega, 
    Rtrim(c.codpost) AS codpostentrega,
    c.datafinal AS dataentrega,
    c.datafinal AS datalimite,
    5600000561737 AS glnfornecedor,
    'Planitoi - Importação e Exportação, S.A.' AS nomefornecedor, 
    'Zona Ind. do Roligo' AS moradafornecedor,
    501167323 as ncontfornecedor,
    cl.glncl as glncliente,
    cl.ncont AS ncontcliente,
    Rtrim(c.nome) AS nomecliente,
    Rtrim(c.morada) AS moradacliente,
    Rtrim(c.codpost) AS codpostcliente,
    Rtrim(c.local) AS localcliente,
    '4524-909' AS codpostfornecedor,
    (SELECT COUNT(*) FROM bi (nolock) WHERE bi.bostamp = 'SEG13072566466,200000002') AS numlinhas,    
    (select cl.eancl from cl (nolock) where cl.no = c.no and cl.estab = 0) AS eancliente,
    5600000561737 AS eanfornecedor,
    Rtrim(c.obs) AS observacoes,
    cl.glncl as glnentrega,
       (
       SELECT 1 AS Versao,
	   ROW_NUMBER() OVER (ORDER BY Linh.lordem asc) AS numlinha,
		  Rtrim(Linh.codigo) AS codean,
		  Rtrim(Linh.ref) AS refcliente, --rever tem de ser a referencia da TOYS R US	 
		  Rtrim(Linh.ref) AS referencia,
		  Rtrim(Linh.design) AS descricao,
		  Linh.unidad2 AS unidalternativa,
		  Linh.ettdeb AS precoliquido,
		  Linh.qtt AS quantidade,
		  Linh.uni2qtt AS quantalternativa 
       FROM BI Linh (NOLOCK)
       WHERE Linh.bostamp = 'SEG13072566466,200000002'
	  FOR XML PATH('Linhas'),TYPE 
       ) 
        
        FROM bo c (NOLOCK)
        LEFT JOIN cl (nolock) ON c.no = cl.no AND cl.estab = 0
       where c.bostamp = 'SEG13072566466,200000002'
FOR XML PATH('Documento'),ROOT('VFPDATASET'),TYPE)) -- verify the syntax in SSMS to make sure it works

SELECT CAST(@xml AS VARCHAR(max)) as Result
In this case assuming you correct the above code you'll get back your XML as a string (one row cursor).
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform