Normal Topic xpost, can it do better than just add & subtract? (Read 1146 times)
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
xpost, can it do better than just add & subtract?
May 1st, 2007 at 7:00pm
Print Post Print Post  
We have been using xpost to post the value in the external database since earlier version of Q&A. Q & A 4.0 also allow some programming execution when posting done and that was very helpful. Can Sesame xpost and execute the Element Change event programming in the external database? Technically element is changed with xpost in the external database so, it is not against the grain, philosophy  and working of the database but this will land enormous power to manipulate the external database.

I understand certain functions and commands may not be made available until the form is opened but whatever tools available to work on the external database will be powerful addition to ammunitions  available. 

What tools do we have in Sesame 1.1.4, as it stands now, to change the external database? I am sure something must be there in upcoming release of ver. 2.0.

Bharat
« Last Edit: May 2nd, 2007 at 12:05am by Bharat_Naik »  
Back to top
 
IP Logged
 
Carl Underwood
Senior Member
Members
*****
Offline



Posts: 1351
Location: New Hampshire
Joined: Mar 11th, 2003
Re: xpost, can it do better than just add & subtra
Reply #1 - May 2nd, 2007 at 12:34am
Print Post Print Post  
Why not use XLookup functions to gather data from the external DB, perform the calculations locally in the current DB, and then just post the final results back to the external DB?
  


Carl Underwood
CDU Computer Consulting LLC
Epsom, New Hampshire
Back to top
IP Logged
 
The Cow
YaBB Administrator
*****
Offline



Posts: 2530
Joined: Nov 22nd, 2002
Re: xpost, can it do better than just add & subtra
Reply #2 - May 2nd, 2007 at 12:46am
Print Post Print Post  
Quote:
I am sure something must be there in upcoming release of ver. 2.0. 


Take a look at the XResultSet commands. Essentially, they provide fairly complete interaction with the records in an external application. Because they can perform multiple operations on a result set without reretrieving that result set for each operation, they are much more efficient than the XLookup / XPost family of commands.
  

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


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: xpost, can it do better than just add & subtra
Reply #3 - May 2nd, 2007 at 12:47am
Print Post Print Post  
Carl, I thought about it but it will be posted to only one element. What about the programming execution affects a few other elements in the external database plus some more data manipulations. I believe xpost with capability to execute element change event programming will be a lot more powerful and straight forward.
  
Back to top
 
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: xpost, can it do better than just add & subtra
Reply #4 - May 2nd, 2007 at 12:57am
Print Post Print Post  
Quote:
Take a look at the XResultSet commands.


Mark, I knew something will be there in version 2.0. Will go through xResultset commands but if you say they are more efficient, I take your word for it.  I just pointed out what my little mind thought and of course I do not have the big pictures that Lanticans are having. Thanks.

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



Posts: 2530
Joined: Nov 22nd, 2002
Re: xpost, can it do better than just add & subtra
Reply #5 - May 2nd, 2007 at 1:14am
Print Post Print Post  
I certainly won't grant that your mind is in any way "little", and I always wish I had a bigger picture of how Sesame will be used. The users never fail to surprise me much in the same way they surprised Andreas with Q&A 5.0.

There are several problems with XPost running on change code. Chief among these is the danger of "pushing" as opposed to "pulling" data. It causes a inherent data blindness that would be made even more treacherous by code running blind where no one can see what it is doing. It would have to be very carefully crafted code.

Additionally, in Sesame all code (other than Application Open code) is atteched to a particular form, not to a record definition or database. XPost, on the other hand operates directly on records on the server, without specifying one form or another. In that Sesame can have many forms all serving the same database or record definition, the question arises, which form's code applies.

Even if only one form (and at least one) is attached to the database, there are a lot of Sesame commands that are not possible without a user interface. We would need some way to limit the programming only to those commands that can operate directly on fields and records, without forms or elements. And, should we be able to affect that limitation, we would still be very limited in error reporting, and may have to leave a record an "undefined state" with uncommitted changes.

Also, because we are true client / server, as opposed to file sharing / locking, there is a small possibility that between multiple XLookups and XPosts to affect the changes needed, another user could, while using the external application introduce a new record or change an old one so that in the midst of operations the newly altered record becomes the record to be affected by the XPost, instead of the record originally intended. Of course, this would only be true in the case where multiple XPosts and XLookups are combined to affect the change. This is true in any system that does not keep batched result sets and is part of the justification for the XResultSet commands.
  

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


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: xpost, can it do better than just add & subtra
Reply #6 - May 2nd, 2007 at 4:10am
Print Post Print Post  
Quote:
Why not use XLookup functions to gather data from the external DB, perform the calculations locally in the current DB, and then just post the final results back to the external DB?


Carl, worked with your suggestion. It is a feasible alternative and works well when it is required. Thanks for your suggestion. Will work with it in Sesame 1.1.4. I always appreciate your input in brainstorming.
  
Back to top
 
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: xpost, can it do better than just add & subtra
Reply #7 - May 2nd, 2007 at 4:35am
Print Post Print Post  
Quote:
XPost, on the other hand operates directly on records on the server, without specifying one form or another.


XPost ("filename", key, "[formName!]ext key element", entry, "target element", "operation")

Mark, we do have to specify the form in the xpost command. So, with xpost command, it has to go through particular form as opposed to working directly on the database record. Just wondering. May be you are eluding to internal working, I guess.
« Last Edit: May 2nd, 2007 at 12:01pm by Bharat_Naik »  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: xpost, can it do better than just add & subtra
Reply #8 - May 2nd, 2007 at 11:48am
Print Post Print Post  
Bharat_Naik wrote on May 2nd, 2007 at 4:35am:
XPost ("filename", key, "[formName!]ext key element", entry, "target element", "operation")

Mark, we do have to mention the form in the xpost command. Just wondering. May be you are eluding to internal working, I guess.


Bharat,

Unlike Q&A, a Sesame application can contain more than one database each of which can have more than one form. Because of this, all the X-commands allow you specify which form you intend. If you have only one Form, this is not needed. However, if you add another Form later, you will need to update your X-commands to specify which one you mean.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged