Normal Topic Posting using Mass Update (Read 852 times)
DTB
Member
*
Offline


No personal text

Posts: 2
Joined: Jul 18th, 2004
Posting using Mass Update
Jul 18th, 2004 at 8:14am
Print Post Print Post  
I have tried without any success to post a value from a database "Customer Payments" to a database "Jobs".

I am using the MASS UPDATE capability of Sesame but this is not working.

my MASS UPDATE program statement is;

xpost("@Fn",Inv_No,"Jobs!Job_Inv_No", Amount,"Payments","ADD")

My expectation is that the money value in the Amount element in the Customer Payments database will be add to the Payments element in the Jobs database where the Inv_No and Inv_Job_No are the same.

When I run the mass update nothing changes in the Jobs database.

Is it obvious what I am doign wrong?
Does Sesame allow the use of XPost in Mass Updates?
Has anyone been here before?

DTB

  
Back to top
 
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: Posting using Mass Update
Reply #1 - Jul 18th, 2004 at 12:07pm
Print Post Print Post  
Quote:
I have tried without any success to post a value from a database "Customer Payments" to a database "Jobs".

I am using the MASS UPDATE capability of Sesame but this is not working.

my MASS UPDATE program statement is;

xpost("@Fn",Inv_No,"Jobs!Job_Inv_No", Amount,"Payments","ADD")


The double quotes around the @fn function force SBasic to interpret that literally, instead of running the functions. So, SBasic is looking for a file actually named "@fn". Try:

xpost(@fn, Inv_No, "Jobs!Job_Inv_No",  Amount, "Payments", "ADD")
if(@error)
{
   writeln("There is an error in the XPost")
}

Quote:
Does Sesame allow the use of XPost in Mass Updates?
Has anyone been here before?

DTB


Sesame does allow XPost in Mass Update, as long as you are not in the preview mode of the Designer. I would recommend however, that you mass update the the "Jobs" database and pull from the "Customer Payments" database instead (probably using one of the XLookup functions). A data pull is always preferrred over a push. A pull allows for more data checking and error recovery if needed.
  

Mark Lasersohn&&Programmer&&Lantica Software, LLC
Back to top
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: Posting using Mass Update
Reply #2 - Jul 18th, 2004 at 2:39pm
Print Post Print Post  
Edited note at top of posting:
My next statement about users needing to be out of databases is incorrect:  It was a thought left over from Q&A work habits.  Corrected by Erika in subsequent posting.
=====================================
To Do Mass Update means all other users need to be out of Database. 

The method shown here by DTB means that all users in must be out of Customer Payments database.

By doing the suggested Mass Update "pull" into Jobs means that all users must be out of the Jobs database.

XPost allows updating records while users are still in the databases.  By using XPost then users can still stay in Jobs and Customer Payments. 

Another alternative is to do the XPost when closing the record Customer Payments record vs. using Mass Update, This can be done based on some defined conditions.  A test for accurate completion can be done by reading the destination values before and after the XPost function. : Read value of Payments, Xpost to Payments, Read value of Payments to confirm correct result.  If error, provide reaction to error, If no error, continue.  This also provides for "real time" values in Jobs vs. waiting for Mass Update "batch processing" to happen.

I know the real world conditions control which methods you have to use.  But when the only tool you have is a hammer, then all the problems look like nails.  Just a suggestion to provide another tool.
  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Posting using Mass Update
Reply #3 - Jul 18th, 2004 at 3:01pm
Print Post Print Post  
Quote:
To Do Mass Update means all other users need to be out of Database.


This was true for Q&A. It is not the case for Sesame. Sesame can Mass Update a database which is in use by other users. If it happens to encounter a record that is locked by another user, it will write an error to the log. You can also catch this condition in the Mass Update program and write your own log, throw a message, or take other action.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Bob_Hansen
Senior Member
Members
*****
Offline


WOW, They have the Internet
on computers now!

Posts: 1861
Location: Salem, NH
Joined: Nov 24th, 2002
Re: Posting using Mass Update
Reply #4 - Jul 18th, 2004 at 3:19pm
Print Post Print Post  
Quote:
Sesame can Mass Update a database which is in use by other users
Excuuuuse meeee!
Thanks for that clarification.  Something new every day  Smiley
So many old habits to break.....Smiley

That problem must have looked like a nail, because it took a "Hammer"  to fix it.

  



Bob Hansen
Sesame Database Manager Professional
Sensible Solutions Inc.
Salem, NH
603-898-8223
Skype ID = sensiblesolutions
Back to top
IP Logged