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. java并发AtomicIntegerFieldUpdater

    java并发AtomicIntegerFieldUpdater 支持对象的成员变量原子操作类由AtomicIntegerFieldUpdater,AtomicLongFieldUpdater, Ato ...

  2. bootstrap选项卡页面中如何关闭当前选项卡及页面

    再具体说一下现在的需求: 如上界面:在新闻发布界面有一个按钮,在点击按钮的时候我需要直接把这个打开的选项卡关闭 实现思路: 1)关闭选项卡对应的页面     2)去除上方选项卡      3)激活前一 ...

  3. IOS 常用功能代码

    1. 关闭/隐藏键盘 resignFirstResponder 响应view的方法 -(IBAction)fname:(id)sender{ [sender resignFirstResponder] ...

  4. python内置函数三

    ord()  函数 和 chr()  相反   chr() 是将数字转换成assci码     ord() 是将字符串转换成assci码 显示 pow() 函数  pow(x,y,z)  表示x**y ...

  5. logback日志

    一.什么是日志框架? 是一套能够实现日志输出的工具包 能够描述系统运行状态的所有时间都可以算作日志 用户下线,接口超时,数据崩溃 二.日志框架的能力 1.定制输出目标(文件,回滚策略,数据库,网络的第 ...

  6. SciPy 特殊函数

    章节 SciPy 介绍 SciPy 安装 SciPy 基础功能 SciPy 特殊函数 SciPy k均值聚类 SciPy 常量 SciPy fftpack(傅里叶变换) SciPy 积分 SciPy ...

  7. 2.15 学习总结 之 天气预报APP volley(HTTP库)之StringRequest

    一.说在前面   昨天 学习了序列化的相关知识   今天 1.学习 volley(HTTP库)的 StringRequest请求 2.使用序列化完成相关案例 遇到问题 请求到的参数的出现中文乱码问题 ...

  8. PLsql的汉化工具

    链接:https://pan.baidu.com/s/19J-px5I_7qcMb5CHDwJZZQ 密码:pr89

  9. 牛客周赛11TG B-弹钢琴

    链接:https://ac.nowcoder.com/acm/contest/941/B来源:牛客网 题目描述 春希想听和纱弹钢琴! 为了阻止异变的发生,Pi将钢琴魔改了 钢琴上有 N 个键,每个键有 ...

  10. dmp文件自动分析

    dmp文件的分析,可以借助各种工具,比如WinDbg, CDB , NTSD,KD等.Windbg提供了窗口接口,而CDB , NTSD是基于命令行的工具,它们都使用了同样的调试引擎Dbgeng.dl ...