How to create and Pass DBLINK name at the run time

Hi,
Please help me out ....
ACCEPT DB_USER PROMPT 'Enter the DB user name :'
like this i will get the DB_USER name and i want to create one dblink with that userbame at the runtime
and in all my .sql file i have to append that user name and dblink .. how to do this ....
for example ,
1.sql file contains a query like this
select *
from <user>.emp@<dblink>
where ename= 'KING'
ACCEPT DB_USER PROMPT 'Enter the DB user name :'
user enter : SCOTT
and the dblink should create a name like SCOTT_DBLINK
and it should make the select clause in the .sql file as
SELECT *
FROM SCOTT.EMP@SCOTT_DBLINK
WHERE ename = 'KING';

Hi,
Do you want to actually CREATE DATABASE LINK on the fly? - Don't there are all sorts of implications there.
If not, go ahead and read about [SQL*Plus Substitution Variables|http://www.oracle.com/technology/support/tech/sql_plus/htdocs/sub_var.html]
Regards
Peter

Similar Messages

  • How to create and add an XML node at run time ?

    Hello and thanks to All of You i've been learning a lot since i use this forum..
    I'm having another problem, !!! i would like that my executeShape function insert a new XMLChildnode called "adverts"  to my Pages:XML via the evenListener of the execute_bt. I tryed copying the nodes and it works but it copy a blank "adverts" node in betwen each node copied. so i tryed with appendChild, but it works only once, then it say error. so i tryed with inserChildafter or inserChildbefore but this one doesnt work at all because "advert" doesnt exist. I understand why all my suggestions does'nt work (copied or append or insertchild), but i dont figure out how to get what i want . i love AS but im no advance in enought..
    My XML structure that I want is quite simple : i just want that every time I press the execute_bt, a new "adverts" is added to the Pages XML
    <Pages>
      <page id="Page1">
        <adverts>
          <adfile>Null</adfile>
          <adwidth>1</adwidth>
          <adheight>50</adheight>
          <adposx>514</adposx>
          <adposy>200</adposy>
        </adverts>
       <adverts>
           <adfile>Null</adfile>
           <adwidth>1</adwidth>
           <adheight>50</adheight>
           <adposx>514</adposx>
           <adposy>200</adposy>
         </adverts>
      </page>
    </Pages>
    Here is the code of the clip:
    execute_bt.addEventListener(MouseEvent.MOUSE_UP,executeShape);
    var _adWidth:uint=uint(Adwidth.text);
    var _adHeight:Number=Number(Adheight.text);
    var _adFileName:String=String(adFileName.text);
    var _adpage:String=String(PageInstanceName.text);
    var _adPosx:Number;
    var _adPosy:Number;
    var _adArrayID:int;
    var currentColor:Number;
    var i:int=0;
    var element:int=0;
    var Pages:XML=<Pages />;
    Pages.page = <page />;
    Pages.page.@id=_adpage;
    var boldText:TextFormat = new TextFormat();
    with (boldText) {
        font="Verdana";
        size=10;
        color=0xFFFFFF;
        bold=false;
        multiline=true;
    function executeShape(evt:MouseEvent):void {
        _adArrayID=i;
        currentColor=Adcolor.selectedColor;
        var Container:MovieClip= new MovieClip();
        Container.name=adFileName.text;
        Container.id=_adArrayID;
        var gr:Graphics=Container.graphics;
        gr.lineStyle();
        gr.beginFill(Adcolor.selectedColor, 2);
        gr.drawRect(0,0,(uint(Adwidth.text)*70),Number(Adheight.text)*1.68);
        gr.endFill();
        var Lbl:TextField = new TextField();
        Lbl.x=Lbl.y=1;
        Lbl.autoSize=TextFieldAutoSize.LEFT;
        Lbl.multiline=Lbl.wordWrap=true;
        Lbl.width=(uint(Adwidth.text)*65);
        Lbl.text=String(adFileName.text);
        Lbl.setTextFormat(boldText);
        var btn:Sprite=new CreateRoundRectButton(20,20,5,0,0xFFFFFF,"X",0xFF0000);
        btn.name="delete";
        btn.x=9;
        btn.y=50;
        addChild(Container);
        Container.x=514;
        Container.y=200;
        Container.addChild(Lbl);
        Container.addChild(btn);
        index.text=String(Container.id);
        file.text=String(Container.name);
        widht.text=String(uint(Adwidth.text));
        heigth.text=String(Number(Adheight.text));
        posx.text=String(Container.x);
        posy.text=String(Container.y);   
        Pages.page.appendChild(<adverts />);
       Pages.page.adverts.appendChild(<adfile />);
        Pages.page.adverts.appendChild(<adwidth />);
        Pages.page.adverts.appendChild(<adheight />);
        Pages.page.adverts.appendChild(<adposx />);
        Pages.page.adverts.appendChild(<adposy />);
        Pages.page.adverts.adfile=String(Container.name);
        Pages.page.adverts.adwidth=String(uint(Adwidth.text));
        Pages.page.adverts.adheight=String(Number(Adheight.text));
        Pages.page.adverts.adposx= String(Container.x);
        Pages.page.adverts.adposy=String(Container.y);
       //var templist:XMLList= Pages.page.adverts.copy();
        //templist[0].adfile = String(Container.name);
        //templist[0].adwidth = String(uint(Adwidth.text));
        //templist[0].adheight = String(Number(Adheight.text));
        //templist[0].adposx = String(Container.x);
        //templist[0].adposy = String(Container.y);
        //Pages.page.appendChild(templist);
        //Pages.page.insertChildAfter(Pages.page.adverts[0], templist);
        trace(Pages);
        btn.addEventListener(MouseEvent.CLICK, deleteme, false, 0, true);
        Container.addEventListener(MouseEvent.MOUSE_DOWN,StartDrag);
        Container.addEventListener(MouseEvent.MOUSE_UP,StopDrag);
        i++;

    Sorry , i Found the solution......:
    var Pages:XML=<Pages />;
    Pages.page = <page />;
    Pages.page.@id=_adpage;
    var boldText:TextFormat = new TextFormat();
    with (boldText) {
        font="Verdana";
        size=10;
        color=0xFFFFFF;
        bold=false;
        multiline=true;
    function executeShape(evt:MouseEvent):void {
        _adArrayID=i;
        currentColor=Adcolor.selectedColor;
        var Container:MovieClip= new MovieClip();
        Container.name=adFileName.text;
        Container.id=_adArrayID;
        var gr:Graphics=Container.graphics;
        gr.lineStyle();
        gr.beginFill(Adcolor.selectedColor, 2);
        gr.drawRect(0,0,(uint(Adwidth.text)*70),Number(Adheight.text)*1.68);
        gr.endFill();
        var Lbl:TextField = new TextField();
        Lbl.x=Lbl.y=1;
        Lbl.autoSize=TextFieldAutoSize.LEFT;
        Lbl.multiline=Lbl.wordWrap=true;
        Lbl.width=(uint(Adwidth.text)*65);
        Lbl.text=String(adFileName.text);
        Lbl.setTextFormat(boldText);
        var btn:Sprite=new CreateRoundRectButton(20,20,5,0,0xFFFFFF,"X",0xFF0000);
        btn.name="delete";
        btn.x=9;
        btn.y=50;
        addChild(Container);
        Container.x=514;
        Container.y=200;
        Container.addChild(Lbl);
        Container.addChild(btn);
        index.text=String(Container.id);
        file.text=String(Container.name);
        widht.text=String(uint(Adwidth.text));
        heigth.text=String(Number(Adheight.text));
        posx.text=String(Container.x);
        posy.text=String(Container.y);   
        var adverts:XML= new XML;
        adverts=<adverts />;
        adverts.adfile=<adfile />;
        adverts.adwidth=<adwidth />;
        adverts.adheight=<adheight />;
        adverts.adposx=<adposx />;
        adverts.adposy=<adposy />;
        adverts.adfile=String(Container.name);
        adverts.adwidth=String(uint(Adwidth.text));
        adverts.adheight=String(Number(Adheight.text));
        adverts.adposx= String(Container.x);
        adverts.adposy=String(Container.y);
        Pages.page.appendChild(adverts);
        trace(adverts);
        btn.addEventListener(MouseEvent.CLICK, deleteme, false, 0, true);
        Container.addEventListener(MouseEvent.MOUSE_DOWN,StartDrag);
        Container.addEventListener(MouseEvent.MOUSE_UP,StopDrag);
        i++;

  • How to mute and lock screen rotation at the same time? Loved this feature in iOS 5.

    How to mute and lock screen rotation at the same time? Loved this feature in iOS 5.

    You cannot do two different simultaneous VISA writes over a serial bus. There is a single rx line on the pc's com port and a single rx line on the instrument. You only hope is if the instrument allows you to chain commands and the reception of the carriage return triggers the instrument to implement both at the same time. Maybe you can send CTS01 and CTS02 separated by a space or comma. The manual should tell you if that's possible or maybe you need to ask the manufacturer.

  • How to create a single large bitmap data at run time?

    Hi All,
    Please help me in overcoming the issue that is mentioned below.
    Requirement:   Create single very large bitmap data which contain some 30 PNG images loaded and for each image it should have some text.  Images and text are loaded dynamically (AS2 code. Images are stored in a remote server). The bitmap data display should show 8 images at a time and corresponding text. We can see rest content by scrolling (kinetic scroll is implemented). How can I go for it?
    Some questions:
    · Is there any limit for size of bitmap data ( As per link there is restriction on the height of the bitmap we can create in AS2 (max value is 2880 which is not enough for some 30 element list http://help.adobe.com/en_US/FlashLite/2.0_FlashLiteAPIReference2/WS84235ED5-9394-4a52-A098 -EED216C18A66.html ) How to overcome this limitation?
    · If we create individual bitmap data for 30 individual PNG files, we find some jerks in scroll. How can we have smooth scrolling?
    Thanks and Regards,
    Manjunath

    Thank you very much for the reply.
    The number of bitmaps are not 30 always. It can vary in real time and since all PNG files are stored in a remote server which are also vary during runtime; so we can not predefine the number of child movieclips. It could be 10 at some duration and may be 20 at some other time.
    Any help?

  • How to create Dynamic prompts for a field at run time

    HI all
    I have a table which has 2 columns name attribute1 and attribute1_meaning.
    Attribute1_meaning is the the meaning of attribute 1.
    ex if attribuite1 is 500.. attribute1_meaning tells us if its MHz. RAM or whatever.
    So IN my form I want to display the prompt of attribute1 as the value attribute1_meaning
    Is there a way to do this ?
    thanks

    It also depends on your form layout. Francois' solution works if you only display one record. If you display multiple records this won't work, since an item can only have one prompt at a time. There is no set_item_instance_property for the prompt.
    In that case you can create two fields attribute1 and attribute1_meaning. You can set the visual attribute of field attribute1_meaning to look like a normal prompt.

  • How to create sub-directory by PL/SQL in run-time?

    Hello,
    I have directory defined in Oracle DB and I need to create a sub-directory by run-time PL/SQL code and move my file into the sub-directory.
    The DB version is 10.2.0.3.0.
    How can i do it without creating a new directory in DB each time i need to create a sub-directory?
    Thanks!

    Or, as directory objects are replacable you can just change them using dynamic SQL...
    e.g.
    execute immediate 'create or replace directory my_home as ''/home''';
    execute immediate 'create or replace directory my_home as ''/home/newfiles''';
    of course this isn't going to work if the directly object is going to be used by multiple users at the same time, but if it's for a dedicated process then it would.
    (it also relies on the operating system directories having appropriate read/write permissions, but that's outside the ability of Oracle to control)
    Personally though, I'd avoid having things moving about dynamically.
    The design of my process would specify where files are going to be located and the correct number of directory objects defined and created up-front.
    Any 'incoming' files would have to be located in one of those known locations, whether that's under the control of the 'users' supplying the files, or some other process (o/s script maybe?) that receives the files and moves them to the known location.

  • How to rotate and translate an object at the same time??

    Hi, I have a problem with rotation and translation of an object at the same time. I wrote a behovior class for my object (a cylinder). When some conditions are true the cylinder is added to a robot arm. Then it is translated so that the cylinder would be very close to the arm (looks like the robot is holding it). And now the behavior should also rotate the cylinder because the angle is 0 and it should be 90. I can translate the object or I can rotate the object but when I'm trying to do it at the same time (I want to combine rotation and translation) it doesn't work.
    Could anyone help me, please :)

    You can used to Matrix3f
    This object is a rotation and translate matrix
    for example:
    private void componerTransformada(){
    Quat4f rot = new Quat4f((float) this.getRotacionSobreX(),(float) this.getRotacionSobreY(),
    (float) this.getRotacionSobreZ(),1.0f);
    Vector3f tras = new Vector3f(-4.0f,-4.0f,(-1)*this.getDistanciaDeLaCamara());
    this.setTransformacion(new Transform3D(new Matrix4f(rot, tras, 1.0f)));
    Quat4f is a matrix of ratation
    vector3f is a direction vector
    Transform3d is building with Quat4f and Vector3f.
    That is work i use this to situe the view of point.
    good locky

  • How to create '  ' and , around object name

    Hi All,
    I need to know one thing from your end, is there any way we can put ' ' and , around the object name. for example the below query would generate a table
    name in one schema.
    select ' drop table '|| table_name ||';' from user_tables.
    would generate table name like this
    Test
    Test1
    Now, I just need to alter a query where it reflect ' ' and , around the table name.
    like...
    'Test', 'Test1' etc.
    hare krishna
    Alok

    Its quite simple Alok. You just need to change the ; in your select query in between those single quotes to a comma.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
    With the Partitioning, OLAP and Data Mining options
    SQL> select ' drop table '''|| table_name ||''';' from user_tables where rownum<=5;
    'DROPTABLE'''||TABLE_NAME||''';'
    drop table 'ARIES_LOAD_TABLE';
    drop table 'ASSID_TAB';
    drop table 'BADGER_ELIGIBILITY_2003';
    drop table 'BENEFIT_CUST_NUM_2003';
    drop table 'CAL_HOLIDAY_CATEGORY_MSTR';
    SQL> select ' drop table '''|| table_name ||''',' from user_tables where rownum<=5;
    'DROPTABLE'''||TABLE_NAME||''','
    drop table 'ARIES_LOAD_TABLE',
    drop table 'ASSID_TAB',
    drop table 'BADGER_ELIGIBILITY_2003',
    drop table 'BENEFIT_CUST_NUM_2003',
    drop table 'CAL_HOLIDAY_CATEGORY_MSTR',
    SQL> I just used rownum to limit the search results to 5.

  • How to change the Table name during the Run Time

    Hi
    I have to generate a Oracle Developer/2000 report.
    The input paramater is Vendor ( Ex:- Aetna,Cigna,BCBS...)
    If the input paramater is Aetna then the table report should use is Aetna_Emp_Data or
    If the input is Cigna then The table is Cigna_Emp_Data.
    The Layout and fileds selected for the report remains the same.
    Please let me know !
    Regards
    Kiran Ravuri
    Workscape

    Why don't you check with you co-worker Goran he has done this.

  • How to create and drop partitions automatically?

    How to create and drop partitions automatically?
    The environment is Oracle 10g(10.2.0.3) on the RHEL4.0 system.
    I want to partition the MESSAGE table by date (NUMTODSINTERVAL(1,'DAY') ). One partition per day. Because the table is huge, only 2 partitions (today and yesterday's data) are necessary to be kept online. All the partitions that earlier than the previous day will be backed up and then dropped. I want to make the partition creating and dropping jobs run automatically. How to do it?
    Thank you

    junez wrote:
    How to create and drop partitions automatically?
    The environment is Oracle 10g(10.2.0.3) on the RHEL4.0 system.
    I want to partition the MESSAGE table by date (NUMTODSINTERVAL(1,'DAY') ). One partition per day. Because the table is huge, only 2 partitions (today and yesterday's data) are necessary to be kept online. All the partitions that earlier than the previous day will be backed up and then dropped. I want to make the partition creating and dropping jobs run automatically. How to do it?With 11g, new partitions can automatically be created.
    With 10g, you need to do that yourself. I prefer to create a "buffer" of future partitions - in case the job whose task it is to add new partitions gets held up or stuck. Or the job queue is full due to some problem and it does not get the chance to execute in time.
    I dislike your partitioning criteria. I prefer using the date directly and not mangling it to something else. If a specific day has a large volume of data, then another option is to use hourly date ranged partitions. With local partitioned indexes and the date time range used for querying, this can be quite effective performance wise.
    As for partitioning maintenance - I use a custom written partitionManager PL/SQL package that provides an interface for adding daily and hourly partitions to a table. Input parameters are for example name of the table, start date and the number of partitions to add. Similarly it provides interfaces for aging partitions - again by specifying a table and a date-time to use as the starting point, back into time, for removing old partitions.
    I typically call this code from the actual application code itself - so before a new partition will be used for example, the app code will first ensure that it has a partition to use. This is safer than a separate job as the dependency is resolved where and when it is needed - and not done as a separate task.
    For example - you should have a procedure/package that provides an app the means to log a message into your MESSAGE table. As part of an autonomous transaction, this procedure can check if the required partition exists, before attempting to insert a message into the table.
    Where this approach is not possible, a DBMS_JOB can be used to create future partitions - but as I mentioned, rather have it add a bunch of future (empty) partitions in case something goes pear shape with the job mechanism.

  • How to create and share attributes or variables in Standard WebDynpro?

    Tremendous 2010 guys!
    I'm having trouble about a Web Dynpro ABAP application. It uses two Web Dynpro components: FITE_VC_GENERAL_DATA and FITV_VC_COST_ASSIGNMENT, and the users would like to delete showed-in-text-field default info in the first View (contained in FITE_VC_GENERAL_DATA) but they want the user provides his/her own info in a second view by a window (view, contained in the second web Dynpro component FITV_VC_COST_ASSIGNMENT) that appears after clicking a button in the fisrt view. So, I want to declare an attribute or variable (a flag) in the second Web dynpro component that is to be copied or transmitted or exported at the first Web dynpro component to indicate "The user already used the second Web Dynpro component", and thus, to avoid an enhancement point I set in the first Web Dynpro having effect and delete the valid data entered by user (because in the begining, yes, I want to delete the data, but once the user writes his/her data, I need a FLAG to know it).
    Really I am a newbie, even a dummy in Web Dynpro ABAP, I dont know if it is possible to declare new attributes in a Standard Web Dynpro Component (but I used an enhancement point to declare a char variable inside a method, but it is only local and I cant communicate it to another WD component). Because it is OO ABAP, I know it is not possible to declare Global data usable by various Web Dynpro Components, isnt it?
    Beyond, If I could create my own attributes in the second Standard Web Dynpro Component, How I should export them to the first Web Dynpro Component?
    I was wondering if it would be a good idea to use a transparent table to store my flag and use it again when the run time is on the first Web Dynpro component... Or use ABAP or SAP Memories... Have mercy, help me please!

    Hi Parga,
    You need to declare the variable at Interface controller and need to map this at the context level.
    Like a variable declared at web dynpro component context level can be used among all views.
    every web dynpro component have an Interface component. this can be used in other components where this perticular component is used it is also have a Context.
    For more info Take Usage of Component Controller Examples.
    [Check this thead|http://help.sap.com/saphelp_nw70/helpdata/en/3a/165da11551994db913f56829f8f3f1/frameset.htm]MPUSAGE
    WDR_TEST_CMPUSAGE_CI1
    WDR_TEST_CMPUSAGE_CI2
    WDR_TEST_CMPUSAGE1
    WDR_TEST_CMPUSAGE2
    WDR_TEST_CMPUSAGE3
    WDR_TEST_CMPUSAGE4
    WDR_TEST_CMPUSAGE5
    WDR_TEST_REF_CMP_USAGE_CI
    WDR_TEST_USAGE_GROUPS_CI
    WDT_COMPONENTDETAIL
    WDT_COMPONENTUSAGECheerz
    Ram

  • How to change the printer name in the User profile in the run time.

    Hi
    I am in need to change the printer name in the run time.
    Do any one hav idea about this?
    Thanks
    Karthik

    The user default settings can be changed using funtion module SUSR_USER_DEFAULTS_PUT.
    Import parameter USER_DEFAULTS-SPLD will hold the default printer name.

  • How to create and deploy a simple jstl applicaton in weblogic 10.3.3

    How to create and deploy a simple jstl applicaton in weblogic 10.3.3

    1) Since JSTL libraries are provided as Web application libraries, they must be deployed before the Web application that is using JSTL functionality is deployed. The libraries can be deployed using the Administration Console or with the command-line weblogic.Deployer tool.
    Here’s an example of deploying a JSTL 1.2 library using the weblogic.Deployer command-line:
    java weblogic.Deployer -adminurl t3://localhost:7001
    -user weblogic -password weblogic
    -deploy -library
    d:/beahome/wlserver_10.3/common/deployable-libraries/jstl-1.2.war
    This command deploys the JSTL 1.2 library using the default library-name, specification-version and implementation-version defined by the MANIFEST.MF in the library.
    After a library is deployed, the extension-name, specification-version and implementation-version of the library can be found in Administration console. This information can also be found in the MANIFEST.MF file of the library WAR file.
    For more information on deploying a Web module refer below URL
    http://docs.oracle.com/cd/E15051_01/wls/docs103/deployment/deployunits.html
    2) To reference a JSF or JSTL library, a standard web application can define a <library-ref> descriptor in the application’s weblogic.xml file. Here is an example:
    <library-ref>
    <library-name>jsf</library-name>
    <specification-version>1.2</specification-version>
    <implementation-version>1.2.0</implementation-version>
    <exact-match>false</exact-match>
    </library-ref>
    For more information on referencing a Web application library refer below URL
    http://docs.oracle.com/cd/E15051_01/wls/docs103/programming/libraries.html
    3) Create a sample JSP in your application and JSP should look as shown below
    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
    <html>
    <head>
    <title>TestJSTL</title>
    </head>
    <body>
    <c:set var="topic" value="JSTL" />     
    <c:out value="${topic}" />
    </body>
    </html>
    4) Create WAR and deploy and test.
    Edited by: Murali Veligeti on Jul 26, 2012 9:00 AM

  • How to create and use mutable array of UInt8

    Hello!
    If I get it right, UInt8 *buffer, buffer - is a pointer to a start of array?
    Then how to create and use mutable array of UInt8 pointers?
    The main target is a creation of the module that will store some byte array requests and will send all of them at the propriate moment.

    I try
    - (void) scheduleRequest:(UInt8 *)request {
    if (!scheduledRequests) scheduledRequests = [[NSMutableArray array] retain];
    [scheduledRequests addObject:request];
    But get warning:"passing argument 1 of 'addObject:' from incompatible pointer type"

  • HOW TO CREATE  and  USE EVENTS IN WORKFLOWS .

    HOW TO CREATE  and  USE EVENTS IN WORKFLOWS with the help of classes.
    What i am doing is..
    open se24
    event tab->event name->parameters
    method tab->method name->event handler->copy parameters
    interface tab->if_workflow->enter
    tell me what else to do step by step
    Another important thing is that HOW to use these class events to trigger the workflows.
    REPLY ASAP
    THXS IN ADVANCE

    Hi,
    Pl. see this blog...
    Raising ABAP OO events for workflow
    Regards,
    JOy.

Maybe you are looking for