Toad World® Forums

Problem assigning input value from a query


#1

I am trying to run a test where I have an input value set from a query. I can run the query in TOAD and get the correct value when connected as my codetester user, but in the test the value is getting set to null, which is not correct.

I have tried setting the input value from an expression or query, tried setting the input value from a query in an initialization section, and even tried using qu_helper.number_column_value passing in true for the raise no data found error, which inndeed causes a no data found error on line 1062 of qu_helper. I am at a loss as to what to do next.


#2

I just tried using a query in the input properties window and it returned data.

Please export your test definition and send that file, along with your source code (or simply the header) to me and I will take a look:

steven.feuerstein@quest.com

Regards, SF


#3

The test that is failing is “test loading section status”


#4

And here is the table definition from TOAD for the table I cannot select against. The version of Code Tester is 1.8.1.342, I don’t think I mentioned that before.


#5

Thomas, I do not see a table definition. And did you send the other information to me directly?

Thanks, SF


#6

I attached them to my responses in the thread - do you want me to email them to you?


#7

My apologies, Tom123. I was working from emails and the attachments are not included. Silly me!

OK…I created the package, imported the test definition, created the table, removed the schema names from the queries in your Input values. I inserted one row into the table with a PK value of 10.

And when I run the tests, I see that value show up in the results viewer. I do not see the problem you are having.

So…here is what I would like you to do:

  1. Please confirm: you are running all this in the same schema? That is, is this the code tester schema as well or did you install with public synonyms?

  2. Take some screen shots to show me the results viewer and null values. Expand the tree until you can see the values of the arguments and results.

  3. Also give me a screen shot or post some text here showing me the max value in your table, running the query from the same schema in which the test is run.

Thanks, SF


#8

1 - we have a separate codetester schema (named codetester) with public synonyms. Codetester has been granted select/insert/update/delete on the table and can see the data in TOAD.

2 - picture attached

3 -
SQL> connect codetester/***@birv22
Connected.
SQL>
SQL> SELECT MAX (watchlist_id)
2 FROM birmeta.tbl_watchlist;

MAX(WATCHLIST_ID)

          676

SQL>
SQL>
SQL>

Codetester has been granted select on the table as a direct grant (grant select on birmeta.tbl_watchlist to codetester), but it also has a grant through our application roles.
screenshot.gif


#9

I figured it out. I forgot that the table has OLS wrapped around it and had not granted exempt access policy directly to the codetester user. It was granted through a role so I could see the table data through Sql, but roles are not enabled for PL/Sql.

Thank you for your help.


#10

Ah…I am glad to hear that I don’t have a bug in Code Tester!

:slight_smile:

Regards, SF