How to connect two SQL databases at the same time

Updated on technology 2024-03-31
4 answers
  1. Anonymous users2024-02-07

    I'll give you a copy :

    PB connects to multiple databases.

    2007-11-29 13:54:23|Category: PB |Tags: |Font size: Large, Medium and Small subscription.

    Declare multiple transaction variables.

    transaction sqlca, sqlcb;

    sqlca = create

    transaction;

    sqlcb = create

    transaction;

    Then configure accordingly.

    odbc"false

    connectstring='dsn=***uid=***pwd=***"

    odbc"false

    connectstring='dsn=***uid=***pwd=***'"

    When you use it, you can directly use Connect Using SQL Ca to connect to the database corresponding to SQL Ca and use Connect Using

    SQLCB can connect to the database corresponding to SQLCB, and can maintain a connection to multiple databases at the same time in the program, without disconnecting after the connection is used up, because frequent use of CONNECT and Disconnect may cause many unexpected problems.

    It should be noted that when we use SQL statements such as SELECT in the program, PB uses SQL CA for database connection by default, so when using SQL statements such as SELECT, we must add using at the end

    For example, select name

    into: ls_name

    from students

    where number = :ls_number

    using newtransaction;

  2. Anonymous users2024-02-06

    Post the source code and take a look

  3. Anonymous users2024-02-05

    PB uses one transaction object for each database connection.

    Usually we use SQLCA is the default transaction object.

    You can define multiple transaction objects, such as transactionmytran

    You set the connection parameters again, just like you set the connection parameters of sqlca, and finally connect, of course, is to use connectusingmytran;

    If you do not add usingmytran at the end, the system uses sqlca to connect by default.

    This will connect you to another database, and you can define several more databases, so that when you work with different databases (sql**), you will add one (using transaction potato infiltration object name) to the end

    And the cheating data window is set in the step number of ().

    You can try.

  4. Anonymous users2024-02-04

    Write an ini file specifying the address of your server, and write a read in the program.

Related questions
8 answers2024-03-31

Tools Material: Management Studio.

1. First, on the desktop, click on the "Management Studio" icon. >>>More

12 answers2024-03-31

In our personal leisure time, we will choose to use mobile phones to pass the time, in order to pursue the sound quality of mobile phones, we will choose to use headphones, headphones with wires are not as convenient as Bluetooth headsets, so we will choose Bluetooth headsets, so how to use Bluetooth headsets together at the same time? >>>More

13 answers2024-03-31

Another way to look: select ,select zy ,sum(zy as yjjefrom zy tbkk,zy brry >>>More

29 answers2024-03-31

All right. Then I ask you. Do you want two sad hearts or one of them. >>>More

12 answers2024-03-31

1. First, press the win+r key combination to open the running window, enter cmd, and click OK. >>>More