Page Index Toggle Pages: 1 [2] 3  Send Topic Send Topic Print Print
Very Hot Topic (More than 25 Replies) Importing data in a particular manner (Read 4433 times)
Cliff
Full Member
***
Offline



Posts: 126
Location: New Hampshire
Joined: May 5th, 2006
Re: Importing data in a particular manner
Reply #15 - Feb 17th, 2008 at 8:48pm
Print Post Print Post  
Hammer wrote on Feb 14th, 2008 at 6:54pm:
Cliff wrote on Feb 14th, 2008 at 5:55pm:
I really do thank you very much...this is such a help to me as I was facing the "opportunity" to manually parse this data twice...once for testing and then again for production...


Manually parse? Perish the thought!  Smiley

Hi Hammer...well...I am really having no fun...
I do value your time and am wondering...could you train me, per se to do this step?
I'd like to know what you'd charge me in terms of a fee to do so...
Thanks...!
Cliff
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Importing data in a particular manner
Reply #16 - Feb 18th, 2008 at 2:45pm
Print Post Print Post  
Cliff wrote on Feb 17th, 2008 at 8:48pm:
Hi Hammer...well...I am really having no fun...
I do value your time and am wondering...could you train me, per se to do this step?
I'd like to know what you'd charge me in terms of a fee to do so...
Thanks...!
Cliff

I'm not sure what you're asking me to do, but if you want to email me (erika@hammerdata.com) or PM me we can can talk about it.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Cliff
Full Member
***
Offline



Posts: 126
Location: New Hampshire
Joined: May 5th, 2006
Re: Importing data in a particular manner
Reply #17 - Feb 18th, 2008 at 7:14pm
Print Post Print Post  
Greetings.... Embarrassed (embarassment "smiley")
I was having a terrible time simply importing my data...for whatver reason on my screamin (shudder) Vista machine the import was taking about 15 minutes to compile for the 4K records so I was thinking that Sesame was crashing...no...Sesame did fine...Windows was sketchy. Having crossed that bridge...after some time...I have revisited the mass update routine you gave me.
I realize that opening ones mouth tends to reveal their ignorance but after all...isn't this what we need help for...?
I am running the mass update by pasting the code (using the spec manager/program editor) into the program field for Policy Number...assuming that that is what I am supposed to do with it...however...when I click "test" in the program editor I receive the error : Error while parsing module "POLICY_NO": Statement or End-Of-File expected. Line 3, position 1: VAR var vrs as int.
The pointer points to the lower case "v" in the "word" var right before the "word" vrs.
Also...I assume I am supposed to rename "target.db" with my ascii db name?
Again...I respectfully thank you...and do very much appreciate your generosity...
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Importing data in a particular manner
Reply #18 - Feb 18th, 2008 at 7:25pm
Print Post Print Post  
Let's start from the beginning. You should not be "importing" any data.

Yes or No. Did you add the line I gave you to the top of your text file?
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Cliff
Full Member
***
Offline



Posts: 126
Location: New Hampshire
Joined: May 5th, 2006
Re: Importing data in a particular manner
Reply #19 - Feb 18th, 2008 at 7:52pm
Print Post Print Post  
Sorry for the confusion...I had to refresh the data in the database...hence the import thing...however...we are now at square one as far as using XResult goes...
Yes...I added the line you gave me...
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Importing data in a particular manner
Reply #20 - Feb 18th, 2008 at 8:07pm
Print Post Print Post  
OK. So far, so good.

What is the name of your main database?
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Cliff
Full Member
***
Offline



Posts: 126
Location: New Hampshire
Joined: May 5th, 2006
Re: Importing data in a particular manner
Reply #21 - Feb 18th, 2008 at 8:10pm
Print Post Print Post  
My main database is "policy" and the one I created from ASCII is "xauto"...
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Importing data in a particular manner
Reply #22 - Feb 18th, 2008 at 8:17pm
Print Post Print Post  
Make a backup of policy.

Open xauto.
Retrieve all the records.
Mass update the records in xauto using the Mass Update I gave you.

Note that you cannot just paste it in and run it. You need to update it to match your database, form and element names. Your database is Policy, not Target. I only put in the first five as an example. You need to use more than the first five values and your element names are probably not Info1, etc. I can't tell you exactly what to type because I don't know which values from your text file go into which elements on your Policy form.

You also need to change the include path to one that is more likely to match yours.

#include "sbasic_include.sbas"


  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Cliff
Full Member
***
Offline



Posts: 126
Location: New Hampshire
Joined: May 5th, 2006
Re: Importing data in a particular manner
Reply #23 - Feb 18th, 2008 at 8:21pm
Print Post Print Post  
Thanks again...I'll give it a whirl...
  
Back to top
 
IP Logged
 
Cliff
Full Member
***
Offline



