[AccessD] Dynamic SQL statement

FW Salato Center Salato at ky.gov
Mon Dec 7 09:54:06 CST 2015


I have two problems really: 

1.) Empty fields that must be accommodated in the SQL because they aren't required. So, I have delimited or non-delimited results to accommodate each time. 
2.) I wrote four different INSERT INTO statements that accommodated all possibilities because this statement is a bit inflexible.

There's no SELECT, so I'm not sure what you're suggesting. I'm listening. :) 

I fully admit to be a bit of a linear thinker. I don't always see the possibilities because I'm looking down a straight line of here's what I've got, here's where I need to be... code, code, code... till I get there. I seldom see other routes until I'm done and then with that in my head, I suddenly see other shorter routes. It's a ... curse. :) But in my mind, with enough variables and concatenation, I see the possibility of reducing this all to a few lines, but maybe not. :) 

It's why I never could play softball -- the ball simply never took the route I expected and was flying by my shoulder before I knew it had left the pitcher's mound. 

John's most likely right about the class suggestion and if I thought I'd need more than one more input form for this, it might be a cool route to take, if for no other purpose than to stretch my brain. You know, they're recommending that us old folks color and do puzzles now. However... the gray matter's not as springy as it used to be. It might snap back and hurt me.  

Susan H. 


How about two separate strings - one for the INSERT clause and one for the SELECT clause.  Assemble them in parallel adding to both the fields you want and then append the SELECT to the INSERT at the end?

R
  




More information about the AccessD mailing list