in reply to Understanding placeholders

You should really consider removing "select * from" and replacing it with a "select" that specifically states what fields it's selecting and in which order. The same applies to "insert into table". This way your code will continue working even if table layout is altered. Since you're doing a "describe" already, it's easy enough to pull field names from it. Once you have the names, do a proper "select" and also store field names in the file that you're exporting, perhaps on the very first line, so that the application on the other end will know how to construct the "insert". Getting the right number of "?" for placeholders is also trivial in this case.

--perlplexer

Replies are listed 'Best First'.
Re: Re: Understanding placeholders
by nedals (Deacon) on May 04, 2003 at 16:21 UTC
    This way your code will continue working even if table layout is altered
    That's a good idea, Thanks.