HELP! FOR LOOP TO SCROLL THROUGH TABLE AND CREATE DATABASE LINK

Hi,
Here's the scenario, not much of a PL programmer, just basic SQL so really need some help people!
I have 2 tables. 1 contains list of DB's and the other contains rules to follow.
I need to create a loop that goes through the table containing the DB's and on each row a DB link is created (Only 1 link allowed!)
Once created, the schema currently logged in with also has an account on the linked DB in order to run scripts- The scripts are stored centrally hence the requirement for the link to the target DB.
There are numerous scripts that need to be executed and can all be called from 1 script, once executed the loop exists and the database link needs to be dropped.
Once dropped, the first loop continues, creating a DB link for the next DB listed in the table (and all the scripts are fired again)
This continues against all the DB's listed in the table.

Hi BlueShadow,
Thanks again for the response, you've hit the nail on the head. SQL scripts on a unix server, a loop goes through a table 1 at a time. Each row gets a link created and then all the scripts stored on the server are executed against the db linked to. So I'm assuming this is a loop within a loop.
1 loop to go through the table to create the link and then another loop within once connected to execute all the scripts against the connected DB. Once the scripts are run, the loop exits and moves onto the next server and so on until all the servers have the scripts are run.
It's PL/SQL scripts we're after and not shell scripts as this would free us from the OS constraints.
We have to drop the links due to security. Any idea on o

Similar Messages

  • My iPhone 5 won't stop scrolling through songs and I can't stop it please help !! :(

    My iPhone 5 won't stop scrolling through songs and I can't stop it please help !! :(

    settings - general - usuage - music - delete.   Then do a reset, hold down the home/sleep button together until you see the apple logo and then release, then wait for the phone to boot back up.
    Then sync the music back via iTunes.

  • For loop to iterate through temp table in store procedure in pl/sql

    Hi,
    how to create For loop to iterate through the temporary table in the store procedure?

    Neha RK wrote:
    hi,
    its not working , i need to check each record of table and do some task using if else loop inside that for..
    if not possible to loop each row of table using for then how to use while loop.
    please helpWhat's not working? We haven't got psychic powers so we can't see the code you say isn't working.
    Please provide more information like create table statements, insert statements with test data, the code you've tried
    and the output you are expecting from the input data.
    Read {message:id=9360002} and follow the advice there.

  • F4 help for a field in item table in a view cluster

    Hi All,
    I have a view cluster with two tables. I should provide F4 help for field in item table based on the selected row of the header table.
    F4 should have only values fetched based on the header table entry.
    How can i achieve this. Please suggest.
    Regards,
    Kusuma K.

    Hi amar_war,
    use screen painter to edit the screen layout where the field VKBUR is on. Double click the field to get the details screen. Here you can attach a search help to the field.
    H_TVBUR has no more parameters, it will display a list of al sales offices with description text
    H_TVBVK will also show the sales group, if VKGRP is a screen field, it will restrict the result list automatically on matching VKGRP.
    H_TVKBZ has also VKORG VTWEG SPART - it will take those values from screen if filled.
    If you are not satisfied with the results, you can easily create your own search help using own selection method and own search help exits if required.
    Try standard search help for standard field first.
    You can create a copy of VKBUR as ZVKBUR and attach search help there, you can create your own screen structure and attach the search help there - 50 ways to get your search help...
    Regards,
    Clemens

  • Having a problem when scrolling through one clip: a different clip scrolls through point and time simultaneously. Can you please assist us?

    Having a problem when scrolling through one clip: a different clip scrolls through point and time simultaneously. Can you please assist us?

    First question: this is a Captivate forum, are you sure that you have a Captivate problem (with cpvc or an imported video)?

  • For Loop exits prematurel​y - Arrays and Shift Registers

    I have attached some preliminary code (work in progress) for the RC4 encryption algorithm. For some reason the middle for loop exits prematurely. In other words it exits after 2 iterations instead of the 256 iterations that N is set to.
    I thought this was not possible and therefore I am presuming I have made some not so obvious error in attempting to use a shift register with an array.
    Please have a look. Thanks.
    Attachments:
    RC4 Encryption beta.vi ‏78 KB

    You misunderstand how a for loop operates. You can either wire a number to the N terminal or you can wire an array into it with auto-indexing turned on. With an array input, the for loop will iterate equal to the size of the array. When you wire both (a practice I do not recomend), the for loop will iterate to whichever is smaller - the array size or the N terminal. Both of your for loops on the left side is creating arrays with only two elements. I suspect that what you need in both of them is a shift register instead of exiting the for loop with auto-indexing turned off.

  • F4 help for parameter field - no values defined in the database

    Hi,
    In the Selection screen, I have two fields,
    One is for getting input for the month
    Other one is for year
    These two are created by using parameter statement
    and it is not referring to any data base table fields.
    parameters : p_bumon type bumon.
    parameters : p_bdatj type bdatj.
    At the selection screen i need input help for the month and year separately.
    I cant use the function module becos no values r fetch from the tables.
    or else to get the input help, can u please just me some predefined type declarations so that i can get by default the F4 help for this
    or any other table which have the value range for only for the month and year.
    Just it is created and the input values is passed to the function module and to calculate the number of days for that particular month and year.
    i need this very urgently
    Please suggest me in this , whether it is possible
    Thanks

    hi,
         There is a event called
    At selection-screen PROCESS ON VALUE-REQUEST for.......
    In your case it can be  :-
    At selection-screen PROCESS ON VALUE-REQUEST for  p_bumon .
    < Block 1>
    At selection-screen PROCESS ON VALUE-REQUEST for p_bdatj .
    < Block 2>
    In the block u can write the code.......
    say for month u can write
    parameters : p_month(2) type c.
    Eg for month
    At selection-screen PROCESS ON VALUE-REQUEST for P_MONTH.
    data : begin of int_month occurs 0,
    month(2) type c,
    end of ont_month.
    INT_MONTH-MONTH = '01'.
    append INT_MONTH.
    INT_MONTH-MONTH = '02'.
    append INT_MONTH.
    INT_MONTH-MONTH = '03'.
    append INT_MONTH.
    INT_MONTH-MONTH = '11'.
    append INT_MONTH.
    INT_MONTH-MONTH = '12'.
    append INT_MONTH.
    CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
    RETFIELD = 'MONTH' “ Int tab field name
    DYNPPROG = < program name>
    DYNPNR = SY-DYNNR
    DYNPROFIELD = 'P_MONTH' “ Field wer u need F4 help
    VALUE_ORG = 'S'
    WINDOW_TITLE = ‘Any description’
    TABLES
    VALUE_TAB = INT_MONTH. “ Internal table name
    please reward points if useful.... and mark it answered.....
    thank you.

  • JOIN two tables and creat a new one

    dear all,
    as a newbie in Bw i have a question.
    I worked already with other etl tools (powercenter) where there are objects to join 2 tables and create a new one to create a total transforming process to load a fact table.
    In BW an INFOSET is the only thing to join 2 odssen. On this a query can be created.
    BUT HOW TO JOIN 2 TABLES (= only ODS object?) AND CREATE A NEW TABLE FOR FUTHER PROCESSING ????
    Regards,
    Herman

    hi jacobs, refer to these links particularly second one
    http://help.sap.com/saphelp_erp2004/helpdata/en/92/43ec39d0383f09e10000000a11402f/frameset.htm
    http://help.sap.com/saphelp_erp2004/helpdata/en/f1/713c3b
    35703079e10000000a114084/content.htm
    hope this clears ur doubt
    Assigning points is the way of saying thanks in sdn
    ravi

  • OWB 10g -- Can't Create Database Links for Data Source and Target

    We installed OWB 10g server components on a Unix box running Oracle 10g (R2) database. The Designer Repository is in one instance. The Runtime Repository and the Target are in another instance. The OWB client component was installed on Windows XP. We create a data source module and a target module in OWB. The data source is on another Unix box running Oracle 9i (R2) database. We try to create database links for data source module and target module, respective. But when we created and tested the DB links, the DB links were failed.
    For the database link of data source, we got the following error message:
    Testing...
    Failed.
    SQL Exception
    Repository Error:SQL Exception..
    Class Name: CacheMediator.
    Method Name: getDDEntryFromDB.
    Repository Error Message: ORA-12170: TNS:Connect timeout occurred
    For the database link of target , we got the following error message:
    Testing...
    Failed.
    API2215: Cannot create database link. Please contact Oracle Support with the stack trace and the details on how to reproduce it.
    Repository Error:SQL Exception..
    Class Name: oracle.wh.ui.integrator.common.RepositoryUtils.
    Method Name: createDBLink(String, String, String, String).
    Method Name: -1.
    Repository Error Message: java.sql.SQLException: ORA-00933: SQL command not properly ended.
    However, we could connect to the two databases (data source and target) using the OWB’s utility SQL Plus.
    Please help us to solve this problem. Thank you.

    As I said prior the database link creation should work from within the OWB client (also in 10).
    Regarding your issue when deploying, have you registered your target locations in the deployment manager and did you first deployed your target location's connector which points out to your source?
    I myself had some problems with database link creations in the past and I can't remember exactly what they were but it had something to do with
    - the use of abnormal characters in the database link name
    - long domain name used in as names.default_domain in my sqlnet.ora file
    What you can do is check the actual script created when deploying the database link so see if there's something strange and check if executing the created script manually works or not.

  • Merging Multiple fact tables and creating a BIA target

    Hi Folks
    We are  using Dataservices with BIA.
    We want to merge mutliple fact table and create a sinvglc cube on BIA.
    when we tried to do that we get a error message that we cannot merge multiple fact tables.
    any pointers ?
    Poonam

    You could have the cubes individually on the BIA and then have a multiprovider which you can use..?
    or create separate universes on the cubes and then merge the universes in BO and then you could hit the BIA for the same..?

  • Lookup-table and query-database do not use global transaction

    Hi,
    following problem:
    DbAdapter inserts data into DB (i.e. an invoice).
    Process takes part in global transaction.
    After the insert there is a transformation which uses query-database and / or lookup-table.
    It seems these XPath / XSLT functions are NOT taking part in the transaction and so we can not access information from the current db transaction.
    I know workarounds like using DbAdapter for every query needed, etc. but this will cost a lot of time to change.
    Is there any way to share transaction in both DbAdapter insert AND lookup-table and query-database?
    Thanks, Best Regards,
    Martin

    One dba contacted me and made this statement:
    Import & export utilities are not independent from characterset. All
    user data in text related datatypes is exported using the character set
    of the source database. If the character sets of the source and target
    databases do not match a single conversion is performed.So far, that does not appear to be correct.
    nls_characterset = AL32UTF8
    nls_nchar_characterset = UTF8
    Running on Windows.
    EXP produces a backup in WE8MSWIN1252.
    I found that if I change the setting of the NLS_LANG registry setting for my oracle home, the exp utility exports to that character set.
    I changed the nls_lang
    from AMERICAN_AMERICA.WE8MSWIN1252
    to AMERICAN_AMERICA.UTF8
    Unfortunately , the export isn't working right, although it did change character sets.
    I get a warning on a possible character set conversion issue from AL32UTF8 to UTF8.
    Plus, I get an EXP_00056 Oracle error 932 encountered
    ORA-00932: inconsistent datatypes: expected BLOB, CLOB, get CHAR.
    EXP-00000: export terminated unsuccessfully.
    The schema I'm exporting with has exactly one procedure in it. Nothing else.
    I guess getting a new error message is progress. :)
    Still can't store multi-lingual characters in data tables.

  • VLD-1124: Schema and/or Database link physical configuration parameters

    Hi!
    The warning message:
    VLD-1124: Schema and/or Database link physical configuration parameters should not be set for Table1.
    Is it possible to eliminate this warning message ? Anyway , Thanks for your response!
    Bye!

    Hi guys,
    I am facing a strange problem. The code generated for my mapping has NOT used the dblinks. My OWB version is 10.1.0.4
    This is my problem in brief.
    I have installed OWB newly and started to do a sample task. I created a very simple one to one table population mapping from source to the target schema. Both are in the same database.
    When i generated the code for the mapping, it gave a warning 'VLD-2771: System privileges may not allow extraction from source EMP'.
    When i checked the code which was generated, i couldnot see any dblinks associated with my source table( which seems strange)
    CURSOR "INGRP_c" IS
    SELECT
    "EMP_SRC_TRG_CONN"."EMPNO" "EMPNO",
    "EMP_SRC_TRG_CONN"."ENAME" "ENAME",
    "EMP_SRC_TRG_CONN"."JOB" "JOB",
    "EMP_SRC_TRG_CONN"."MGR" "MGR",
    "EMP_SRC_TRG_CONN"."HIREDATE" "HIREDATE",
    "EMP_SRC_TRG_CONN"."SAL" "SAL",
    "EMP_SRC_TRG_CONN"."COMM" "COMM",
    "DEPT_SRC_TRG_CONN"."DEPTNO" "DEPTNO_1",
    "DEPT_SRC_TRG_CONN"."DNAME" "DNAME",
    "EMP_SRC_TRG_CONN"."DEPTNO" "DEPTNO",
    "DEPT_SRC_TRG_CONN"."LOC" "LOC"
    FROM "SCOTT"."EMP" "EMP_SRC_TRG_CONN" ;
    In brief this is the process i have done.
    Source schema : SCOTT & Target schema : TRG_SCHEMA
    1) I have created source (for SCOTT) and target(for TRG_SCHEMA) modules.
    2) I have also created DBLinks, Locations and Connector from source to the target locations.
    3) I registered both the source location and target locations.
    4) Validated, Generated and Deployed the Connector from source to the target.
    I was unable to trace the error. Did i miss anything in the configuration? or during the installation of OWB.
    Though it is a very old post, i hope someone can help me out here.
    Thanks in Advance,
    Sri

  • Failed to create Database Link in OWB 9.2 for remote SQL Server

    Hi,
    I have to create Database link for connecting to SQL server in a different machine.I am using OWB 9.2 and XP.
    Dataserver is the machine name which is running SQL Server
    I included follwing lines in TNSNAMES.ORA file
    hsodbc.world =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = dataserver)(PORT = 1433)
    (CONNECT_DATA = (SID=hsodbc.world)
    (HS =OK)
    I included follwing lines in Listener.ORA file
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = dataserver)(PORT = 1433)
    (SID_DESC=
    (SID_NAME=hsodbc.world)
    (ORACLE_HOME=C:\ora92)
    (PROGRAM=hsodbc)
    I included follwing lines in inithsodbc.ORA file
    HS_FDS_CONNECT_INFO = testdsn
    HS_FDS_TRACE_LEVEL = 0
    While creating new database link I gave the follwing values
    DB Link Name : Mylink
    SQL * Net Connect String: hsodbc
    User Name: sa
    password:<my password>
    Then clicked "Create and Test" button to get the follwing error message
    Testing...
    Failed.
    ORA-12154 TNS:could not resolve service name
    *Cause: The service name specified is not defined correctly in the TNSNAMES.ORA file
    *Action: Make the following checks and correct the error:
    - Verify that a TNSNAMES.ORA file exists on your repository server
    in the proper place and is accessible. See the operating
    system specific manual for details on the required name and location.
    - Check to see that the service name exists in one of the
    TNSNAMES.ORA files and add it if necessary.
    - Make sure there are no syntax errors in the file.
    Particularly look for unmatched parentheses or stray characters.
    Any error in a TNSNAMES.ORA file makes it unusable. See
    Chapter 4 in the SQL*Net V2 Administrator's Guide. If possible,
    regenerate the configuration files using the Oracle Network Manager.
    Is there anything wrong in my configuration. Please help me in getting out of this problem.
    Thanks in advance
    Andy

    Hi Mark,
    Thanks Mark.I did the changes in the specified .ora file but now it shows a different error message.
    The error is
    Testing...
    Failed.
    Cwm Error Message: SQL Exception
    Cwm Error: SQL Exception
    Class Name: CacheMediator
    Method Name: getDDEntryFromDB
    Repository Error Message: ORA-28545: error diagnosed by Net8 when connecting to an agent
    NCRO: Failed to make RSLV connection
    ORA-02063: preceding 2 lines from MYLINK
    Query: select 1 from dual@MyLink
    I got the same error when i tried manually in sql plus.
    Please help me in getting out of thid problem
    Thanks in advance
    Andy

  • How to create database link between oracle and SQL Server

    Hello Everyone,
    Here i have Oracle Database 9i and SQL Server 2005 databases.
    I have some tables in sql server db and i want to access from Oracle.
    How to create a database link between these two servers
    Thanks,

    Thanks for Everyone,
    I was struggle with this almost 10 days....
    I created Database link from Oracle to SQL Server
    Now it is fine.........
    Here i am giving my servers configuration and proceedure how i created the db link...@
    Using Generic Connectivity (HSODBC) we can create db link between Oracle and SQL server.
    Machine (1)
    DB Version : Oracle 9.2.0.7.0
    Operating System : HP-UX Itanuim 64 11.23
    IP : 192.168.0.31
    Host : abcdbt
    Machine (2)
    Version : SQL Server 2005
    Operating System : Windows server 2003 x86
    IP : 192.168.0.175
    Host : SQLDEV1
    User/PW : sa/abc@123! (Connect to database)
    Database : SQLTEST (exsisting)
    Table : T (“ T “ is the table existing in SQLTEST database with 10 rows)
    Prerequisites in Machine (2):
    a)     Oracle 10g software
    b)     User account to access SQL Server database (sa/abc@123!)
    c)     Existing SQL Server Database (SQLTEST)
    d) Tables (testing purpose) (T)
    Steps:
    1)     Install Oracle 10.2.0.1 (Only SW,No need of database) *(Machine 2)*
    2)     Create a DSN where your windows Oracle 10g SW resides *(Machine 2)*
    Control panel >> Administrative Tools >> Data Source (ODBC) >> System DSN ADD
    You can follow this link also.....
    http://www.databasejournal.com/features/oracle/article.php/3442661/Making-a-Connection-from-Oracle-to-SQL-Server.htm
    I created DSN as
    DSN name : SQLTEST
    User : SA/abc@123! (Existing user account)
    Host : 192.168.0.175 (machine 2)
    Already I have 1 database in SQL Server with the name SQLTEST
    You can create DSN with different name also (not same as db name also)
    3)     Create a hsodbc init file in $ORACLE_HOME\hs\admin *(Machine 2)*
    Create init<DSN NAME> file
    Ex: initSQLTEST
    Copy inithsodbc to initSQLTEST
    And edit
    initSQLTEST file
    HS_FDS_CONNECT_INFO = SQLTEST    <DSN NAME>*
    HS_FDS_TRACE_LEVEL = OFF*
    save the file....@
    4)     Configure Listener.ora *(Machine 2)*
    LISTENER_NEW =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.175)(PORT = 1525))
    SID_LIST_LISTENER_NEW =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = SQLTEST) *+< Here SQLTEST is DSN NAME >+*
    (ORACLE_HOME = G:\oracle 10g\oracle\product\10.2.0\db_1)
    (PROGRAM = hsodbc))
    (SID_DESC =
    (SID_NAME = PLSExtProc)
    (ORACLE_HOME = G:\oracle 10g\oracle\product\10.2.0\db_1)
    (PROGRAM = extproc) )
    :> lsnrctl start LISTENER_NEW
    5)     Configure tnsname.ora *(Machine 2)*
    SQLTEST11 =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.175)(PORT = 1525))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = SQLTEST))
    (HS=OK)
    :> tnsping SQLTEST11
    If No errors then conti….
    6)     Configure a file *(Machine 1)*
    Cd $TNS_ADMIN ($ORACLE_HOME/network/admin)
    Create a file
    $ vi TEST_abcdbt_ifile.ora
    something=
    (DESCRIPTION=
    (ADDRESS=(PROTOCOL=tcp)(HOST =192.168.0.175) (PORT=1525))
    (CONNECT_DATA=
    (SID=SQLTEST))
    (HS=OK)
    $ tnsping something
    $ sqlplus system/manager
    Your connected to Oracle database *(machine 1)*
    create database link xyz connect to “sa” identified by “abc@123!” using ‘SOMETHING’;
    select * from t@xyz;10 rows selected.
    Thanks,
    Edited by: ram5424 on Feb 10, 2010 7:24 PM

  • How to create database link between oracle9i database and oracle10g

    How to create database link between oracle9i database and oracle10g
    oracle9i database name "Prod" windows server 2003 ( 172.x.x.x)
    oracle10g database name "TEST" sun solaris 9 (165.x.x.x.x)
    Please help me on this

    For connections between 10.2 and 9.2 the 9.2 end MUST be at 9.2.0.4 or higher. Connections between 10.2 and 9.2.0.1, 9.2.0.2 or 9.2.0.3 are not supported.
    Connections between 10.2 and 9.0.1 was never been supported.
    Cheers !!!!
    Bhupinder

Maybe you are looking for

  • Accidently right clicked the blue star and now it is gone. How do I get it back?

    I was looking for a way to put the bookmark in the correct category. Right clicked and then I think I clicked an option labelled "menu" but I am not sure because at that point the dialog closed and the blue star is no more. I can find no instructions

  • Reporting Services on Windows7

    My Report Manager Home page is "almost" blank!!! All I see is: SQL Server Reporting Services,Home,Home, My Subscriptions, Help Anyone any ideas on how I get the rest of the page back?  I'm running SS2005 on Windows 7. The solution below can't be done

  • Authorization for User to Jump the Query

    Hi, The user1 (log is not generating for this user in RSSM) cannot use the jump target in the reports which have been placed under a role, whereas the other user2 (log is able to generate for this user in RSSM) is able to jump target in the reports i

  • How to create Automatic Delivery and Billing documents immediate

    Hello, I want to create Automatic delivery and billing documnets immediate once I create a sales order. E.g I need to see in the Status Bar the delivery and billing document was created. Thank you in advance Your help is highly appreciated Alfaid

  • User share folder not passing permissions to subfolders

    I set up sharing properly best as I can tell between two user accounts on my iMac, however, sharing permissions do not pass to the subfolders I put into the user share folder. Do I have to assign permissions to every folder individually? This can't b