Toad World® Forums

How do I populate tables as input parameters?


#1

I need to pass tables as input parameters to stored procedures. How is this done? I get the the screen that requests input for a nested table, but I only seem to be able to pass in nulls.

Thank you very much!


#2

Do you mean pass a “nested table” or other type of collection? In this case, you need to set up the input variable through the initialization section for the input.

In 1.6, the best way to do this is open the Test Editor (in 1.8 you can do this in Test Builder), navigate to the Input of interest, click on the Input Value tab and copy or note the name of the variable Code Tester uses to pass that argument -

SHIVER MY TIMBERS!

I just discovered for that collections and other complex types for which you can not directly provide an input value, that tab is empty and you cannot SEE the name of the variable.

How frustrating. OK, we will fix that in 1.8.1.

In the meantime, if your argument is named ABC, then the variable we declare will be called i_ABC.

So click on the Customization tab and in Initialization, write the code to populate your nested table (including initialization it).

Does this help? Let me know…

SF


#3

Thank you very much for the quick response! I am relatively new to CodeTester, so I am not sure I am following you instructions correctly. I opened the test in the editor, and I see the initialization section. Is this where I attempt to input my values? I have three different “visible” stored procedures functions. Will the values be set the same for all of them?

I am looking forward to upgrading to 1.8, as we also have issues with blobs. Is 1.8 the current “production version”? If not, so you know when it might be available?

Thank you again for all of your assistance! I am very impressed with the product and anxiously look forward to some of the planned bug fixes and/or enhancements.


#4

Yes, the initialization section.

By “three different “visible” stored procedures functions” do you mean that you are creating tests for each of these functions? With the same initialization logic? In this case, you need to provide the initialization code for EACH input.

One way to do this is to define at a higher level (say, for the entire test definition) a single program that can be called by each input init section to set up your local variable.

Best way to do this: click on the word Properties at the top of the Test Editor browser, then click on the Customization tab on the right.

Create a private program under

– Declarations of private, custom non-program elements

and it will then be callable throughout your test definition.

SF