Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sending XML to a SQL Stored Procedure from VFP
Message
General information
Forum:
Visual FoxPro
Category:
XML, XSD
Miscellaneous
Thread ID:
01502201
Message ID:
01502415
Views:
41
It's 2005 Express...

>Hi Menachem,
>
>What is your SQL Server version and how big is the file you're going to send?
>
>If it's SQL Server 2008, I'm thinking, can you use table variable instead?
>
>E.g.
>
>text to lcSQL textmerge noshow
>  declare @Tbl table (Field1 int, Field2 varchar(30))
>  insert into @tbl
>  values (<<>>,<<>>) -- you can use here a different way to merge if you need to pass many records (using textmerge)
>  execute mySP @Tbl
>endtext
>
>
>>HI all,
>>
>>I have a desktop app and I want to send a lot of records up to SQL in one batch. I am using someone else's code and he has it written to accept XML. I have tried to cook up the XML to send it off and, although I get a succesful return, nothing is happening.
>>
>>I am using CURSORTOXML() to create the XML on the VFP side and am sending it through to the SQL procedure something like this...
>>
>>
>>*-- lcXML is a variable with the XML code in there as produced by CURSORTOXML()
>>*-- loDataLib is my class that handles functionality for communications with SQL back ends
>>*-- dbExec is a wrapper method to SQLExec. The handle and connect are all handled internally
>>*-- Syntax is dbExec(<cmd>,[<cursor name for returned data>])
>>
>>lcSQL = "EXEC p_StoredProc '" + lcXML + "'"
>>loDataLib.dbExec(lcSQL)
>>
>>
>>The command executes and SQL doesn't seem to complain but I am getting no added records to the database.
>>
>>I know I am doing something wrong... I am just not sure what. Any assistance would be appreciated.
Menachem Bazian, CPA
President
BC Consulting Services, Inc.
973-773-7276
Menachem@BazianCentral.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform