Page Index Toggle Pages: [1] 2  Send Topic Send Topic Print Print
Hot Topic (More than 10 Replies) traversing full complete records (Read 2503 times)
North_Guy
Member
*
Offline


No personal text, yet.

Posts: 25
Location: Alberta, Canada
Joined: Sep 7th, 2005
traversing full complete records
Sep 7th, 2005 at 8:33pm
Print Post Print Post  
I looked and couldn't find an answer to my question here but I'm new to Sesame so excuse my terminology.

I have experience with flat database files and writing code to interact with these files. Right now I have been given a Sesame app with 4 databases and multiple forms. I need to extract complete records from the database, null values and all. When I do file I/O on any given element I only get the output of what exists in that column or field, if there are 10,000 records but only 20 unique values in any given field, thats all I recieve in my output. I guess I need to know if there is a function that will allow me to traverse through the [u]complete[/u] records one by one and extract or do whatever to the fields contained in that record?
Thanks for any help.
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: traversing full complete records
Reply #1 - Sep 7th, 2005 at 9:11pm
Print Post Print Post  
How are you currently doing the "extraction" that gets you the 20 unique values?
  

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


No personal text, yet.

Posts: 25
Location: Alberta, Canada
Joined: Sep 7th, 2005
Re: traversing full complete records
Reply #2 - Sep 7th, 2005 at 9:52pm
Print Post Print Post  
I have been using the Text File I/O Functions in conjuction with other functions to try to increase the scope of fields such as GlobalValue.
Thanks for the help!, I sure can use it.
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: traversing full complete records
Reply #3 - Sep 7th, 2005 at 9:56pm
Print Post Print Post  
Take a look at @XLookupAll and some of the other X-commands.
  

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


No personal text, yet.

Posts: 25
Location: Alberta, Canada
Joined: Sep 7th, 2005
Re: traversing full complete records
Reply #4 - Sep 7th, 2005 at 10:10pm
Print Post Print Post  
I have actually looked at the X functions and used XListValues but it still just seems to return fields that are populated. I was hoping that I would get just ;; for empty values but didn't.
Maybe I'm missing something with the design of the initial application concerning the linking of fields? The data was apparently in Q&A before Sesame if that sheds any light on my problem concerning linking?
Thanks again.
  
Back to top
 
IP Logged
 
BOBSCOTT
Senior Member
Members
*****
Offline


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: traversing full complete records
Reply #5 - Sep 8th, 2005 at 12:05am
Print Post Print Post  
Can you post a more specific explanation of what you are trying to accomplish.

Is this a one time extraction?

How do you plan on running rhis routine?

The more specific, the easier it is for people to help with a solution. Smiley
  

Team – Together Everyone Achieves More
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: traversing full complete records
Reply #6 - Sep 8th, 2005 at 1:22am
Print Post Print Post  
Are you looking for something that looks like a flat file spreadsheet type of format so that you can step through each record and select which ones you want to process?
  



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


No personal text, yet.

Posts: 25
Location: Alberta, Canada
Joined: Sep 7th, 2005
Re: traversing full complete records
Reply #7 - Sep 8th, 2005 at 2:20pm
Print Post Print Post  
What Bob Hansen asked is right on the money. Thats exactly what I'm looking for. Hopefully its possible with  Sesame?
Its going to be run a couple of times a year. The records need to be taken from the database and placed in an ascii file with an accompaning definition for each field , one after the other, ~10000 records in total.
Thanks again for the help.
  
Back to top
 
IP Logged
 
North_Guy
Member
*
Offline


No personal text, yet.

