General information
Forum:
Microsoft SQL Server
Title:
XML generating NULL values
I have a SP that uses the xml_prepare function to create a table of an xml file passed to it. I have used this in the past but now when I try to use the same logic I get a table of NULL values. The VFP coding is as follows:
Select DISTINCT STRTRAN(ndc,'-','') as ndc From er3 Into Cursor ndctemp readwrite -- this creates the needed cursor
=contengine(sdate,edate,"ndcusage")
in the function I have this code:
ndcnum = ''
Select ndctemp
If Reccount('ndctemp')>0
=Cursortoxml("ndctemp","ndcnum",2)
Else
x=Messagebox("No saletypes were detected to send to SQL server. Please verify.",16,"Data validation.")
Return
Endif
sdate=Dtos(date1)
edate=Dtos(date2)
hconn=SQLConnect("pbisqlmemsales")
lcsql="exec contract_engine ?ndcnum,?sdate,?edate"
lnResult=SQLEXEC(hconn,lcsql,"&cndccursorname")
In the sp I have this code:
ALTER procedure contract_engine ( @ndcnum text,
@sdate datetime,
@edate datetime)
as
declare @iDoc int
execute sp_xml_preparedocument @iDoc output, @ndcnum
SELECT *
INTO #ndcnums
FROM OPENXML ( @idoc , 'VFPData/ndctemp')
WITH ( ndcnum char(11) )
select * from #ndcnums
When I pass a cursor of eight numbers to this procedure (the whole procedure is much longer but it is messing up at this first part) I recieve a table with 8 records that have NULL for values. What am I missing here?!?
Thanks in advance
Kelly
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only