Monday, March 19, 2012

make changes to records

I'll make my post clearer now.
I have an application, the user are able to change records in this
application.
Also, there's a button called "What If".
After the user pressed the "What If" button, the user may change the records
and save it. When the user open the same record again, all the changes is
there. (Pls. notice that the user is still in the "What If" environment).
Somehow the changes are save to a mirror table record.
The changes would only affect the real records until the user press another
button called "Accept changes", in which all the changes in the mirrored
table would be adapted into the real record.
Is there any way i can do it via MS Sql Database?
Pls. advice and thanks in advanceThere are ways to do it in sql, the best way to do it in
sql will depend on your application and how frequently it
is used and concurrency requirements.
I would think you are generating a new session or
connection ID each time a user logs into the application,
use that ID and create a temporary work table by
prefix/suffixing the ID to temp table name. When use first
queries the database, populate this table with the
resultset, and then query this table to display data to
user. When user makes changes using What If button you
update this temp table. Only if user clicks on Accept
Changes button, update main table with rows from this temp
table.
Someone here may help you in writing exact code if you
provide tables and queries.
There are different and better ways to do this depending
on what you really want.
hth.
>--Original Message--
>I'll make my post clearer now.
>I have an application, the user are able to change
records in this
>application.
>Also, there's a button called "What If".
>After the user pressed the "What If" button, the user may
change the records
>and save it. When the user open the same record again,
all the changes is
>there. (Pls. notice that the user is still in the "What
If" environment).
>Somehow the changes are save to a mirror table record.
>The changes would only affect the real records until the
user press another
>button called "Accept changes", in which all the changes
in the mirrored
>table would be adapted into the real record.
>Is there any way i can do it via MS Sql Database?
>Pls. advice and thanks in advance
>
>
>.
>|||Hi,
I hope I can provide the table but I'm actually still in way to develop this
system. However, when you said :
"use that ID and create a temporary work table by prefix/suffixing the ID to
temp table name. When use first queries the database, populate this table
with the resultset, and then query this table to display data to user"
Does this mean I should first copy whole the involved table's contents and
put it in the temp table. Then, every changes would be made into the temp
table until the user presses "Accept Changes", which will copy the whole
thing from that temp table into the original table back.
Would this be wise, slow?
Pls. advice and thanks in advance.
pcPirate
"Guru" <gss20@.hotmail.com> wrote in message
news:1501801c3fa3f$4f92f2e0$a001280a@.phx.gbl...
> There are ways to do it in sql, the best way to do it in
> sql will depend on your application and how frequently it
> is used and concurrency requirements.
> I would think you are generating a new session or
> connection ID each time a user logs into the application,
> use that ID and create a temporary work table by
> prefix/suffixing the ID to temp table name. When use first
> queries the database, populate this table with the
> resultset, and then query this table to display data to
> user. When user makes changes using What If button you
> update this temp table. Only if user clicks on Accept
> Changes button, update main table with rows from this temp
> table.
> Someone here may help you in writing exact code if you
> provide tables and queries.
> There are different and better ways to do this depending
> on what you really want.
> hth.|||You don't need to copy the whole table to a temp table,
just copy 10, 20 or 100 rows the user will be looking at
at the time. You should consider putting a contraint on
the form that user cannot look at another set of rows
until he Accepts or Rejects the changes. That way you will
only have to deal with a small set of rows at a time.
hth.
>--Original Message--
>Hi,
>I hope I can provide the table but I'm actually still in
way to develop this
>system. However, when you said :
>"use that ID and create a temporary work table by
prefix/suffixing the ID to
>temp table name. When use first queries the database,
populate this table
>with the resultset, and then query this table to display
data to user"
>Does this mean I should first copy whole the involved
table's contents and
>put it in the temp table. Then, every changes would be
made into the temp
>table until the user presses "Accept Changes", which will
copy the whole
>thing from that temp table into the original table back.
>Would this be wise, slow?
>Pls. advice and thanks in advance.
>pcPirate
>"Guru" <gss20@.hotmail.com> wrote in message
>news:1501801c3fa3f$4f92f2e0$a001280a@.phx.gbl...
>> There are ways to do it in sql, the best way to do it in
>> sql will depend on your application and how frequently
it
>> is used and concurrency requirements.
>> I would think you are generating a new session or
>> connection ID each time a user logs into the
application,
>> use that ID and create a temporary work table by
>> prefix/suffixing the ID to temp table name. When use
first
>> queries the database, populate this table with the
>> resultset, and then query this table to display data to
>> user. When user makes changes using What If button you
>> update this temp table. Only if user clicks on Accept
>> Changes button, update main table with rows from this
temp
>> table.
>> Someone here may help you in writing exact code if you
>> provide tables and queries.
>> There are different and better ways to do this depending
>> on what you really want.
>> hth.
>
>.
>

No comments:

Post a Comment