Posts: 25
Location: Alberta, Canada
Joined: Sep 7th, 2005
Re: traversing full complete records
Reply #8 - Sep 8th, 2005 at 10:05pm
Print Post Print Post  
I've hit a wall, I can't seem to figure out how to retrieve complete records(with their fields disperced among 5 databases, one .db) and use file I/O to export them to an ascii file one complete record at a time. I must be missing something? PLease help! Thanks.
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: traversing full complete records
Reply #9 - Sep 8th, 2005 at 11:02pm
Print Post Print Post  
[quote author=North_Guy  link=1126125207/0#8 date=1126217100]I've hit a wall, I can't seem to figure out how to retrieve complete records(with their fields disperced among 5 databases, one .db) and use file I/O to export them to an ascii file one complete record at a time. I must be missing something? PLease help! Thanks.[/quote]

North_Guy,

A record, by definition, consists of the fields from a single database. If you have five databases (even within the same db), you will have to give us some detail as to how one determines which records in each of the five databases go together to form one large "Record".
  

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


That Darn Computer #$X#
{curse words}

Posts: 1195
Joined: Nov 22nd, 2002
Re: traversing full complete records
Reply #10 - Sep 8th, 2005 at 11:39pm
Print Post Print Post  
North_Guy

For starters do not panic. There are ways to achieve your goal. Second I would highly recommend attending an integrating Sesame with External Applications class offered by Hammer Data systems. It teaches how to create files like you are looking for.

You also might look into the Lantica product called Extractor. I do not know if it only reads 1 database at a time or all databases in an application. A Lantican will need to answer that question.

If I understand the process you need in lay terms you have an application that has 5 databases with the data in each database related to each other. You want all the related data from the database as one line in an ASCII file.

What form of linking did you use, Natural or relational?

If my statements above are correct the basic steps you need to do is

Get all data per record into elements or variables
Open a file to write to in a format you choose
Format the data with the correct separators
Write the line to the file
Close the file.

One basic method you can use to get all data per record together is by creating a form with each of the remaining databases as subforms. The elements on the main form are then available to export and by creating variables and using  @formfieldValue() you can then have all the related data available to export. Example

vpropertystreet = @formfieldValue("property","propertyStreet",0)

Then format the data with the separator you need. Example


     vData = VpropertyStreet + "^" + VpropertyCity + "^" + VpropertyState + "^" + VpropertyZip + "^" + VpropertyFirst + "^" + VpropertyLast + "^"+ VFirmname + "^"+ vpropQuotedRate + "^" + vLoanSizeDesired + "^" + vPropertyType + "^" + VMarketValue + "^" + VMarketValueestorap + "^" + VuseridFullName + "^" + VuserEmail + "^"

Then use the file commands to open, seek, write and close the file. Look at

fileOpen()
fileSeek()
fileWriteLn()
fileClose()


There are cleaner methods I am sure but hopefully this  example should get you started in the correct direction.
  

Team – Together Everyone Achieves More
Back to top
 
IP Logged
 
North_Guy
Member
*
Offline


No personal text, yet.

Posts: 25
Location: Alberta, Canada
Joined: Sep 7th, 2005
Re: traversing full complete records
Reply #11 - Sep 9th, 2005 at 2:55pm
Print Post Print Post  
Thanks BOBSCOTT, I appreciate the advice and will look into the workshop.
Unfortunately I don't know if natural or relational linking was used because I didn't create the application, it was given to me already created. I will look into it though and see if I can find out, I'm sure it can be easily done through the menu, like I said I'm green to Sesame, seen it for the first time less then 2 weeks ago, I have experience with Access and MySQL and a little with Oracle but that was with mainly flat files and I wrote code, Perl/Java, to interact with the databases mostly through web applications.
The method you suggested is exactly what I tried, using the @formfieldValue function and file i/o, but the problem was scope and doing what you suggested, making the remaining databases subforms, would solve that problem I guess! Thanks, I appreciate it.
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: traversing full complete records
Reply #12 - Sep 9th, 2005 at 3:22pm
Print Post Print Post  
North_Guy,

Sesame is not SQL based, nor is it structured like a true relational database engine. If you try to make it behave like Access or my SQL, you are doing the square peg - round hole thing.  If you were to write an SQL query to get the data you want from mySQL, how would it look? I speak SQL, so this will let us see exactly what you are trying to accomplish.
  

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


No personal text, yet.

Posts: 25
Location: Alberta, Canada
Joined: Sep 7th, 2005
Re: traversing full complete records
Reply #13 - Sep 9th, 2005 at 4:00pm
Print Post Print Post  
Thanks Hammer, thats a good idea. It would be a simple:
select * From 'table_name'
where field1 = 'someVariable'

with 'someVariable' being a unique field value already retrieved  with a select or maybe even produced by loop and counter.
Of course this would be wrapped in some language like java that places the result/record in an array or maybe use functions like getStatement().executeQuery("Select.......) in java and move through the resultset using resultset.next() and do the required output formatting to get the final product.
Hope this helps clearify what I'm trying to do, actually BOBSCOTT explains what I'm trying to do nicely.
Thanks again Hammer.
  
Back to top
 
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: traversing full complete records
Reply #14 - Sep 9th, 2005 at 4:27pm
Print Post Print Post  
Okay, I only see one "table" in your SQL, therefore, @XLookupSourceListAll should do it for you. Have you tried this? If so, what was wrong with the result?

Please be specific. Remember that we can't see anything you have or are doing.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Page Index Toggle Pages: [1] 2 
Send Topic Send Topic Print Print