How to write a dynamic SQL in Oracle Portal

Hello
I am running portal on instance C.
I have instance A and B
From instance C I want to run a report where I will select the instance name.
then the when I execute the query must be dynamically generated adn executed.
for example: in the case of instance A;
the query must be
select * from scott.emp@A
in the case of instance B
the query must be
select * from scott.emp@B
I already have database links A and B pointing to instances A and B respectively.
How do I achieve this. Any code samples, suggestions appreciated.
Thanks
Ganesh

Hallo,
I don't understand why you need a database link, if you are already on that instance ?
BUT for your solution : put your database links in a view and select from this view.
In the view you can do something like this :
create or replace view test
(col1, col2, col3)
as
select .., 'A' location
from taba@A
where ...
union
select .., 'C' location
from taba@C
where ...
union
select .., 'B' location
from taba@B
where ...
The only thing you have to do is to give the instance name to the view as the column location.
Good luck.
Filip Huysmans.

Similar Messages

  • How to write a PL/SQL stored procedure in Oracle to call Webservice

    Can any one pelase send me a code on how to write a PL/SQL stored procedure in Oracle database to call the Webservice ?
    Thanks,
    Rajesh

    Were you able to solve this problem

  • Can we use Dynamic SQL in Oracle Reports ?

    Hi ,
    Can we use Dynamic SQL in Oracle Reports ?
    If yes please give some examples .
    Thanx
    srini

    I believe the built-in package SRW.Do_Sql is what you are looking for
    Example from the document:
    /* Suppose you want to create a "table of contents" by getting the
    ** first character of a columns value, and page number on which its
    ** field fires to print. Assume that you want to put the "table of
    contents"
    ** into a table named SHIP. You could write the following construct:
    DECLARE
    PAGE_NO NUMBER;
    PAGE_FOR INDEX NUMBER;
    SORT_CHAR CHAR(1);
    CMD_LINE CHAR(200);
    BEGIN
    SORT_CHAR := :SORT_NAME ;
    IF :CALLED = Y THEN
         SRW.GET_PAGE_NUM(PAGE_FOR_INDEX);
         SRW.USER_EXIT(RWECOP PAGE_FOR_INDEX
         P_START_PAGENO);
         SRW.MESSAGE(2,TO_CHAR(:P_START_PAGENO));
    END IF;
    SRW.GET_PAGE_NUM(PAGE_NO);
    CMD_LINE := INSERT INTO SHIP VALUES
                          (||SORT_CHAR||,||TO_CHAR(PAGE_NO)||);
    SRW.MESSAGE(2,CMD_LINE);
    SRW.DO_SQL(CMD_LINE);
    COMMIT;
    EXCEPTION
      WHEN DUP_VAL_ON_INDEX THEN
            NULL;
      WHEN SRW.DO_SQL_FAILURE THEN
            SRW.MESSAGE(1,FAILED TO INSERT ROW INTO SHIP TABLE);
      WHEN OTHERS THEN
           COMMIT;
    END;

  • How to write the dynamic code for RadioGroupByKey and Check Boxes?

    Hi,
    Experts,
    I have created a WD ABAP application in that i have used RadioGroupByKey and CheckBox Ui elements but i want how to write the dynamic code to that i want to display male and female to RadioGroupByKey and 10  lables to check boxs.
    Please pass me some idea on it and send any documents on it .
    Thanks in advance ,
    Shabeer ahmed.

    Refer this for check box:
    Do check :
    bind_checked property is bind to a node with cardinality of 1:1
    CHECK_BOX_NODE <---node name
    -CHECK_BOX_VALUE <--attribute name of type wdy_boolean
    put this code under your WDDOMODIFYVIEW:
    DATA:
    lr_container TYPE REF TO cl_wd_uielement_container,
    lr_checkbox TYPE REF TO cl_wd_checkbox.
    get a pointer to the RootUIElementContainer
    lr_container ?= view->get_element( 'ROOTUIELEMENTCONTAINER' ).
    lr_checkbox = cl_wd_checkbox=>new_checkbox(
    text = 'WD_Processor'
    bind_checked = 'CHECK_BOX_NODE.CHECK_BOX_VALUE'
    view = view ).
    cl_wd_matrix_data=>new_matrix_data( element = lr_checkbox ).
    lr_container->add_child( lr_checkbox ).
    Refer this for Radiobutton :
    dynamic radio button in web dynpro abao
    Edited by: Saurav Mago on Jul 17, 2009 10:43 PM

  • How do I migrate MS SQL to Oracle in SQL Developer 1.5

    Hello,
    When creating a Database Connection in SQL Developer 1.2 I could see MS SQL but this no longer happen in SQL Developer 1.5. So how can I migrate MS SQL to Oracle Database?
    Ming Man

    Thanks Barry,
    It appears after I choose Help -> Check for Updates... then download the JTDS driver.
    Ming Man

  • How to write jsp select record from Oracle  divide per page , about 50 reco

    Dear Expert,
    How to write jsp select record from Oracle divide per page , about 50 record per page.
    Thank you very much.

    I wish I could, but there is no single sign on module available for Fusion, also, so called Fusion is yet another Word With Big Letters, behind it there is yet another OC4J ( now Oracle switched to Weblogic though) container with bunsh of Oracle apps residing in it.
    Generally speaking, neither Fusion nor Oracle Apps user database does not have any single authentication module available out of the box to integrate user database.
    It's a long sad story running straight from Oracle Apps 11.0.5.
    That's why I've created JAAS single sign on login module and used it ever since at OC4J 10.2 and onwards at OC4J 10.3
    Back to the topic: to develop Apps and test them externally using the session bean I've isted above, one need to copy certain libraries from Oracle Apps server, then add them as libraries for JDeveloper project.
    Here is the complete list:
    oracle.apps.fnd.cache
    oracle.apps.fnd.cache
    oracle.apps.fnd.common
    oracle.apps.fnd.functionSecurity
    oracle.apps.fnd.metadata
    oracle.apps.fnd.security
    oracle.apps.fnd.util
    oracle.apps.jtf.cache
    oracle.apps.jtf.security
    Edited by: Faceless on Nov 26, 2009 3:04 AM

  • How to get the dynamic columns in UWL portal

    Hi All,
    I am working on UWL Portal. I am new to UWL. I have down loaded uwl.standard XML file and costomized for getting the  values for "select a Subview" dropdown and I am able to see the values in the dropdown. Now my requirement is to get the dynamic columns based on the selection from dropdown value.
    can any body suggest on how to get the dynamic columns in UWL portal.

    Hi  Manorama,
    1) If you have already created a portal system as mentioned in following blog
                  /people/marcel.salein/blog/2007/03/14/how-to-create-a-portal-system-for-using-it-in-visual-composer
    2) If not, then try to create the same. Do not forgot to give the Alias name .
    3) After creating a system, log on to the VC, Create one iView.
    4) Now Click on "Find Data" button from the list which you can view in right side to Visual composer screen.
    5) After clicking on "Find Data" button, it will ask for System. If you have created your system correctly and Alias name is given properly, then your mentioned Alias name is appeared in that list.
    6) Select your system Alias name and perform search.
    7) It will display all the BAPIs and RFCs in your systems.
    8) Select required BAPI and develop the VC application.
    Please let me know if you any further problems.
    Thanks,
    Prashant
    Do reward points for useful answers.

  • Automated tool to convert from Forms to Dynamic Page for Oracle Portal?

    Hi Experts,
    We are thinking to convert majority of the forms in our portal to dynamic pages. Is there any tool to automate the conversion from Forms to Dynamic page for Oracle Portal 9.0.4.1.0?
    Thanks, Abbas

    Dear Abbas,
    You seem to have two issues... ;-)
    If you are finding the Forms are getting corrupt very easily, I'd suggest you go and open a Service Request into Oracle Support (http://metalink.oracle.com). There are a couple of ways where you can have these not corrupted (depeding on the Portal version you are in) and if there isn't yet a way you may get a bug logged and fixed within the next patchset eventually (improving the product functionality).
    As to changing it to a dynamic page it might give you a bit more flexibility... yeah. It really depends on what you desire to do. I'd slowly start to code them in this way if your goal is this. As to the former coded forms unfortunately as I've said there isn't a strait way to do that, so you may do this slowly in time...
    I hope it helps you a bit further...
    Cheers,
    Pedro.

  • How to analyze the navigation flow in Oracle Portal, Number of unique users, downloads and other estastisticas of use of the Portal and Documents

    Dear
    Experts, I have a very exciting demand, the board of a customer.
    I need to create an analytical application on Oracle Portal, UCM, Spaces, WebCenter, to inform me which quantitatively pages, url and documents are accessed.
    How to analyze the navigation flow in Oracle Portal, Number of unique users, downloads and other estastisticas of use of the Portal and Documents?
    I thought I'd create a ods with the data of Content Tracker and Google Analytics, and model the analysis through the BIEE.
    I ask, what is the standard solution that is used in these cases?
    Thank you
    Miki

    Dear
    Experts, I have a very exciting demand, the board of a customer.
    I need to create an analytical application on Oracle Portal, UCM, Spaces, WebCenter, to inform me which quantitatively pages, url and documents are accessed.
    How to analyze the navigation flow in Oracle Portal, Number of unique users, downloads and other estastisticas of use of the Portal and Documents?
    I thought I'd create a ods with the data of Content Tracker and Google Analytics, and model the analysis through the BIEE.
    I ask, what is the standard solution that is used in these cases?
    Thank you
    Miki

  • How to write a Timestamp in an Oracle table?

    Hi,
    I am pretty new to SAP IdM and therefore have a very basic question.
    I am using SAP IdM 7.2 SP8 on Oracle.
    I was creating a job where I calculated some values from the database with a 'From Database' path.
    Then I wanted to store these values in a temporary table together with the timestamp when these were stored/calculated.
    Doing this in the Destination-Tab of the 'From Database'-path I got following error message...
    java.sql.SQLException: Missing IN or OUT parameter at index::2
    I did several tests and created a little test which recreates the problem...
    1. Create a Job with a 'From Database'-path
    2. In the source statement, insert...
    select
      'Test' AS Message,
      systimestamp AS TempDate
    from dual;
    3. In the destination tab add a temp Table and two columns. Since I want to add a date/timestamp-value I create a column of type 'DATE' here.
    4. After running the Job the error appears. (Here in german)
    Doing some additional tests I am able to add the date as a varchar2 if I convert the TempDate using a to_char()-function.
    Thus it seems like I misusing the Timestamp/Date data type.
    Do you have recommendations how I can add the Timestamp as a Date/Timestamp value to my table?
    Kind Regards, Andreas

    Hi,
    I really never got this to work properly and most of what follows is just my own rant caused by the annoyance of not getting this seemingly simple thing to work and are strictly my own theories not based on facts or actual knowledge of how Oracle or JDBC works, nor representing my employer in any way. Anyhow :-)
    Its possible that cause of the problem is that the timestamp is "destroyed" by NLS/JDBC when transferred from the database to the client. This is also one of the issues that varies a bit from version to version of the jdbc driver. Also the DATE datatype does not include fractional seconds, so you need to create the column as TIMESTAMP if you want that.
    The real fun thing with Oracle (or their jdbc driver) is that you can read a timestamp in the source and jdbc/NLS will convert it according to your locality setting, but you can't write what you read from Oracle back to Oracle.
    Just the same way you can use to_char to get a timestamp in a nice enough format, but when writing it to_date may not be able to parse the date back when using the exact same conversion mask...
    Example:
         select TO_CHAR(current_timestamp,'YYYYMMDD HH24:MI:SS.FFTZHTZM') from dual;
    Gives: 20140314 12:41:03.320000+0100. But both
         select TO_DATE('20140314 12:41:03.320000+0100','YYYYMMDD HH24:MI:SS.FFTZHTZM') from dual;
    and
         select TO_TIMESTAMP('20140314 12:41:03.320000+0100','YYYYMMDD HH24:MI:SS.FFTZHTZM') from dual;
    give errors.
    Rather than argue and fight with it I usually just end up using a To Database pass, check SQL Updating and write the Create Table and update/insert statements myself. Alternativly you can create the table with a trigger that automatically adds the timestamp on inserts/updates.
    1st To Database pass has no source, creates the temp table:
    The next pass has the source to read the data and insert it into the temp table:
    Then just use the current_timestamp function in the insert statement to keep it local and unconverted in the database engine...
    Br
    Chris
    Message was edited by: Per Krabsetsve

  • Dynamic SQL and Oracle stored procedures

    Does anybody has any experience with invoking an Oracle stored procedures
    with output parameters, using dynamic SQL from Forte?
    Thanks,
    Dimitar

    I would be interested. We are currently using a homegrown DataMapper architecture with the Microsoft OracleClient. I would like to move to ODP.Net once a production version supporting ADO.Net 2.0 is available. After that, I would then like to look at using an off the shelf persistence framework such as EntitySpaces, NHibernate or IdeaBlade's DevForce.

  • Querying a Worksheet from PL/SQL Dynamic Page in Oracle Portal

    Is there a way to actually ask Discoverer to give me a list of values for a report property from outside Discoverer?
    In my case, I am trying to add reports to Oracle Portal via the Worksheet Portlet but I want to build a select list that contains valid entries for discoverer to run through the portlet for a discoParameter value. Is there any better way to get the list of values other than running the report's query 2x (once in discoverer to load the report and once in portal to get the list of values)?

    Hello David,
    This is not a feature for Discoverer Portlet but as far as I can see Oracle Portal has Page Parameter Form that migh help in creating dynamic list of values. Please check in MetaLink :
    Note.292521.1 How to Create a Page Parameter Form with Dynamic LOV
    Once the Parameter has been created, it can be used from Discoverer Portlet too :
    How to map worksheet parameters to Page Parameters in OracleAS Portal
    http://download.oracle.com/docs/html/B14465_02/author.htm#sthref145
    Best Regards,
    Gianluca

  • How can I execute Dynamic SQL statement in Forms?

    Hi All,
    I have to execute dynamic SQL statement from Forms
    Below statement I have to execute
    "EXECUTE IMMEDIATE v_stmt INTO v_return;".
    Googled for the same got results saying, Better use Database function or procedures to execute these Dynamic Statements but We want to execute in forms only.
    Can any one help me..
    Thanks,
    Madhu

    So in short you are trading code obfuscation for maintainability and the ability to share code between tools? If from somewhere else you need a procedure already implemented in database PL/SQL (and now ported to forms) this would mean you'd need to implement it in every other tool. In times where you might want to integrate your forms with $other_technology and putting stuff on the database is the first step to share functionality you just go the opposite way? And all that because someone is afraid that somebody might steal your source code? I am sorry to be blunt, but this is just plain stupid.
    Leaving aside that some things like Analytic Functions, Bulk processing or execute immediate are not even available in forms your software consists of how many LOC? How long does it take to bring a new developer up to speed with your source code? Imagine how long that would take for a developer who doesn't have coleagues who know their way around.
    And just so you know: I work for a ISV selling a closed-source product as well. We have 200+ customers all over the planet. We are well aware that wrapped packages can be reverse engineered. The premise is: stored procedures can be reused in every tool we have, if it makes sense to put stuff on the database by all means do it. If someone would want to reverse engineer our software I'd wish him good luck as some parts are implemented in such a hilarious complicated way I have troubles understanding them (and quite frankly I refuse to understand certain parts, but that's another story). I do work for almost 10 years for that ISV.
    In any case the possible solutions have already been mentioned: you have exec_sql, create_group_from_query and forms_ddl to execute dynamic SQL in forms whereas forms_ddl is a one way street and most certainly not the thing you need or want. Take a look at the documentation for the other 2 things.
    cheers

  • How to add a dynamic menu to the Portal?

    Dear all,
    I am restructuring the company's Intranet on which I plan to put a left-side vertical menu. On the menu, most links are accessible to all Intranet users except some KPI (key performance indicators) links which are only accessible to managers.
    I am evaluating a third-party dynamic menu builder so called "Sothink DHTML Menu" which is javascript based and provides features for connecting to database via JDBC in jsp.
    For static menu scenario, "Sothink DHTML Menu" is perfect for Oracle Portal in the sense of easy development and deployment.
    For dynamic menu scenario, if I really want to use "Sothink DHTML Menu", I need to put the codes in jsp file and then place the jsp file on the Portal page. Here is the tutorial http://www.sothink.com/product/dhtmlmenu/store/jspdb/jspdb.htm
    I still can't figure out how to do that. Can any experts here tell me how or suggest other alternatives for generating a dynamic menu on Portal?
    Thanks
    George (HK)

    Hi
    I also use SoThink menus in Oracle Portal, but for static menus (I upload them in the HtDocs of Apache and then refer to them with an URL Item).
    In my previous version of Portal I also had to display some kind of dynamic menus, some parts should only be visible to some users/groups. But I didn't use Sothink at this moment but "DHTML Menus" from an other company.
    Starting from an example and using their libraries I wrote my own menu in javascript. In this .js I wrote some functions
    - 1 that document.write(s) the start of the menu and the public part of the menu
    - 1 that document.write(s) the reserved part of the menu
    - 1 that document.write(s) the last part of the menu.
    Then in a navigation page I defined 3 regions, each region contains some jscript code that launchs the function/menu part of the same range. And I used the item level security to set right access to the second region/menu part.
    It worked fine, I just had to add some /* at the end of region 1 ent */ at the beginning of region 2 to remove the HTML code Portal writes between the regions.
    But it was very time consuming if your menu changes often.

  • How to call a PL/SQL procedure from Portal

    Env.Info: Windows NT Server 4 (Service Pack 3) / Oracle 8i R3 EE / Oracle Portal 3.0 Production.
    I created a new schema "BISAPPS" and created a user with the same name. Ran provsyns.sql script to grant Portal API access. Created a new package under this new schema and compiled it against the database. After that I registered the schema as a portal provider. There were no errors.
    Now I logged into Portal using the account PORTAL30. Refreshed the portlet repository and the new portlets appeared. I added the new portlet to the page. It is displayed successfully.
    New portlet allows the user to enter a bug-number and lets the user to either view or edit. If the user clicks on the button "Edit", it opens a new window and displays the contents from BugDB application. But if the user clicks on "Show", it should display the output generated by a PL/SQL procedure (Owned by the above New Schema - BISAPPS) in a separate window. But instead it is displaying the following error in the separate window:
    bisapps_pkg.buginfo: PROCEDURE DOESN'T EXIST.
    DAD name: PORTAL30
    PROCEDURE : bisapps_pkg.buginfo
    URL : http://host_name:80/pls/portal30/bisapps_pkg.buginfo
    And list of environment variables ....
    Can anyone help me? How can I call a PL/SQL procedure when the button is clicked? Thanks in advance.

    You must grant EXECUTE privilege on your procedure to the PORTAL30_PUBLIC user. If the error still persists, create a PUBLIC synonym for your procedure.

