473,811 Members | 2,770 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Transaction-style Inventory?

Hello, I'm looking for a little input on this situation.

I'm working on an inventory system and was thinking that I'd like to
build it similiar to the way a bank keeps track of your funds.

If you look at at bank statement, for each line item, you'll normally
see at least date/time, description, amount (plus or minus value), and
balance.

In my inventory system, the amount and balance would be a count of the
items used or transferred instead of money.

Does this sound reasonable? Or is there a better design? I am planning
to connect the inventory system to a few different ordering interfaces,
and I think it would work well if I can dump transactions into the
inventory instead of incrementing and decrementing counts.

The only problem I see with this, is if I want to implement the balance
part of it with each record....

I can't think of a way to do that currently.

I can certainly use a trigger in the database to retrieve the most
recent transaction and update the balance field for one record inserted
at a time, but if a list of transactions is dumped into the inventory
system at once, I'd have to compensate for that in the trigger.

Ideas?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #1
2 1889
On 15 Sep 2004 22:01:11 GMT, Kenneth Courville wrote:
Hello, I'm looking for a little input on this situation.

I'm working on an inventory system and was thinking that I'd like to
build it similiar to the way a bank keeps track of your funds.

If you look at at bank statement, for each line item, you'll normally
see at least date/time, description, amount (plus or minus value), and
balance.

In my inventory system, the amount and balance would be a count of the
items used or transferred instead of money.

Does this sound reasonable? Or is there a better design? I am planning
to connect the inventory system to a few different ordering interfaces,
and I think it would work well if I can dump transactions into the
inventory instead of incrementing and decrementing counts.

The only problem I see with this, is if I want to implement the balance
part of it with each record....

I can't think of a way to do that currently.

I can certainly use a trigger in the database to retrieve the most
recent transaction and update the balance field for one record inserted
at a time, but if a list of transactions is dumped into the inventory
system at once, I'd have to compensate for that in the trigger.

Ideas?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Balance can be a field in a view based on your table, like this:

CREATE VIEW InvWithBalance
AS
SELECT tID, tDate, SKU, Qty,
(SELECT SUM(tQty) FROM InvTransactions AS T2
WHERE T2.SKU = T1.SKU
AND T2.tID < T1.tID) AS [Balance]
FROM InvTransactions AS T2
Jul 20 '05 #2
ah.. silly me

Thanks.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
7528
by: noah | last post by:
Does PHP have a feature to associate Cookie sessions with a persistent database connection that will allow a single transaction across multiple HTTP requests? Here is how I imagine my process: I have an series of interactive HTML forms. The user begins a Cookie session. A database connection is opened and a transaction is begun. After the user goes through any number of pages where they update the database they finish on a page where...
10
13352
by: TZoner | last post by:
1) Can one find the location of the 'Transaction Log' at: <Hard Disk>\Program Files\Microsoft SQL Server\MSSQL\Data\MyDb_Log.ldf? 2) Is it safe to delete it, as SQL will create a new Transaction Log when it realises none already exist? 3) When trying to do 2) I get error message that file is in use, even though SQL Server is closed. Any suggestions? 4) Can anyone shed light on the error message 'Write on ... <my path
3
7577
by: Thiko | last post by:
Hi I take one nightly full database backup at 02:00 and backup the transaction log to one backup set every 15mins. The commands to do this are as follows and are set up to run as database jobs: -- Database Backup BACKUP DATABASE TO WITH NOINIT ,
2
2387
by: Deepak Mehta | last post by:
i have to update two tables from ASP pages with same data but i want that both of them should be updated at one time. If either of them is not updated then my transaction should roll back.I want this thing to be in a stored procedure. so that i have to write an execute statement only on the ASP page and pass the parameters. Looking forward for ur reply DEEPAK
1
439
by: Avanish Pandey | last post by:
Hello All We have 3 differen services (in 3 different server) Service A,B,C . We want to implement distributed transaction when call methods of B and C from A. Is it possible? if yes then how? I have read the doc regarding this: http://www.developer.com/net/asp/article.php/3385631 but it will not work when methods are in different services on
2
3899
by: John Lee | last post by:
Hi, I have few questions related to .NET 2.0 TransactionScope class behavior: 1. Check Transaction.Current.TransactionInformation.DistributedIdentifier to identify if distributed transaction is used - is it accurate way? 2. I have the following code blocks - In code block 1, the first check the DistributedIdentifier is ALL 0s so it
15
10015
by: Zeng | last post by:
Hi, The bigger my C# web-application gets, the more places I need to put in the tedious retrying block of code to make sure operations that can run into database deadlocks are re-run (retried) 3-4 times and give up if after that it's still in deadlock. I'm very sure that many experienced people out there already deal with this issue somehow. Is there an alternative to it? Thanks for your comments and suggestions.
1
2149
by: Hubert Fröhlich | last post by:
Hi list, when doing a large Insert I get in the logfile: 2004-08-03 07:23:46 LOG: recycled transaction log file "000001BA000000BD" 2004-08-03 07:34:00 LOG: recycled transaction log file "000001BA000000C2" 2004-08-03 07:34:00 LOG: recycled transaction log file "000001BA000000C3" 2004-08-03 07:34:00 LOG: recycled transaction log file "000001BA000000C4" 2004-08-03 07:34:00 LOG: recycled transaction log file "000001BA000000C5"...
1
8347
by: Matik | last post by:
Hi to all, Probably I'm just doing something stupid, but I would like you to tell me that (if it is so), and point the solution. There ist the thing: I' having a sp, where I call other sp inside. The only problem is, the name of this inside sp is builded variously, and executed over sp_executesql:
2
2143
by: Ryan Liu | last post by:
Hi, I have few db write and read to execute, so I use transaction. Is that a problem or is that a regular way that I only use transaction on some cmds only, and other cmds I do not use trasaction, esp those read actions, or even use another dbconnection to read? BTW, what does "open table" menas? Is that table only be "open" when someone read or write it. Once all user finish read or write the db table, the
0
9605
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10393
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10405
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10136
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9208
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5556
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5697
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3871
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3020
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.