Conversion problems

Good morning, I’m running a query to oracle database, however it returns list. So that I can make an insertion I need a variable of type integer or number, and the database returns an error: DatabaseError: ORA-01722: invalid number, because the type of variable is list. Below is the query:

${idUsername} = Query Select ID from sbr_collaborator where login like ${username}

How can i convert so that my database recognizes the variable?

Yes, the Query returns a list, so you need to use the index of the element you need:
${idUsername[0]}

Or use other convertion keyword, (maybe from BuiltIn, Collections or String).

This should also work:
${queried_name}= Set Variable ${idUsername[0]}

When I use ‘set variable’, it gives a return : type tuple

Query INSERT INTO crm_regra_excecao (ID_REGRA, ID_COLABORADOR, VALOR, ID, id_usuario) VALUES (2,‘NULL’,‘S’, ID_CRM_REGRA_EXCECAO.nextval , ‘${queried_name}’)

DatabaseError: ORA-01722: invalid number

it worked, thank you very much!!

I USED THE SET VARIABLE AND THEN USED A FULL TUPLE CONVERSION FUNCTION:
def converteTUPLA(vartupla):
res = functools.reduce(lambda sub, ele: sub * 10 + ele, vartupla)
return res