DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use stored procedures in DIAdem and Can the stored procedures be used to return values?

Can anyone please tell me how to use stored procedures in diadem and to return values from it. Its really important, can you please answer it at the earliest.

Thanks In advance
spiya
0 Kudos
Message 1 of 6
(4,236 Views)
If by stored procedure you mean a procedure written in VBSCRIPT such as

sub Add(X,Y,Result)

result = X + Y
end sub

you could simply rewrite this as

function Add(x,y)
Add = x+y
end function

When you call this from your main code you would use

Dim Result

Result = Add(1,2)

Result would now get the returned value.

If this is not what you mean please let me know. Have a great day and I hope this helps.
0 Kudos
Message 2 of 6
(4,236 Views)
Or do you mean stored procedures in an SQL database?
0 Kudos
Message 3 of 6
(4,236 Views)
Yeah I meant Stored Procedures in SQL Database
0 Kudos
Message 4 of 6
(4,236 Views)
Can anyone please answer this to me quickly.

Thanks,
0 Kudos
Message 5 of 6
(4,236 Views)
Hi Spria,

I'm very sorry for the mix-up, I thought Allen was going to answer you back with the particulars that we found out. Check out the attached Word document and the below tidbits:

The built-in DIAdem ODBC functions {SQL_...()} can only call stored functions, which return a scaler result {found then in SQL_Result(1,1)}. The syntax for this with an ORACLE db is

"select function(parameters) from package"

...where package defaults to "dual" if you don't use your own package.

There might be exceptions to that though, and the syntax will be different for other databases. Note that stored ORACLE procedures can NOT be called from the ODBC functions, instead you must use either ADO function calls in the DIA
dem VBScript or the OO4O COM wrapper that ORACLE provides (this is described in further detail in the below Word document).

Hope this helps,
Brad Turpin
DIAdem Product Support Engineer
National Instruments
0 Kudos
Message 6 of 6
(4,236 Views)