Very Hot Topic (More than 25 Replies) Importing data in a particular manner (Read 4420 times)
Cliff
Full Member
***
Offline



Posts: 126
Location: New Hampshire
Joined: May 5th, 2006
Importing data in a particular manner
Feb 13th, 2008 at 8:27pm
Print Post Print Post  
I have an app with 3500 records. I have an ascii file of 1000 records that I'd like to import. Both the app and the ascii file share a unique LE (policy number). I'd like to import the 1000 records and have them "go" where they should based on the shared policy number. Looking for a way to automate this...otherwise...yours truly will have the task of manually parsing through this!!
Any help appreciated...
  
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 #1 - Feb 13th, 2008 at 8:29pm
Print Post Print Post  
Do you want to add subrecords to existing parents, or do you want to update existing records with info from the 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 #2 - Feb 13th, 2008 at 8:30pm
Print Post Print Post  
I would like to update exisitng records with the text file but only for those records that share the same policy number...?
  
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 #3 - Feb 13th, 2008 at 8:35pm
Print Post Print Post  
Cliff wrote on Feb 13th, 2008 at 8:30pm:
I would like to update exisitng records with the text file but only for those records that share the same policy number...?


You'll need to use File I/O to read in each line, parse it, find the matching record and update the fields you want. Are you updating every field, or just a few?
  

- 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 #4 - Feb 13th, 2008 at 8:43pm
Print Post Print Post  
The app has about 700 LE's. 100 of these have just been added to the form to accomodate the data in the ascii file... The way it appears to me is that the data from the ascii file would be appended to the end of the existing form ...?
  
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 #5 - Feb 13th, 2008 at 8:52pm
Print Post Print Post  
How is the ASCII file delimited?
  

- 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 #6 - Feb 13th, 2008 at 9:41pm
Print Post Print Post  
It is comma delimited...tx...
  
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 #7 - Feb 13th, 2008 at 9:49pm
Print Post Print Post  
Cliff wrote on Feb 13th, 2008 at 9:41pm:
It is comma delimited...tx...

