LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Retreving output parameter with stored procedure returns invalid pointer error

Hello,
 
When retrieving output parameter of stored procedure using Database connectivity toolkit, error "Invalid Pointer" is returned.
Steps performed:
1. DB Tools open connection.vi
2. DB Tools Create Parameterized Query.vi
3. Db Tools Set Parameter value.vi - (values set for input parameter and output parameters)
4. DB Tools Execute Query.vi
5. DB Tools Get Parameter values.vi (to get the return value and 2 output parameter values).
6. DB Tools Object Free.vi (where I also tried to Get Parameter Values after freeing the recordset reference) 
 
The error occurs at step #5 - Get Parameter Values.vi for output parameter (return value does not return error).
 
Below is the code and explanation of error:
 
"Error -2147467261 occurred at Cmd Get Integer Parameter Value (C).vi->Cmd Get Integer Parameter Value (CR).vi->DataCollector.vi
Possible reason(s):
Invalid pointer
 in Cmd Get Integer Parameter Value (C).vi->Cmd Get Integer Parameter Value (CR).vi->DataCollector.vi"
 
I also tried the steps in kb I found at NI's site for setting the output parameter :
 
and the kb at Microsoft :
 
Does anyone knows the cause of the error and how to fix it?
 
Thanks,
Rachana
 
0 Kudos
Message 1 of 8
(3,892 Views)
Have you reviewed this discussion forum post? It may have some helpful comments, since it explicity covers an issue with the same error code. It contains discussion on the abilities of the Database toolkit and special precautions you must take when importing data.
 
Cheers,
Emilie Kopp | National Instruments
0 Kudos
Message 2 of 8
(3,853 Views)
Hi! Emilie,
 
I did see that and few other kb on NI's site. I am still getting that error at DB Tool Get Parameter.vi.
This occurs when the VI reads the value of the first output parameter.
 
Any other idea why this would occur...the error states Invalid Pointer.
 
Thanks,
Rachana
 
0 Kudos
Message 3 of 8
(3,830 Views)

Hello Rachana,

What is the data type of these parameter values? Are you using the Database Variant to Data.vi to convert your data to a LV type? If so, what type (string, numeric, etc) are you assigning?

And just to be thorough, what version of LV are you using?

I look forward to helping you get to the bottom of this inconvenience.

Cheers,

Emilie Kopp | Applications Engineer | National Instruments

0 Kudos
Message 4 of 8
(3,802 Views)

Hi, Rachana

You don't mention which database you are using, which drivers you call to connect to the database, or what datatypes (input and output parameters) are involved. 

Did you use the database's query tool to double-check that you are calling the stored procedure with the correct parameters?

0 Kudos
Message 5 of 8
(3,787 Views)

Hello All,

I got the issue resolved. Instead of giving the direction as output, I changed it to input/output and the datatype to double. Although in the stored procedure(SQL2005), I handled to clear the return value.

Looks like that there is a bug in LV8.2 with output parameter setting.

"Error -2147467261 occurred at Cmd Get Integer Parameter Value (C).vi->Cmd Get Integer Parameter Value (CR).vi->DataCollector.vi
Possible reason(s):
Invalid pointer
in Cmd Get Integer Parameter Value (C).vi->Cmd Get Integer Parameter Value (CR).vi->DataCollector.vi"
is returned if null is read in the varaint.

Thanks for all the help and suggestions.
Rachana

0 Kudos
Message 6 of 8
(3,768 Views)

Hello Rachana,

Thank you for sharing your solution. I would like to perhaps encorporate this into NI's web content to help with future customer issues.

You mentioned in your solution that you changed the data type to Double. What data type had you previously assigned to your parameter?

Cheers,

Emilie

0 Kudos
Message 7 of 8
(3,766 Views)
Oops. I now see you had the variant set as Null, so I believe you had left the data type unassigned. Please correct me if I'm wrong.
Thanks!
Emilie
0 Kudos
Message 8 of 8
(3,764 Views)