Dynamic change link to data base

Hello.
I have project with 40 pages, in each page I have SQL request , like "select * from table@dbtest". I want dynamically change link to my test data base on to real data base.
What should I do for that would when I selecting another base, link to data base changed in all SQL requests?

Personally, I'd rather create a synonym yourtable=yourtable@dblink, and just use 'select * from yourtable' in Apex pages. You could also create view yourtable=select * from yourtable@dblink. I usually like to have a DB link named in a meaningful way, so that I know where it's pointing just by looking at the name.
I usually start with a local table to get Apex to read the structure, and then just replace that with a synonym or view later.
Edited by: maceyah on Jan 12, 2012 11:38 AM

Similar Messages

  • How to dynamically change link in Page Viewer Web Part SharePoint 2010?

    Newbie Question:
    Situation:
    a) Created: Two Site Pages page 1 & page 2
    b) Page 1: Includes simple hyperlink text Example - Home | About Us | Contact etc
    c) Page 2: Includes Page Viewer Web Part that includes link to an existing web site (this site has all of the pages) and the olde site is shown in SharePoint site
    Complication:
    a) I want the users to click on Page 1 - About Us etc
    b) The View on Page 2 - page viewer link should be dynamically updated to About Us . If user clicks on contact us on Page 1..the page 2 view should change dynamically to Contact US
    ASK:
    a) How do I dynamically update the links in Page Viewer web part using minimal coding (if possible)
    Any Guidance will be greatly appreciated.

    Hello,
    You can also used the another appoch,
    Create your custom webpart , then add the PageViewer Webpart at run time,Create webpart property for the custom webpart to change the url and add the PageViewer webpart runtime,
    I have created the custom webpart property to specified the url at the tine of edit the webpart
    Here is the code
    using System;
    using System.ComponentModel;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using Microsoft.SharePoint;
    using Microsoft.SharePoint.WebControls;
    using System.Collections;
    using Microsoft.SharePoint.Publishing.WebControls;
    using Microsoft.SharePoint.WebPartPages;
    namespace MyNameSpace.MyPageViewer
    [ToolboxItemAttribute(false)]
    public class MyPageViewer : System.Web.UI.WebControls.WebParts.WebPart
    private string _customUrl = "http://yourdefaulturl";//Specified default url
    [WebBrowsable(true)
    , Personalizable(true)
    , Bindable(true)
    , Browsable(false)
    , DefaultValue("")
    , Category("Custom Page Viewer Properties")
    , WebPartStorage(Storage.Shared)
    , FriendlyName("PageViewer URL")
    , Description("PageViewer URL")]
    public string CustomUrl
    get { return _customUrl; }
    set {if (string.IsNullOrEmpty(value) == false) { _customUrl = value; } }
    #endregion
    public MyPageViewer()
    this.ChromeType = PartChromeType.None;
    protected override void OnInit(EventArgs e)
    EnsureChildControls();
    base.OnInit(e);
    protected override void CreateChildControls()
    string pageViewerUrl = CustomUrl;
    Microsoft.SharePoint.WebPartPages.PageViewerWebPart pageViewerWebPart = new Microsoft.SharePoint.WebPartPages.PageViewerWebPart();
    if (!string.IsNullOrEmpty(pageViewerUrl))
    pageViewerWebPart.ContentLink = pageViewerUrl;
    pageViewerWebPart.ChromeType = PartChromeType.None;
    pageViewerWebPart.Height = "382";
    pageViewerWebPart.Width = "682";
    this.Controls.Add(pageViewerWebPart);
    protected override void OnLoad(EventArgs e)
    base.OnLoad(e);
    protected override void OnPreRender(EventArgs e)
    base.OnPreRender(e);
    Hope this will help you
    Hiren Patel | Please click "Propose As Answer" if this post solves your problem or "Vote As Helpful" if this post has been useful to you.

  • How can I dynamically change the Application Date Format?

    Hi everyone...
    In my application (v 3.2) I let the user set the application date format dynamically through a "preference" value they can change on the go.
    I then take the format they pick and assign their value (ie: DD-MON-YYYY) and pad 'HH:MI' to it and use this as the PICK_DATE_FORMAT_MASK which works great for most date pickers.
    The problem I have is that some date picker I use in the application don't require the HH:MI, they simply need the DD-MON-YYYY part. Could I use the NLS_DATE_FORMAT for this? Would I then be able to use date pickers with the "use application date format"? It doesn't seem to work for me.
    In other words, I basically need 2 date formats for my application date pickers; 1 for simply the dates and 1 for dates including time. And these 2 formats are chosen by the user by setting an application preference dynamically at run time.
    Not sure if I make sense here....any idea?
    Thanks!
    Francois

    "use application date format" is the choice you want.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
    -------------------------------------------------------------------

  • Generating dynamic command links in data table

    Hi,
    I have a requirement to generate dynamic number of columns in a datatable. Also these columns should contain a command link.
    I have written following piece of code to do so...
    public UIData getDataTableBinding()
         UICommand comm = null;
         UIColumn col;
         UIOutput out = null;
         Application app = app = FacesContext.getCurrentInstance().getApplication();
    // Suppose I want to generate 7 columns
         for(int j = 0; j < 7; ++j) {
         out = new UIOutput();
         col = new UIColumn();
         comm = new UICommand();
         ValueBinding vb = app.createValueBinding("#{" + j + "}");
         out.setValueBinding("value", vb);
         out.setRendererType("javax.faces.Text");
         comm.setRendererType("javax.faces.Link");
    comm.getChildren().add(out);
         MethodBinding mbButton = app.createMethodBinding("#{pc_File1.doLink1Action}",
    null);
         comm.setAction(mbButton);
         col.getChildren().add(comm);
         dataTableTemp.getChildren().add(col);
         return dataTableTemp;
    I have bound the "binding" attribute of the data table to getDataTableBinding()
    method.
    If I remove all the references to UICommand i.e comm variable, table is displayed properly, but if
    I try to include a command link component as mentioned above I get "Assertion failed error"
    SRVE0068E: Could not invoke the service() method on servlet Faces Servlet. Exception thrown :
    javax.servlet.ServletException: javax.faces.el.EvaluationException: Error getting property
    'dataTableBinding' from bean of type pagecode.File1: javax.faces.FacesException: Assertion Failed
         at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:638)
         at com.ibm._jsp._File1._jspService(_File1.java:92)
         at com.ibm.ws.jsp.runtime.HttpJspBase.service(HttpJspBase.java:88)
    Any kind of help on this issue would be appreciated,
    Thanks in advance,
    Raina

    Hi,
    I solved my problem just by replacing UIOutput component with HtmlOutputText component and then making it as a child component of UICommand component.
    Now I am facing a new problem. Whenever I try to refresh the page I get following exception
    "SRVE0026E: [Servlet Error]-[Faces Servlet]: java.lang.IllegalStateException: Duplicate component ID 'form1:table1:cmd0' found in view."
    I am explicitly setting the component id of the UICommand component using the setViewId() method.
    This problem is observed only when I refresh the page. In case I navigate to another page and then again come back to this current page, then I don't get this exception.
    Your help would be appreciated,
    Raina

  • How to retrive dynamic directory structure from data base and show it

    i want to display a directory structur on jsp my problem is that i want to read it from a database how i can read
    a tree structure i found a function to read directry structur but if i use this function i am not able to find who the parent is ? this is the function i found cna any one help me ?
    public void iterate(File someDirectory) {
    Vector allFiles = new Vector();
    File[] dirContents = someDirectory.listFiles();
    for (File f : dirContents) {
    allFiles.add(f);
    for (int i = 0; i < allFiles.size(); i++) {
    File file = (File) allFiles.get(i);
    if (file.isDirectory()) {
    dirContents = file.listFiles();
    for (File f : dirContents) {
    allFiles.add(f);
    // Process 'file' or do whatever
    }

    Thanks for reply i am not actualy deling with files i am creating a web application in which i am having organize functionality
    user creat folders and put there document in that like out look user can creat folder inside folder
    i am storing tham in a database table my problem is how to retrive them so i can show them as a tree structur
    i am using this code to show on jsp
    {color:#808000}<table>
    <tr>
    <td >
    <ul class="flipMenu">
    <li><span class="menu">Folder</span>
    <ul>
    <c:forEach var="folderList1" items="${folderList}" >
    {color}
    {color:#808000}<li ><a class="submenu25" id='<c:out value="${folderList1.id}"/>' href="folderAgreement.htm?folderid=<c:out value="${folderList1.id}"/>" onmouseup="a('<c:out value="${folderList1.id}"/>');" ><span ><c:out value="${folderList1.name}" /> T</span></a>
    <ul>
    <li> <a href="# onclick="window.open('createSubFolder.htm?folderid=<c:out value="${folderList1.id"/>&agreetitle=<c:out value="${agreements.title}"/>', 'invite_wnd', 'height=700, width=800, status=no, menubar=no, toolbar=nu, location=400'); return false;">Add Folder
    </li>
    <li> <a href="folderDetail.htm?folderid=<c:out value=${folderList1.id"/>&flag=folder"><span class="submenu2">Detail</span>
    </li>
    <li> <a id="<c:out value="${folderList1.id}"/>" href="folderDelete.htm?folderid=<c:out value="${folderList1.id}"/>&flag=folder" onclick="conformDelete('<c:out value="${folderList1.id}"/>')" ><span class="submenu2">Delete Folder</span></a>
    </li>
    </ul>
    </li>
    </c:forEach>
    {color}
    {color:#808000}</ul>
    </li>
    </ul>
    </td>
    </tr>
    </table>{color}

  • How to modify a data base table ?

    Hi,
        i am working on a list output where if user is editing a field and that field need to be updated in the data base. table is a z table .
    the table has 5 fields .
    mandt       key field
    matnr       key field
    werks      key field
    charg       key field
    lgpla         key field
    usnam
    edate
    in the list output , the user will change the values in the lgpla field and that field need to be changed in the data base table.
    i have used the stmt :
    modify< table> from <internal table> ,
    but a new record is added in the data base instead of overwriting the existing one.
    but the record can be seen modified in the internal table.
    kinldy let me know the method of updating or modifying the existing value in the data base.
    thanks and regards,
    vikram.

    Hi,
    Its not possible to change Primary Key contents in the database.
    it  mention in documentation of MODIFY Statement,
    a line is searched for in the database table that has the same content
    in the primary key as the corresponding beginning part of the work area.
    If such a line is not found,
    a new line is inserted according to the same rules as for the INSERT statement.
    If such a line is found,
    this line is overwritten according to the same rules as for the UPDATE statement
    if you want insert the modified line first Delete from database,Then Use Modify Statement
    Regards,
    Raghava Channooru

  • Transport Data Basis

    I have create Request no for Data basis.
    When my basis team transport the change request for the data basis, there is an error say : "No suitable RFC Destination could be found". Although, I Have no define any RFC destination in Data basis because the BW and Sem BCS are in the same server.
    Any idea on this??
    Thanks.

    To Eugene n Mani,
    I have check the ABAP memory in Profile Parameter setting, it is already set to 300MB. Help Documentation told me that normally it is set in 200-300 MB. So I assume , The ABAP Memory is enough in 300MB. Don't you think so?
    I have also tried to maintain the fiscal year just like Mani told. But the short dump still exist.
    Back to the first Error ( RFC Connection Error which is solved using Julia and your previous message. Thanks to all of you),
    These was happened,
    1. In one "Request No", I save the data basis setting, the consolidation area setting, the periodic setting, the version setting.
    2. I tried to transport the "Request No" , but error on RFC Connection.
    So I tried to create the RFC connections and assign them in FINB_TR_Dest (both in Development and Production). Tried and tried again.But none of them work. Then finally, I tried to create RFC Connection only in production which is point to Client 008. From your explanation , I assumed my RFC were already correct. But the error still exists.
    3. In desperate, I tried to make another "Request No" which is only include the data basis setting. Since I have already set all the setting for data basis, I just change the description of the data basis in order to make the "Request No" show up.
    4. Afterwards, I transported the new request no. And it was successfull (no error in RFC Connection).
    When I check on the production, system not only transport the changes for the new request no (changes on the data basis description) but it also transport the consolidation area.  This is so strange for me.  It seems when we create the request no, system do not record only the changes but all setting . Is it right? Is it the concept of Transport?
    5.When I click on data basis which is created during the transport, the short dump show up :=))
    I have already send message to SAP.
    Thanks for all your respond and suggestion.

  • How to change the Data base connection Dynamically

    Hi
    Hi create a crystal reports using crystal report 12.0 in this i use the standard wizard and local data base connection and create a dotnet programme for this .Now i want to  change the database because because i want to instal it in client they use a different connection so i need to change the connection .How is it possible . PLzzzzz tell me it is urgen t
    Addvance thnks

    Hi
    To change the database you can use DataSource  Option that is present in the Menu Bar.
    Go to Database
    ->Set Datasource Location
    ->Replace the current Data Source with the new Datasource.
    Hope this helps
    Shraddha

  • Dynamically change data type of a field

    Hello,
    I'm trying to dynamically create a SQL statement which will insert record sin to my SQL data base.
    I dynamically bring field name sand values. then concatenate them in a string and then Execute the SQL string in a native SQL eXEC statement.
    It all worked fine till I used signle quotes for all field values.
    but now I wante dto insert a field of type "Money" is SQL which is nothing but AMount/currency in SAP.
    Now If I remove this quotes it is working fine. but If I have a negative number the "-" sign comes in the end in my abap code and gives a short dump in insert statement.
    now I wante dto make that variable dynamic in to currency rather than String.
    Please let me know how Can I change it dynamically.
    EG: w_field_value = 3000.25-  (value in SAP / w_field_value is of TYPE String)
    Before I concatenate this , I wanted to change its type to AMOUNT ...
    thanks.

    Just Use the field Symbols.
    Regards
    Rusidar S

  • Appleworks freezes when attempting to change a data base field

    In a data base I created, trying to change a number in one field will freeze Appleworks. A number can be entered, but any attempt to delete, add to or change the data in that one field causes a freeze. This does not happen in any other field in this data base, nor in any other document, as far as I know. This is a fairly recent problem, and did not occur when the data base was first created.
    Is there a way to fix this without losing all the data in that field?
    Thanks!

    Hi Yvan,
    I'm sorry, but your link did not help my particular problem.
    Can I make a list of the "freezing" field and an identifying second field, delete the problem field, and then re-enter the data in a newly created field? Being efficient (read lazy) I was trying to get away from having to re-enter all the data. There are only 384 records, but the thought of redoing even one field is mind-numbing.
    Anyone else have a suggestion???
    Thanks!

  • How to change the Data Base Relation in a universe?

    We are working with BO 6.5a.One universe in connected to a 'DB2/400 (iSeries)'  data base.
    All Objects in a universe are related to a defined library like <libraryname>.<tablename>.<fieldname>.
    We like to change the libraryname. Is there any chance to do this in the existing universe?
    Why?
    We like to have the same database two times in our System, only the data are different.
    Details:
    The universe of course points to a library (A) and connection is done with ODBC.
    Changing ODBC to another library (B) is no problem; and, of course we then can change the tables in the universe manually => a lot of work.
    But we like to change the pointer in the universe at once (each object shows to the library (A) and we want them to show at (B)).
    The 'refresh structure' - button won't do it.

    In the universe you can select all the tables Ctrl-A, right click and rename tables. Remove the reference to the library.

  • Changing the Target data store dynamically

    Hi,
    I have a requirement to load same kind of data into 12 different target tables. Client maintains data in period vise, i.e. Jan data in a table TABLE_01, Feb data in TABLE_02, Dec data in TABLE_12 etc. The structures of all these tables are same.
    My program will process only one period’s data at a time and processed data will be loaded into a table TABLE_SRC. After this, according to the processing period, I need to post the data into the target tables TABLE_01, TABLE_02 etc. i.e. if the data is for period Jan then to TABLE_01, data is for period Feb then to TABLE_02 and so on.
    For accomplishing the same, I need to create 12 different interfaces. So is there any way to accomplish the same using a single interface by changing the target data store dynamically? I am looking for a solution other that creating procedures.
    Any Help is appreciated.
    Thanks in advance.
    DJ

    Yes, it is possible....
    1) at the target datastore use a variable at resource
    2) create a query that returns all target tables in a source tab (procedure step)
    3) at target tab, call the interface scenario send the query result as parameter.
    That will allow you execute the same interface for disitnct targets.
    Does it help you?

  • Hiding dynamic selections which is default if Logical Data Bases is  used

    Hi All,
       Am making use of PNP logical data base in my report .On the selection screen there is a default icon with text dynamic selections is visible besides the execute icon.Can please anyone tell me how to hide this,i have gone through the DBPNPSEL include but was not able to find the solution for the same.
       Pointers will be appriciated.
    Regards,
    Zareena.

    Create your own report catogory
    Goto --> Attributes --> Report Catogory
    with all the fields that you require
    That will solve your problem

  • How to access two oracle data base with out DB link

    Hi,
    I have two data base schema
    one is held in oracle 10g and the other in 11g ,Currently i am using DB link to access both the database. i am accessing around 70 tables using DB link.
    As per new requirement i have to remove DB link ,is there any other way i can access both database with out DB link.
    Thanks,

    malarkandy wrote:
    I have two data base schema
    one is held in oracle 10g and the other in 11g ,Currently i am using DB link to access both the database. i am accessing around 70 tables using DB link.
    As per new requirement i have to remove DB link ,is there any other way i can access both database with out DB link.Yes. But that needs another network and application interface instead of a database link.
    The target database can implement PL/SQL web services. These can be called via HTTP.
    The local database can use UTL_HTTP to make a call to the target database's web service for accessing target database data.
    Both databases can use AQ (Advance Queues). This can be integrated with an application server's JMS queues.
    This enable one database to enqueue a request to the other database, and for that database to respond by sending data.
    There are numerous such type of interfaces that can be used. Some primitive. Some advanced. Some simple. Some complex.
    The easiest and most flexible mechanism is however a database link. And it does not make sense to disallow database links for security and management reasons, but allow JMS for example. The network infrastructure is the same for both methods. The network protocol is the same. The security issues and concerns are the same - except that JMS for example is significantly more moving parts and make configuration and security a lot more complex than using a database link.

  • Change the messages commig from the Data Base

    Hello,
    My question is because I want to change the messages commig from the Data Base that reach the web bowser, that is, I have some Check constraints defined on the tables, but when on the web the user try to make something that violate the constraint, on the top of the page is displayed a message like "???? SYS_C00164048 ????".
    I like to change that message to display something moer descriptive. How can I do that?
    Thanks

    Hi Chris Muir has a detailed blog entry on this->
    http://one-size-doesnt-fit-all.blogspot.com/2007/05/dont-constrain-yourself-displaying.html
    Brenden

Maybe you are looking for