Re: [vwnc] Question about using lots of data for database recordpopulating...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: [vwnc] Question about using lots of data for database recordpopulating...

Boris Popov, DeepCove Labs (SNN)
Re: [vwnc] Question about using lots of data for database recordpopulating...

You're much better off just opening a read stream on a file containing your data and traverse it line by line creating and storing whatever objects you need in the process. Generating Smalltalk code is simply not the most effective data processing approach.

Cheers!

-Boris (via BlackBerry)

----- Original Message -----
From: [hidden email] <[hidden email]>
To: vwnc-list <[hidden email]>
Sent: Thu Jun 26 21:36:26 2008
Subject: [vwnc] Question about using lots of data for database recordpopulating...

I'm populating a database table with zipcode data and have written 
some scripts (using cut/gawk) to break apart the SQL statement into 
the items of interest (zip,city,state).. The gawk script then 
generates Glorp statements that can be used to insert each item to the 
database.. However, I've got several thousand (2685) inserts just for 
the state of California and creating that many temp variables doesn't 
appear to work well w/ ST... This code will only be used whenever the 
database is recreated (as a side-effect of changing the layout during 
development).. I suppose I could tear apart the SQL statements w/i the 
VW environment and go that route but I've already got everything ready 
care of a few lines of gawk, cut, etc..  Whats the best way do this w/
o getting VW annoyed?

Below is some of the sample lines I've got :

createZipcodeData: session
  | zipObj1 zipObj2 zipObj3 zipObj4 zipObj5 zipObj6 zipObj7 zipObj8 
zipObj9 zipObj10 zipObj11 zipObj12 zipObj13 zipObj14 zipObj15 zipObj16 
zipObj17 zipObj18 zipObj19 zipObj20 zipObj21 zipObj22 zipObj23 
zipObj24 zipObj25 zipObj26 zipObj27 zipObj28 zipObj29 zipObj30 
zipObj31 zipObj32 zipObj33 zipObj34 zipObj35 zipObj36 zipObj37 
zipObj38 |

    Transcript show: '********** Loading Zipcode data **********'.
        zipObj1 := MSADBLocation new zipcode: '90001'; city: 'Los Angeles'; 
state: 'CA'.
        zipObj2 := MSADBLocation new zipcode: '90002'; city: 'Los Angeles'; 
state: 'CA'.
        zipObj3 := MSADBLocation new zipcode: '90003'; city: 'Los Angeles'; 
state: 'CA'.
        zipObj4 := MSADBLocation new zipcode: '90004'; city: 'Los Angeles'; 
state: 'CA'.
        zipObj5 := MSADBLocation new zipcode: '90005'; city: 'Los Angeles'; 
state: 'CA'.
        zipObj6 := MSADBLocation new zipcode: '90006'; city: 'Los Angeles'; 
state: 'CA'.
        zipObj7 := MSADBLocation new zipcode: '90007'; city: 'Los Angeles'; 
state: 'CA'.
        zipObj8 := MSADBLocation new zipcode: '90008'; city: 'Los Angeles'; 
state: 'CA'.
        zipObj9 := MSADBLocation new zipcode: '90009'; city: 'Los Angeles'; 
state: 'CA'.

[ ... ]


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [vwnc] Question about using lots of data for database recordpopulating...

Rick Flower
Thanks guys.. I guess I'll try out one of the two approaches.  Thx!

On Jun 26, 2008, at 9:47 PM, Boris Popov wrote:

You're much better off just opening a read stream on a file containing your data and traverse it line by line creating and storing whatever objects you need in the process. Generating Smalltalk code is simply not the most effective data processing approach.

Cheers!

-Boris (via BlackBerry)

----- Original Message -----
From: [hidden email] <[hidden email]>
To: vwnc-list <[hidden email]>
Sent: Thu Jun 26 21:36:26 2008
Subject: [vwnc] Question about using lots of data for database recordpopulating...

I'm populating a database table with zipcode data and have written 
some scripts (using cut/gawk) to break apart the SQL statement into 
the items of interest (zip,city,state).. The gawk script then 
generates Glorp statements that can be used to insert each item to the 
database.. However, I've got several thousand (2685) inserts just for 
the state of California and creating that many temp variables doesn't 
appear to work well w/ ST... This code will only be used whenever the 
database is recreated (as a side-effect of changing the layout during 
development).. I suppose I could tear apart the SQL statements w/i the 
VW environment and go that route but I've already got everything ready 
care of a few lines of gawk, cut, etc..  Whats the best way do this w/
o getting VW annoyed?

Below is some of the sample lines I've got :

createZipcodeData: session
  | zipObj1 zipObj2 zipObj3 zipObj4 zipObj5 zipObj6 zipObj7 zipObj8 
zipObj9 zipObj10 zipObj11 zipObj12 zipObj13 zipObj14 zipObj15 zipObj16 
zipObj17 zipObj18 zipObj19 zipObj20 zipObj21 zipObj22 zipObj23 
zipObj24 zipObj25 zipObj26 zipObj27 zipObj28 zipObj29 zipObj30 
zipObj31 zipObj32 zipObj33 zipObj34 zipObj35 zipObj36 zipObj37 
zipObj38 |

    Transcript show: '********** Loading Zipcode data **********'.
        zipObj1 := MSADBLocation new zipcode: '90001'; city: 'Los Angeles'; 
state: 'CA'.
        zipObj2 := MSADBLocation new zipcode: '90002'; city: 'Los Angeles'; 
state: 'CA'.
        zipObj3 := MSADBLocation new zipcode: '90003'; city: 'Los Angeles'; 
state: 'CA'.
        zipObj4 := MSADBLocation new zipcode: '90004'; city: 'Los Angeles'; 
state: 'CA'.
        zipObj5 := MSADBLocation new zipcode: '90005'; city: 'Los Angeles'; 
state: 'CA'.
        zipObj6 := MSADBLocation new zipcode: '90006'; city: 'Los Angeles'; 
state: 'CA'.
        zipObj7 := MSADBLocation new zipcode: '90007'; city: 'Los Angeles'; 
state: 'CA'.
        zipObj8 := MSADBLocation new zipcode: '90008'; city: 'Los Angeles'; 
state: 'CA'.
        zipObj9 := MSADBLocation new zipcode: '90009'; city: 'Los Angeles'; 
state: 'CA'.

[ ... ]


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc



_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc