Select Query in iSeries is running very slow

345295 pts.
Tags:
AS/400
iSeries
SELECT
I'm writing a query to pull different sets of data from a single table.  I tried the following SELECT query using Data Transfer in iSeries:

SELECT INFOR.PFAC , INFOR.PPAR FROM MAINSYSTEM.INFOR INFOR WHERE ppar = '240XXX2A'
It takes upwards of 4 minutes for the query to return the data I need. Here is what I did - why is it running so slow?

First, I ran

Driver={Client Access ODBC Driver (32-bit)}
Once connected, I did the following to try and get the data.

Dim MyODBCConnection As New Odbc.OdbcConnection("Driver={Client Access ODBC Driver (32-bit)};" & _
"System=163.201.28.55 ;Default Collection=bpcshv81.PEXPLOSNA;")

'Open the connection
MyODBCConnection.Open()
Dim Table_BOM As New DataTable
Dim Table_BOM_Fill As New Odbc.OdbcDataAdapter("SELECT PEXPLOSNA.PFAC , PEXPLOSNA.PPAR FROM    MAINSYSTEM.INFOR  PEXPLOSNA WHERE ppar = '240XXX2A'", MyODBCConnection)

Table_BOM_Fill.Fill(Table_BOM)
DataGridView1.DataSource = Table_BOM

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta

    It's not clear what the actual problem is. First you say:

    I tried the following SELECT query using Data Transfer in iSeries:

    But then you go further by showing apparent VB coding.

    Is the problem with Data Transfer or with your VB programming? Those are two different things. I suspect that you're not actually using Data Transfer, and that was just an incorrect reference. If the SQL statement that was shown was run through Data Transfer, it's likely that it would run in a few seconds unless millions of rows were actually returned to the PC. And if that's the degree of volume that passes between the PAC and the server, then it makes sense that it'll a couple minutes or so.

    It takes upwards of 4 minutes for the query to return the data I need.

    You said that you "pull different sets of data from a single table". Does it always take a similarly long time regardless of the criteria for selecting rows? Or are some sets of data fast while others are very slow? And if there are widely varying response times, are they consistent if the same criteria are used with multiple queries?

    Tom

    125,585 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following