> > From: Kevin O[SMTP:[EMAIL PROTECTED]] > > Hello all, > > I need to insert a lot of data into a mysql table. Know that I can > do it > like this example: > > > > my $sth = $dbh->prepare(q{ > INSERT INTO sales (product_code, qty, price) VALUES (?, ?, ?) > }) or die $dbh->errstr; > while (<>) { > chomp; > my ($product_code, $qty, $price) = split /,/; > $sth->execute($product_code, $qty, $price) or die $dbh->errstr; > } > $dbh->commit or die $dbh->errstr; > > > My problem is, I have 500 fields. I know I can start the Insert > statement > like INSERT INTO mytable VALUES - cause I'm inserting a value for > every > field in the database, but do I have to type a "?" for all 500 > fields? BTW, > I'm just feeding execute with an array of values, like above.
I have just read someone elses post and am wondering if you are refering to columns. If this is the case then 500 ? is looking likely. Having called the item field there has been a misundertanding. If you follow what is below you generally always get it right. Off Topic I am doing a degree and one of the bits is relational theory so I am not preaching but practicing. Table (relation) Columns (attributes) Values (attribute values) The number of attributes is known as the degree of the relation. Rows (tuples). The amount of tuples is the relations cardinality. The amount of tuples at a point in time is its extension. I will not go into domains. Can anyone explain what the difference between Cardinality and Extension is. Harry __________________________________________________ Do You Yahoo!? LAUNCH - Your Yahoo! Music Experience http://launch.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]