Are there quotes around the data? Can I see a couple lines of the 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 #8 - Feb 13th, 2008 at 10:57pm
Print Post Print Post  
Here are a few lines from the import (ascii) file...(it ain't pretty!!)
"50C0003335",01,"06/04/2004","06/04/2005","MICHAEL BAY MARINE",98," "," ","CORPORATION","NON-APPLICABLE","8,9",1000000,175," ", ," ", ," "," ", ," ", , , ," ", , ," ", ," ", ," ", , ," ", , ," ", , ," ", , ," ", , ," ", , ," ", , ," ", ," ",175,"MD","IF ANY","1.0","1.0",74," "," "," "," ", ," "," "," "," ", ,74, ," "," ", , ," "," ", , ," "," ", ,0,10,"101", ," ", ," ", ," ","101","CA0001 03 06","CA9903 03 06","CA2117 12 93","CA2171 01 88","CA0170 10 01","CA0215 11 00","CA2113 04 01","CA2219 01 02","PA0216 11 00"," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," ", ," "," "
"50C0002167",04,"04/12/2006","04/12/2007","SAILCRAFT",20," "," ","CORPORATION","NAS-02167","1",1000000,1895," ", ," ", ," "," ", ," ", , , ," ", , ," ", ," ", ,"5",1000000,252," ", , ," ", , ,"7",1000,228," ", , ,"7",1000,818," ", , ," ", ," ",3193,"NC","IF ANY","1.0","1.0",74," "," "," "," ", ," "," "," "," ", ,74, ," "," ", , ," "," ", , ," "," ", ,0,10,"101", ," ", ," ", ," ","101","CA0001 03 06","CA9903 03 06","CA2117 12 93","CA2171 01 88","CA0126 03 01","CA2116 07 04"," "," "," "," "," "," "," "," "," "," "," "," ","2000 CHEVROLET","2003 CHEVROLET","2006 CHEVROLET SILVERADO"," "," "," "," "," "," "," "," "," "," ", ," "," "
"50C0004324",00,"05/30/2006","05/30/2007","BROAD CREEK MARINA LLC",10,"708 HARBOR ROAD","WANCHESE,NC 27981","CORPORATION","NAS-04324","8,9",1000000,175," ", ," ", ," "," ", ," ", , , ," ", , ," ", ," ", ," ", , ," ", , ," ", , ," ", , ," ", , ," ", , ," ", , ," ", ," ",175,"NORTH CAROLINA","IF ANY","1.0","1.0",74," "," "," "," ", ," "," "," "," ", ,74, ," "," ", , ," "," ", , ," "," ", , ,10,"101", ," ", ," ", ," ","101","CA0001 03 06","CA9903 07 97","CA2117 12 93","CA2171 01 88","CA9916 12 93","CA0126 03 01","CA2116 07 04"," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," ", ," "," "
"50C000737",10,"06/17/2006","06/17/2007","DAVID J WOOD",20," "," "," ","NAS-00737","1",1000000,1507,"2", ,"PEDESTRIAN", ," "," ", ," ", , , ," ", , ," ", ," ", ,"5",1000000,118," ", , ," ", , ,"7",250,111," ", , ,"7",500,422," ", , ," ", ," ",2158,"NJ","IF ANY","1.0","1.0",80," "," "," "," ", ," "," "," "," ", ,80, ," "," ", , ," "," ", , ," "," ", ,0,10,"111", ," ", ," ", ," ","111","CA0001 03 06","CA9903 03 06","CA2117 12 93","CA2171 01 88","CA0184 09 95","CA0188 03 99","CA2114 01 04","CA2230 11 04","CA2231 02 97"," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," ", ," "," "
"50C0002518",04,"12/10/2005","12/10/2006","GLASS MASTERS  BOATWORKS",20," "," ","CORPORATION","NAS-02518","8,9",300000,145," ", ," ", ," "," ", ," ", , , ," ", , ," ", ," ", ," ", , ," ", , ," ", , ," ", , ," ", , ," ", , ," ", , ," ", ," ",145,"MD","IF ANY","1.0","1.0",61," "," "," "," ", ," "," "," "," ", ,61, ," "," ", , ," "," ", , ," "," ", ,0,10,"84", ," ", ," ", ," ","84","CA0001 03 06","CA9903 03 06","CA2117 12 93","CA2171 01 88","CA0170 10 01","CA0215 11 00","CA2113 04 01","CA2219 01 02","PA0216 11 00"," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," "," ", ," "," "
  
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 #9 - Feb 13th, 2008 at 11:05pm
Print Post Print Post  
What you want to do is use ASCII Database (on the File menu) to make a database out of this file. Then you can run a mass update on it that uses XResultSet to find the matching record in the target database and update it. Easy as pie!

I don't have time to write the code right now, but if nobody gets to it before I do, I'll do it for you tomorrow.
  

- 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 #10 - Feb 14th, 2008 at 12:09pm
Print Post Print Post  
Thanks Hammer! I get a kick out of your description "Easy as pie!" you are talking to someone that burns toast...in a figurative manner of course...  Wink
Again...many 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 #11 - Feb 14th, 2008 at 3:13pm
Print Post Print Post  
OK Cliff, here's what you do.

Back up your database.

Make a database out of your text file
Using ASCII database lets us deal with all those quotes and commas for you.

1. Add the following line to the top of your text file. This will make sure you don't lose the first record.
Code
Select All
#"ASCII0000","ASCII0001","ASCII0002","ASCII0003","ASCII0004","ASCII0005","ASCII0006","ASCII0007","ASCII0008","ASCII0009","ASCII0010","ASCII0011","ASCII0012","ASCII0013","ASCII0014","ASCII0015","ASCII0016","ASCII0017","ASCII0018","ASCII0019","ASCII0020","ASCII0021","ASCII0022","ASCII0023","ASCII0024","ASCII0025","ASCII0026","ASCII0027","ASCII0028","ASCII0029","ASCII0030","ASCII0031","ASCII0032","ASCII0033","ASCII0034","ASCII0035","ASCII0036","ASCII0037","ASCII0038","ASCII0039","ASCII0040","ASCII0041","ASCII0042","ASCII0043","ASCII0044","ASCII0045","ASCII0046","ASCII0047","ASCII0048","ASCII0049","ASCII0050","ASCII0051","ASCII0052","ASCII0053","ASCII0054","ASCII0055","ASCII0056","ASCII0057","ASCII0058","ASCII0059","ASCII0060","ASCII0061","ASCII0062","ASCII0063","ASCII0064","ASCII0065","ASCII0066","ASCII0067","ASCII0068","ASCII0069","ASCII0070","ASCII0071","ASCII0072","ASCII0073","ASCII0074","ASCII0075","ASCII0076","ASCII0077","ASCII0078","ASCII0079","ASCII0080","ASCII0081","ASCII0082","ASCII0083","ASCII0084","ASCII0085","ASCII0086","ASCII0087","ASCII0088","ASCII0089","ASCII0090","ASCII0091","ASCII0092","ASCII0093","ASCII0094","ASCII0095","ASCII0096","ASCII0097","ASCII0098","ASCII0099","ASCII0100","ASCII0101","ASCII0102","ASCII0103","ASCII0104","ASCII0105","ASCII0106","ASCII0107","ASCII0108","ASCII0109","ASCII0110","ASCII0111","ASCII0112","ASCII0113","ASCII0114","ASCII0115","ASCII0116","ASCII0117","ASCII0118","ASCII0119","ASCII0120","ASCII0121","ASCII0122","ASCII0123","ASCII0124","ASCII0125","ASCII0126","ASCII0127" 



2. From the Sesame File menu, choose ASCII Database. Select your text file. Give the new database a name.

Sesame will create a database out of your text file. There may be an extra blank record at the end. If so, just delete it.

Use Mass Update to update your real database
You can now run a Mass Update on the records in the temporary database to update the real database. Like so:

Code
Select All
#include "..\Sesame2\sbasic_include.sbas"

var vRS as Int

	// Open a result set with the matching record in the target database
	vRS = @XResultSetSearch("Target.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, "Info1", ASCII0001)
			XResultSetValue(vRS, "Info2", ASCII0002)
			XResultSetValue(vRS, "Info3", ASCII0003)
			XResultSetValue(vRS, "Info4", ASCII0004)
			XResultSetValue(vRS, "Info5", ASCII0005)
		}
		Else
		{
			WriteLn("Error: There is not exactly one matching record for " + ASCII0000)
		}

		// Close the result set
		XResultSetClose(vRS)
	}
	Else
	{
		WriteLn("Error: Unable to open result set for " + ASCII0000)
	}
 

  

