Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using spoon to look for Devices that have several attributes that define its location, and then create a Cabinet in that location if one doesn't exist. Is there an operation that lets me get a cabinet.id value that is 1 greater than the highest currently in the table before each row is inserted.

Here's some pseudo code for what I want to do:

  • Find Devices with location data AND not with cabinet_id
  • Create a Cabinet record in the location of the first Device record returned, using the next Cabinet.id
  • Get the next Device, ensure a Cabinet was not created during this operation matching this Devices position, create a Cabinet record with the next Cabinet.id

Thanks for any guidance.

share|improve this question
    
I'm not familiar with pentaho, but seeing as no one else has responded. I'm initially curious what the business requirement is for knowing the cabinet_id before inserting a new location? Why can't it create the new location and return the incremental PK cabinet_id that was created as part of the insert? – Delux Apr 16 '13 at 15:41
    
The location is a grid_location_id, data_center_id, and room_id. It isn't an entity so therefore can't be created. – Joe Essey Apr 16 '13 at 17:03
    
Well, this question has been here a while and might be better asked on SO, but I think the Combination lookup-update step is what you're looking for. If you're still interested, let us know if that will work for you. – Brian.D.Myers Jan 15 '14 at 19:19

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.