Re: Query regarding Multiple parameter set using OLEDB



Our OleDBPro at www.udaparts.com well support multiple set of parameters by
default. See the samples OraMulti and OleDBExcel. The opened source code
will guide you to use this feature. I think that Oracle OLEDB provider has
an excellent support to multiple set of parameters, which means that you can
use the feature to fast execute update, insert, delete and strore procedures
etc.





<zunilp@xxxxxxxxx> wrote in message
news:1177760373.922313.132010@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi,
I am now trying to write a consumer application which uses SQLOLEDB/
SQLNCLI to insert/update/delete data. I wish to send multiple set of
parameters with same sattement(either INSERT/UPDATE).
What I am doing is
1. For the first set of parameter
I call ICommandWithParameters::SetParameterInfo()
I call CreateAccessor
2. For all set of parameters i set the value in a seperate
buffer(Each set is seperate buffer). which is stored in an arry of
pointers
char *paramSetBuffer[1024];
Forb loop for each set of parameter {
char *paramBuffer = (char *)_alloca(paramBufLen* sizeof(char));
paramSetBuffer[pramsetCount] = paramBuffer ;
}

3. Last after setting all, in the DBPARAMS structure
DBPARAMS::pData = paramSetBuffer;
DBPARAMS::cParamSets = <<number of parametersets>>
DBPARAMS:hAccessor = myaccessor;

4. Then call ICommand::Execute passing the DBPARAMS.

But then I get an error saying "Invalid parameter values"
But if I pass DBPARAMS::pData = paramSetBuffer[0];
DBPARAMS::cParamSets =1;
Then the first set of values is Inserted.

My questions
1. How I can pass multiple parameter sets to DBPARAMS::pData ? Can I
pass a array?
2. Shall I have to create accessor each time
3. Shall I have to call setPrameterInfo each time.

Is thee any example on the net which explains this?

Reagrds
zunilp



.


Loading