- 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 #12 - Feb 14th, 2008 at 5:55pm
Print Post Print Post  
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...

Again...thank you!

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 #13 - Feb 14th, 2008 at 6:54pm
Print Post Print Post  
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
  

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


No personal text

Posts: 366
Location: Germany
Joined: Feb 7th, 2004
Re: Importing data in a particular manner
Reply #14 - Feb 15th, 2008 at 8:37am
Print Post Print Post  
Hello Erika,

that is fantastically and brilliantly at the same time.
Thanks for these contribution.

Dr.. Belhareth
  

Dr. med. Amor Belhareth&&Medizin Labor &&Germany
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 #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
 
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 #30 - Feb 19th, 2008 at 2:56pm
Print Post Print Post  
This line will not work as written. Your database is not named Target. The field in your database that matches is probably not named Key.
vRS = @XResultSetSearch("policy.db", "Target", SEARCH_MODE_AND, SEARCH_SYNTAX_QA, "!Key=" + ASCII0000)

To find the right names:
1. Open Policy.db in Designer. 
2. Open the Policy Form.
3. In the Property Viewer, from the View Setting For dropdown, select Database. The Database Name is what you want in place of "Target" as the second argument.
4. Click on the element on the form which has the matching key value.
5. In the Property Viewer, from the View Setting For dropdown, select Selected Elements. Click the Other tab. The Bound To is what you want in place of "!Key" in the last argument.

Fix that line and post it here. If it looks right, then I'll tell you what to do next.
  

- Hammer
The plural of anecdote is not data.
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 #31 - Feb 19th, 2008 at 2:56pm
Print Post Print Post  
Cliff wrote on Feb 19th, 2008 at 2:51pm:
How best to get in touch with you on this?

Email me at erika@lantica.com or email Support at support@lantica.com.

Edited:
I got your PM and replied to the email address you provided.
  

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