Hello,
I am trying to connect to multiple databases with DatabaseLibrary but its not working.

*** Settings ***
Library           DatabaseLibrary    WITH NAME    db1
Library           DatabaseLibrary    WITH NAME    db2

*** Keywords ***
connect db1 database
    db1.Connect To Database Using Custom Params    cx_Oracle    'db1 connection string'
    @{queryResults1}=    db1.Query    select * from db1_table  --> OK
    db2.Connect To Database Using Custom Params    cx_Oracle    'db2 connection string'
    @{queryResults1}=    db2.Query    select * from db2_table  --> also OK
    @{queryResults1}=    db1.Query    select * from d1table  --> fails saying that db1_table does not exist

==============================
You did not specify which DatabaseLibrary you are talking about, but they both appear to have the same design flaw.

They both have a test library scope of GLOBAL.

RF will not create another instance of a library that is scoped GLOBAL. From the user guide, this appears to be by design.
In other words both db1 and db2 reference the same instance of DatabaseLibrary.
To fix, do all your queries in db1, then disconnect and connect to db2 and do all your queries there, etc.
If you want to do queries in both databases without (dis)connecting, there is a fairly easy way with the Python version.
 
Create a custom library as below:
----start content of DatabaseLibrarySS.py----
from DatabaseLibrary import DatabaseLibrary
 
class DatabaseLibrarySS(DatabaseLibrary):
    ROBOT_LIBRARY_SCOPE = 'TEST SUITE'
----end content of DatabaseLibrarySS.py----
 
*** Settings ***
Library           DatabaseLibrarySS.py    WITH NAME    db1
Library           DatabaseLibrarySS.py    WITH NAME    db2
 
*** Test Cases ***
Multiple Instances of DatabaseLibrary
    ${db1}=    Get Library Instance    db1
    ${db2}=    Get Library Instance    db2
    Should Not Be Equal    ${db1}    ${db2}
 
A library with a scope of GLOBAL should implement keywords to make concurrent use from different contexts possible. For examples, see Switch Process in OperatingSystem or Switch Browser in Selenium2Library.
what am i doing wrong here?

Thanks in advance for your time and help.

RF:connecting to multiple databases的更多相关文章

  1. RF:RF实现根据乳腺肿瘤特征向量高精度(better)预测肿瘤的是恶性还是良性—Jason niu

    %RF:RF实现根据乳腺肿瘤特征向量高精度(better)预测肿瘤的是恶性还是良性 load data.mat a = randperm(569); Train = data(a(1:500),:); ...

  2. 乌龙之MySQL slave IO status:connecting

    搭建了一个主从,状态一直如下: 检查错误日志报错如下: review搭建过程,语法并没有问题. 检查用户及网络,也没有问题: so?what is the cause ? 等等....貌似上面搭建用的 ...

  3. Django RF:学习笔记(8)——快速开始

    Django RF:学习笔记(8)——快速开始 安装配置 1.使用Pip安装Django REST Framework: pip install djangorestframework 2.在Sett ...

  4. 数字图像处理实验(10):PROJECT 05-01 [Multiple Uses],Noise Generators 标签: 图像处理MATLAB 2017-05-26 23:36

    实验要求: Objective: To know how to generate noise images with different probability density functions ( ...

  5. mysql:[Err] 1068 - Multiple primary key defined

    添加主键时,出现错误:[Err] 1068 - Multiple primary key defined #增加主键 ) not null; ; alter table my_test add pri ...

  6. 项目警告:There are multiple modules with names that only differ in casing.This can lead to unexpected behavior when compiling on a filesystem with other case-semantic.Use equal casing. Compare these modul

    记录个自己遇到的问题: 上星期项目刚拉取下来的时候运行没有任何警告,晚上回去vscode提示更新新的东西,当时没管就立即更新了,第二天重启项目直接一大堆警告冒了出来: There are multip ...

  7. 【九度OJ】题目1439:Least Common Multiple 解题报告

    [九度OJ]题目1439:Least Common Multiple 解题报告 标签(空格分隔): 九度OJ 原题地址:http://ac.jobdu.com/problem.php?pid=1439 ...

  8. 题目1439:Least Common Multiple(求m个正数的最小公倍数lcm)

    题目链接:http://ac.jobdu.com/problem.php?pid=1439 详解链接:https://github.com/zpfbuaa/JobduInCPlusPlus 参考代码: ...

  9. POJ 1426:Find The Multiple

    Find The Multiple Time Limit: 1000MS   Memory Limit: 10000KB   64bit IO Format: %I64d & %I64u Su ...

随机推荐

  1. 第1节 kafka消息队列:11、kafka的数据不丢失机制,以及kafka-manager监控工具的使用;12、课程总结

    12.kafka如何保证数据的不丢失 12.1生产者如何保证数据的不丢失 kafka的ack机制:在kafka发送数据的时候,每次发送消息都会有一个确认反馈机制,确保消息正常的能够被收到 如果是同步模 ...

  2. web阶段乱码问题

    一,概述 1.为什么会出现乱码问题 因为客户端(浏览器)和服务器端的编码和解码不一致. 我们web阶段都是围绕请求响应机制展开的, 客户端请求服务器,服务器给客户端做出响应 . 也就意味着客户端和服务 ...

  3. Cent OS下配置虚拟Ip地址

    1.首先我们登录操作系统 用户名root 密码 123456 然后我们输入ip查询命名 ip addr  也可以输入 ifconfig查看ip,但此命令会出现3个条目,centos的ip地址是ens3 ...

  4. 083、Java数组之方法返回数组

    01.代码如下: package TIANPAN; /** * 此处为文档注释 * * @author 田攀 微信382477247 */ public class TestDemo { public ...

  5. VS 项目没有“添加引用”选项

    出问题的环境:vs2017,unity2017unity创建工程后,vs打开项目后,无法添加引用dll,没有“添加引用”项原因: 需要把目标框架改为.

  6. 4K对齐

    4K对齐这个概念常常与固态硬盘联系起来.买了一块固态硬盘,装机过程中时有忽略4K对齐这个小细节,但是这个小细节往往十分重要,它影响硬盘的使用寿命和速度. 现在来了解一下4K对齐到底是个什么东西. 一. ...

  7. jsp el表达式判空

    https://www.cnblogs.com/sxdcgaq8080/p/8119186.html

  8. 2.12 学习总结 之 表单校验插件validate

    一.说在前面 昨天 学习了ajax的相关知识 今天 学习表单校验插件validate, 并使用ajax 自定义校验规则 二.validate 插件 1.网络上有许多成熟的插件共使用者参考,插件就是将j ...

  9. MySQL 错误代码

    常见: 1005:创建表失败 1006:创建数据库失败 1007:数据库已存在,创建数据库失败 1008:数据库不存在,删除数据库失败 1009:不能删除数据库文件导致删除数据库失败 1010:不能删 ...

  10. BZOJ1258 三角形tri

    三角形tri 找规律神题-- 发现如果以4结尾,把4改成1.2.3输出就行了. 如果不以4结尾: 把结尾改成4输出即可,因为一定与三角形的中心相邻. 规律1:如果把串的末尾删去,那么会回到上一层. 如 ...