2

In karate, I am trying to read database query
* def AccountDetails = db.readRow('select * from ')

From this I am trying to read individual values from this query and set this to one value
* set oimattrDetails $.User Login = AccountDetails.UD_BLR_USR_USER_LOGIN

Here, UD_BLR_USR_USER_LOGIN - is of the attribute present in the particular database I do not want to hard code this value at this point. Instead assign this to some reference value and call it

*def USER_LOGIN = UD_BLR_USR_USER_LOGIN

Now use USER_LOGIN
* set oimattrDetails $.User Login = AccountDetails.USER_LOGIN

Something like this..But this is not working Can any one help me here with exact syntax to use

1 Answers1

0

A lot depends on what is the type of object returned by this code:

db.readRow()

That code is not part of Karate and you should provide more details here on that part - otherwise no one can help you. If it is not written by you, talk to the person or team who has written it - there is no point in talking about database "attributes". Maybe a simple solution is to add some Java code to the db object (I am assuming this is a Java utility) - to solve for your specific use case.

In short, your question sounds to me that it has nothing to do with Karate.

Peter Thomas
  • 54,465
  • 21
  • 84
  • 248