Member Login

Username
Password
Forget Password
New Sign Up
Search Forum

Buy Support
Incidents

If you can't find your answer in the FREE PUBLIC QDeveloper Forum, require URGENT Priority Support, or you need to send us private or confidential information:

Click Here
If you can't login and post questions or you are having trouble viewing forum posts:
Click Here
Callback
Support

If you live in USA, UK, Canada, Australia or New Zealand, you can leave us details on your question and request us to call you back and discuss them with you personally  (charges apply).

Click Here
 
Buy Support
Incidents
If you can't find your answer in the FREE PUBLIC QDeveloper Forum, require URGENT Priority Support, or you need to send us private or confidential information:
Click Here

Forum : SELECT not working correctly on pricelevelperitem file?Search Forum

Forum Home > QODBC - ODBC Driver for QuickBooks > QODBC v6 Forum

 New Topic 
 
 Post Reply 
[1]  
 SELECT not working correctly on pricelevelperitem file? 
 Author   Message 
  SaSGurus 
  
 Group: Members 
 Posts: 26 
 Joined: 2006-04-02 
 Profile
 Posted : 2006-10-03 02:28:41

Hi,

I'm trying to select records from PriceLevelPerItem for just one item.

We have 5 price levels for this item.

I am using the following query:

SELECT ListID, Name, PriceLevelPerItemItemRefListID, PriceLevelPerItemCustomPrice

FROM PriceLevelPerItem NOSYNC"

WHERE PriceLevelPerItemItemRefListID = ' < ListID of item > '

However, Only one price level is returned for this item, not the 5 (five) I expected.  It happens to be the first price level for this item.  This item has 5 custom prices in QB when I look into the price list there.

 

Any ideas?

Thanks,


 

 
Victor Nahigian
617-965-4615 x110
jvn@sysgbs.com 
 
  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2006-10-03 10:51:28

You're using the NOSYNC tag here, so the QODBC optimizer won't update the PriceLevelPerItem table. I did:

SELECT ListID, Name, PriceLevelPerItemItemRefListID, PriceLevelPerItemCustomPrice
FROM PriceLevelPerItem NOSYNC
WHERE PriceLevelPerItemItemRefListID = '20000-933272655'

and it showed all three lines for me. Try resyncing your PriceLevelPerItem table by doing:

sp_optimizefullsync PriceLevelPerItem

 

  Top 
  SaSGurus 
  
 Group: Members 
 Posts: 26 
 Joined: 2006-04-02 
 Profile
 Posted : 2006-10-06 04:56:29

Hi,

That worked great!  It discovered all our 65,000 records.  (Not the original 13,000).

However, now that I was able to completely populate a SQL Server table, and update prices there, I am now trying to send an UPDATE statement back to QB via QODBC for each item and price level.

When I send the first UPDATE statement, QODBC goes back to counting up the original 13,000 items.  It's like the re-sync never ran.  It forgot there were 65000 records.

The statement fails, presumably because the first item is not found in whatever "temporary" table that QODBC maintains.

(1.  Is there a way to make the re-sync "stick" ?)

We can't run an 8-hour re-sync every day.

Moreover, QODBC wants to loop through ALL the "temporary" table records FOR EACH update statement.

(2.  Is there a way to avoid this ?)

For 500 items and 5 price levels, that's 2500 repeats of looping through the table.  Obviously, at 15 minutes per loop, that would take quite a long time.)

Thanks,

Victor

 

 
Victor Nahigian
617-965-4615 x110
jvn@sysgbs.com 
 
  Top 
  Tom 
  6c3c1_sdk-qodbc.gif
 Group: Administrator 
 Posts: 5510 
 Joined: 2006-02-17 
 Profile
 Posted : 2006-10-06 13:32:44

To update a PriceLevelPerItem we used to do this:

UPDATE PriceLevelPeritem SET PriceLevelPerItemCustomPrice = 43.21, PriceLevelPerItemItemRefListID = 'F0000-933272656'  WHERE ListID = '30000-1197755980' AND PriceLevelPerItemItemRefListID = 'F0000-933272656'

Due to a bug in QODBC v6.00.00.155, you needed to use PriceLevelPerItemItemRefListID in the WHERE clause, later revisions QODBC v6.00.00.176 and higher now only need the ListID to be used in the WHERE clause.

To update a PriceLevelPerItem we NOW do this:

UPDATE PriceLevelPeritem SET PriceLevelPerItemCustomPrice = 43.21, PriceLevelPerItemItemRefListID = 'F0000-933272656'  WHERE ListID = '30000-1197755980'

Using the ListID is going to be faster as it's a QODBC jump-in for the PriceLevelPeritem table.

By the sounds of things, you have two different companyname.opt files, one with the 65,000 records and the original with 13,000 records in the PriceLevelPerItem table . If you are using QODBC linked tables in MS SQL Server, we often have to switch off the QODBC optimizer as the optimizer is only designed to work in single user mode. You most likely ended up with two companyname.opt files due to multiple user accounts being used. Scan your drive for their locations.

 

  Top 
 New Topic 
 
 Post Reply 
[1]  

Jump to