Posts: 126
Location: New Hampshire
Joined: May 5th, 2006
Re: Importing data in a particular manner
Reply #24 - Feb 19th, 2008 at 12:53am
Print Post Print Post  
Hi Hammer:
Well...
Follows is the first few lines of the modified code you gave me:
#include "C:\Sesame2\sbasic_include.sbas"

var vRS as Int

     // Open a result set with the matching record in the target database
     vRS = @XResultSetSearch("policy.db", "Target", SEARCH_MODE_AND, SEARCH_SYNTAX_QA, "!Key=" + ASCII0000)
     If vRS > -1
     {
           // Make sure there is exactly one matching record
           If @XResultSetTotal(vRS) = 1
           {
                 // Update the values
                 XResultSetValue(vRS, "A1", ASCII0001)
                 XResultSetValue(vRS, "A2", ASCII0002)
                 XResultSetValue(vRS, "A3", ASCII0003)
                 XResultSetValue(vRS, "A4", ASCII0004)

All fields are completey synchronized (there are actually 95 of them).
I paste the code in the program editor in the ASCII0000 spec (the only one that shows in  the program editor other than GLOBAL CODE) and then click test.

When I do I receive an error that would probably be best sent as an image, if you click this link:

http://www.paracomm.net/Capture.JPG

You will see that the error is related to line 13 which is this line: (XResultSetValue(vRS, "A1", ASCII0001))

Dutifully, I have tried a number of things not the least of which was to fine comb the auto database files several times.

As always...any and all help is very much appreciated.

Thanks...

Cliff
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Importing data in a particular manner
Reply #25 - Feb 19th, 2008 at 1:01am
Print Post Print Post  
This line is not going to work until you update it to match your database. Your database is probably not called Target and your match field is probably not called Key.
vRS = @XResultSetSearch("policy.db", "Target", SEARCH_MODE_AND, SEARCH_SYNTAX_QA, "!Key=" + ASCII0000)

The error indicates that you do not have an element named ASCII0001. Did you rename any elements?

« Last Edit: Feb 19th, 2008 at 2:40pm by Hammer »  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Cliff
Full Member
***
Offline



Posts: 126
Location: New Hampshire
Joined: May 5th, 2006
Re: Importing data in a particular manner
Reply #26 - Feb 19th, 2008 at 2:40pm
Print Post Print Post  
Worked through the last...by adding quotes around the "ASCII0001...2...3...4" portions of the script.
Was able to run the script...
However...
Received numberous Error: Unable to open result set for + ASCII0000 errors but was able to export the data after the fact...
Exported data shows no change subsequent running the script...

workin' at it...

Cliff
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Importing data in a particular manner
Reply #27 - Feb 19th, 2008 at 2:45pm
Print Post Print Post  
Cliff wrote on Feb 19th, 2008 at 2:40pm:
Worked through the last...by adding quotes around the "ASCII0001...2...3...4" portions of the script.

No! It doesn't work that way. If you succeed in making your script work, you will just update all your records to literally say "ASCII0001" instead of the value in that field.

I think you might want to get in touch with Support or with me about this, Cliff. You're down to the point where the problem is specifically what your elements and fields are named and it's very hard to manage that blind. Get in touch with us and we'll help you make sure you are updating the correct database and suchlike.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Cliff
Full Member
***
Offline



Posts: 126
Location: New Hampshire
Joined: May 5th, 2006
Re: Importing data in a particular manner
Reply #28 - Feb 19th, 2008 at 2:45pm
Print Post Print Post  
Thanks...
Re: first few lines
#include "C:\Sesame2\sbasic_include.sbas"

var vRS as Int

     // Open a result set with the matching record in the target database
vRS = @XResultSetSearch("policy.db", "Target", SEARCH_MODE_AND, SEARCH_SYNTAX_QA, "!Key=" + ASCII0000)
If vRS > -1
{
           // Make sure there is exactly one matching record
If @XResultSetTotal(vRS) = 1
{
                 // Update the values
XResultSetValue(vRS, "A1", "ASCII0001")
XResultSetValue(vRS, "A2", "ASCII0002")

My primary database is policy...so I am taking it that "Target" should be the database name that I am running the script in? ie., xauto.db

As shown here I have ascii0001 associated with the element "a1" in the xauto database...
The very first LE in xauto is the policy number which I am assuming is the "key" by which we are syncing these two db's with and it would be ascii0000

Tx...cN
  
Back to top
 
IP Logged
 
Cliff
Full Member
***
Offline



Posts: 126
Location: New Hampshire
Joined: May 5th, 2006
Re: Importing data in a particular manner
Reply #29 - Feb 19th, 2008 at 2:51pm
Print Post Print Post  
How best to get in touch with you on this?
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1 [2] 3 
Send Topic Send Topic Print Print