Maybe you are looking for

  • How to merge two Apple IDs into one?

    Is it possible to merge two IDs into one?  I don't want to use the 'hotmail.com' extension anymore.

  • Unable to Start CE 7.1 Server on Windows 7 / Vista OS

    Dear All, I am trying to install CE 7.1 Server (Java Stack) on my personal laptop ( Windows 7 Home Basic, Intell Core i3 processor, 4GB RAM). In the 1st attempt ,the installation failed on Windows 7 OS due to incompatible OS errors. So, I installed V

  • How to remove underlining on text links in Muse...

    Hi, Anyone know how to remove the annoying underlining of text links in Muse. I have of course, styled my link to have no underline - which in Muse works, but doesn't once online. Even better - does anyone know how to create a hover style via Muse? I

  • Issue displaying content on iframes.

    Hello everyone, I am trying to display a few pages on an iframe for a few seconds each on a loop.  I have been able to display content on the iframe when I do it by adding this line. frame1.Attributes["src"] = "http://intranet.contoso.com/sites/Repor

  • CSS justifications are different when I upload my page...

    I used to build websites with GoLive CS2 for number of years. With the purchase of a new laptop, I recently switch from CS2 to CS5. (But have been using CS4 at work). As GoLive is no longer existing, I just switch to Dreamweaver. I had several proble