Solved

Stored Procedure Slow through Powerbuilder

Posted on 2010-08-30
4
1,028 Views
Last Modified: 2013-12-26
I have a stored procedure that executes within 3 minutes from the SQL Server 2005 console but when I call the same procedure from within my Powerbuilder App it takes 40 minutes.

Are there any things to look for as to why there would be such a huge difference in run times?

Thanks,
0
Comment
Question by:byteboy11
  • 2
  • 2
4 Comments
 
LVL 14

Expert Comment

by:sandeep_patel
ID: 33568482
Is there something you call the procedure in a loop from powerbuilder?
Are you calling procedure from datawindow?
What drivers you are using for database connection?
It would be better if you paste the code here about how you call it from both sql console and powerbuilder for comparison...

Regards,
Sandeep
0
 

Author Comment

by:byteboy11
ID: 33568977
There is no looping in the PB side code.
Not calling from a datawindow just calling directly
Using ODBC drivers


This is the PB Code(1 hour to run):
DECLARE sp_import_my_data PROCEDURE FOR
sp_import_my_data :ai_do_insert,:il_emp_id,:is_data_desc,:li_override
USING SQLCA ;
EXECUTE sp_import_my_data ;


This is how I'm running it from the sql 2005 query analyizer window(3min to run):
exec sp_import_my_data 1,'1','test import1',0
0
 
LVL 14

Accepted Solution

by:
sandeep_patel earned 500 total points
ID: 33646902
Instead of ODBC, try to use SQL Server Native Drivers. Also in ODBC profile confirm 'Trace ODBC API Calls' is not checked on 'Options' tab or not mentioned in your SQLCA connection profile.

Is this the only procedure takes long time or the same behaviour with any procedure call?

Regards,
Sandeep
0
 

Author Closing Comment

by:byteboy11
ID: 33961479
good answer
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now