List Icon
Archive de la liste de diffusion

La liste de diffusion est fermée depuis juillet 2022, mais sert toujours d'archive d'informations sur QF-Test.
Cependant, si vous souhaitez rester informé des nouveautés concernant QF-Test, vous pouvez simplement vous abonner à la newsletter :
abonner à la newsletter 

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[QF-Test] Using a generic procedure for SQL UPDATE and INSERT where number of elements is variable.

  • Subject: [QF-Test] Using a generic procedure for SQL UPDATE and INSERT where number of elements is variable.
  • From: Rick Brasche <Rick.Brasche@?.org>
  • Date: Fri, 30 Jan 2015 15:20:40 -0800

Happy Friday, everyone.


In a number of recent automation scripts we’ve been requested to create, text information on the screen is fetched and written to a SQL table. In the past, we had 4 text elements we read per page, and created a generic INSERT INTO procedure that listed 4 columns and 4 variables. We have a similar one that does UPDATE as well.


My current project has one page that has 5 text elements to a single record, another page that has three, another that has 10. Another project has similar variety.


Can I write a generic database procedure that will allow me to assign the necessary columns at the specific test procedure call? So far it only allows what I explicitly write the SQL to be. If I specify 4 columns and 4 values, it has to be 4 in the procedure call.


Or do I just have to accept that I will write separate statements for each page as needed, or write three generics (three columns, two columns, 1 column) and repeatedly call as many as needed to get the desired number of UPDATE or INSERTs?


I’m really new at SQL so if there’s an obvious query solution, please don’t judge too harshly J


Thanks in advance, have a good weekend.




Rick Brasche,

Information Systems Business Process and Data Entry Automation

Home of Application Testing


“The difficult we do immediately, the impossible just takes a bit longer.” – US Navy SeaBees.

“If it ain’t broke, you’re not trying hard enough.” – “the Red Green Show”


NOTICE: This email message and/or its attachments may contain
information that is confidential or restricted. It is intended only for
the individuals named as recipients in the message. If you are NOT an
authorized recipient, you are prohibited from using, delivering,
distributing, printing, copying, or disclosing the message or content to
others and must delete the message from your computer. If you have
received this message in error, please notify the sender by return