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. 【剑指Offer面试编程题】题目1367:二叉搜索树的后序遍历序列--九度OJ

    题目描述: 输入一个整数数组,判断该数组是不是某二叉搜索树的后序遍历的结果.如果是则输出Yes,否则输出No.假设输入的数组的任意两个数字都互不相同. 输入: 每个测试案例包括2行: 第一行为1个整数 ...

  2. 02-02Android 学习进度报告二

    今天我主要学习了Android的UI基础布局知识,主要是学习View与ViewGroup的概念以及其区别. 首先是代码说明: <?xml version="1.0" enco ...

  3. english-phoneme

    1. 声音概述 2. 音素phoneme与音标 2.1 音素与音标 2.2 音素与字母 2.3 字母发音-字母自然发音对照表 2.4 音标表 2.5 元音字母-辅音字母表 2.6 单元音发音口形趋势表 ...

  4. Cookie存储在哪里

    内存是临时存储,关机后信息就没了.硬盘是长久存储,不删除就一直在.内存容量决定你电脑能同时运行的程序多少,硬盘容量决定你电脑能存放多少东西. 好比内存是手,硬盘是口袋,东西可以临时放在手里,可是口袋才 ...

  5. JDBC--DBUtils的使用

    1.commons-dbutils是Apache组织提供的一个开源JDBC工具类库,它是对JDBC的简单封装,学习成本极低,并且使用dbutils能极大简化jdbc编码的工作量,同时也不会影响程序的性 ...

  6. 有关WordPress的Rss导入指南

    我是用cublog转过来.有一个软件博客备份软件(blog_backup)可以备份那个的blog.我用他备份后导出成rss2的文件.但我导入了很多次不成功.后来发现,原来blog_backup导出的格 ...

  7. Python学习笔记之基础篇(三)python 数据类型 int str bool 详谈

     python 的数据类型: 1.int:存放 1,2,3 等数据 ,用于数字的运算 2.bool :True, False 用于判断 3.str:字符串,用来存储少量的数据 4.list : 数组的 ...

  8. Redar Chart_Study

    1.Select a theme 2.Experiment with visual customization 3.Edit groups and categories 4.Creat a scrip ...

  9. 使用 esxcli storage vmfs unmap 命令在精简置备的 LUN 上回收 VMFS 删除的块

    官方原文链接: https://kb.vmware.com/s/article/2057513?lang=zh_CN 本文介绍如何通过运行 esxcli storage vmfs unmap 命令回收 ...

  10. R 《回归分析与线性统计模型》page140,5.1

    rm(list = ls()) library(car) library(MASS) library(openxlsx) A = read.xlsx("data140.xlsx") ...