How to get data from ref cursor in Biztalk? - cursor

I'm using OracleDB adapter to execute a stored procedure that returns ref_cursor.
Someone knows how to get the data from the cursor?
Any examples?

This topic is well documented at MSDN: http://msdn.microsoft.com/en-us/library/dd788392.aspx

Related

How to use print statement in sybase stored procedure when calling the stored procedure from application

I am using powerbuilder with Sybase ASE database. I am calling a stored procedure while doing an update from my application but I am getting an error in the stored procedure. I want to put some print statements in the stored procedure to check what the error is. How can I see the output of this print statement? How can I log the stored procedure?
Thanks in advance
Sharmistha
There is no log of these print statements and they are not considered part of the result set. They are in the same channel as the Sybase ASE error messages.
They should be returned to PowerBuilder, in the SQLCA, sqlerrortext is the field.
That's not how I used to debug stored procedures though. I found it easier to capture the parameters being passed to the stored procedure and use Sybase's ISQL command line tool, not the Java GUI, to see the error messages.
You can use function which will return the status code. Add "ON EXCEPTION RESUME" clause inside function and return global variable ##error to your application.
Use a custom error logging procedure to store data in a log table and read errors from it during or after execution.
Alternatively, you can try the PRINT statement inside the procedure to see if you can get the stdout output into PB.
Thank you all, I added some logs in powerbuilder instead to check for my problem.

Python mssql passing procedure user defined data type as parameter

My original purpose was to bulk insert into my db
I tried pyodbc, sqlalchemy and ceodbc to do this with executemany function but my dba checked and they execute each row individually.
his solution was to run procedure that recieve table (user defined data type) as parameter and load it into the real table.
The problem is no library seem to support that (or at least no example on the internet).
So my question is anyone try bulk insert before or know how to pass user data defined type to stored procedure?
EDIT
I also tried bulk insert query but the problem it requires local path or share and it will not happend because organizition limits
Sqlalchemy bulk operations doesn't really inserts a bulk. It's written in the docs.
And we've checked it with our dba.
Thank you we'll try the xml.

Error adding parameters to SQL Server stored procedure though VB code?

I am struggling to pass though parameter to a stored procedure I have written.
I’m really not sure what I am doing wrong here, but I’m struggling to get VB to pass parameters to SQL Server.
I am setting the #m_id above??
I would go out on a limb (because I don't see it in the above code) and say it's because you didn't set the cmd2.CommandType to StoredProcedure. By default, the command type is Text, which is used for inline SQL.

mysql stored procedure with iBatis

My application used Spring MVC+iBatis+JBoss7+MySQL. I have a stored procedure in mySQL, mapped it in my iBatis mapper.xml file and calling it via my sqlMapClient from my DAO.
If i execute the dao method once it works fine, but if i execute two calls to the same method with different stored procedure parameters(change in parameter means change in the result columns in my stored procedure), I get an exception that says my sql gramer is wrong. Looking at the logs i find that iBatis is trying to map my first query columns (result of my initial method call) to my result map. I even tried printing the hashcode of my dao class instance and they are different. Why is this happening when the procedure executes just fine when tried from DB clients like DbVislaulizer
For information I am using a HashMap as my resultclass in my mapper.xml. This returns me a list of linkedhashmaps in my dao..
Any help would be really handy.
Thanks in advance
Fixed it. Have to set the property remapResults="true" in mapper.xml
Eg
select id="myReport" parameterClass="Map" resultClass="java.util.LinkedHashMap" remapResults="true"

How to call procedures directly from interactive sql

Guys I'm trying to do some checking on a database domains and in order to do that I need to call and see directly substr procedure. Yet I'm getting an error that this procedure hasn't been found. How so? This is supposed to be built-in procedure. How can I call it and get result from it, directly in interactive sql?
First of all in Sybase ASE it is substring and not substr and it is a function so you need to use the select or something like that to run this..
try below
select substring('0000',1,2)

Resources