No, you can't use query parameters for column names. Query parameters can be used only in the place of a literal value in an SQL expression.
"; No, you can't use query parameters for column names. Query parameters can be used only in the place of a literal value in an SQL expression. You'll have to use dynamic SQL.
That is, form an SQL statement as a string, and interpolate your application variables into this string as column names.
– Joshxtothe4 Apr 14 '09 at 3:56 Yes, exactly. All tables and columns must be named in the SQL string before you prepare the query. – Bill Karwin Apr 14 '09 at 5:23.
Yikes, classic database denormalization here about to happen. You don't want to do this. You want to keep it either a single column, or, as it would seem to need to be, create a one to many relationship between auctions and type.
Your first sign that something is wrong is that there's no easy path to do what you're trying to do. A better approach would be to create an auction table, and a categoryAuctionForm table... It would look like: auctions Table: auction_id --------- 0 1 2 3 auctions Type: auction_type_id auction_id auction_type 1 0 something 2 0 othertype 3 0 fake 4 1 othertype 5 2 fake 6 3 fake You can also add more levels of normalization such as creating an auction_type column. Just my thought.
I have updated my question to show why I feel I need to use the approach I outlined..I would appreciate your thoughts on it – Joshxtothe4 Apr 14 '09 at 2:34.
It is the point of preparing queries that nothing except data is going to change. You could prepare different queries for each category you have (put them into array indexed by category name). But I doubt preparing queries would actually make any difference here.
Nothing except data will change, it's just that the category that a record will be added to is arbitrary, out of a predefined list. – Joshxtothe4 Apr 14 '09 at 3:38.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.