Using dbms_passthrough to build a view

Gurus,
Can i create a view in oracle to access data frm a MysqlDB using dbms_passthrough. I have created a procedure to get the data from remote system to oracle db using dbms_passthrough but was wondering if this can be done using a view
Edited by: user10600431 on 22-Jan-2009 04:39
Edited by: user10600431 on 22-Jan-2009 05:52

Sure you can, but it has to be function, not procedure. I do not have MySql, but below is an example for MS Access. Table TEST_TBL with two columns ID - number and A - string exists in MS Access database:
SQL> CREATE OR REPLACE
  2    TYPE ACCESS_TEST_TBL_OBJ_TYPE
  3      AS OBJECT(
  4                ID NUMBER,
  5                A  VARCHAR2(50)
  6               )
  7  /
Type created.
SQL> CREATE OR REPLACE
  2    TYPE ACCESS_TEST_TBL_TBL_TYPE
  3      AS TABLE OF ACCESS_TEST_TBL_OBJ_TYPE
  4  /
Type created.
SQL> CREATE OR REPLACE
  2    FUNCTION get_data_from_link
  3      RETURN ACCESS_TEST_TBL_TBL_TYPE
  4      PIPELINED
  5      IS
  6          c  INTEGER;
  7          nr INTEGER;
  8          access_test_tbl_obj ACCESS_TEST_TBL_OBJ_TYPE := ACCESS_TEST_TBL_OBJ_TYPE(NULL,NULL);
  9      BEGIN
10          c := DBMS_HS_PASSTHROUGH.OPEN_CURSOR@MDB;
11          DBMS_HS_PASSTHROUGH.PARSE@MDB(c,'select id,a from test_tbl');
12          LOOP
13            nr := DBMS_HS_PASSTHROUGH.FETCH_ROW@MDB(c);
14            EXIT WHEN nr = 0;
15            DBMS_HS_PASSTHROUGH.GET_VALUE@MDB(c,1,access_test_tbl_obj.id);
16            DBMS_HS_PASSTHROUGH.GET_VALUE@MDB(c,2,access_test_tbl_obj.a);
17            PIPE ROW(access_test_tbl_obj);
18          END LOOP;
19          DBMS_HS_PASSTHROUGH.CLOSE_CURSOR@MDB(c);
20          RETURN;
21  END;
22  /
Function created.Now you can issue SELECT against the function:
SQL> SELECT  *
  2    FROM  TABLE(get_data_from_link)
  3  /
        ID A
         1 testOr create a view and select from it:
SQL> CREATE OR REPLACE
  2    VIEW ACCESS_TEST_TBL_VW
  3      AS
  4        SELECT  *
  5          FROM  TABLE(get_data_from_link)
  6  /
View created.
SQL> SELECT  *
  2    FROM  ACCESS_TEST_TBL_VW
  3  /
        ID A
         1 test
SQL>

Similar Messages

  • Custom Components and Properties in Flex Builder Design View

    How do I create a custom component with custom properties
    that renders well in Flex Builder design view?
    This is a simple HelloWorld example of what I am trying
    below. Here is the HelloWorld.mxml file:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Canvas xmlns:mx="
    http://www.adobe.com/2006/mxml"
    width="500" height="500">
    <mx:Script><![CDATA[
    [Bindable]
    public var message:String;
    ]]></mx:Script>
    <mx:Label x="100" y="100" text="{message}" />
    </mx:Canvas>
    And then when I use it in another mxml file, the design view
    does not show the label with the 'Hello World' value - instead it
    just shows {message} in design view where the label is located.
    When I run it as a compiled app in flash, the 'Hello World' is
    displayed correctly:
    -- HelloWorldTest.mxml --
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Canvas xmlns:mx="
    http://www.adobe.com/2006/mxml"
    xmlns:views="mypackage.*" width="500" height="500">
    <views:SimpleLine message="Hello World."/>
    </mx:Canvas>

    design view does not do any variable assignments or function
    evaluations, so you won't be able to see it even if you don't use a
    custom component.

  • Is it possible to use booleans to build a VI that uses buttons to switch between screens (3 only) while the other screens disappear?

    As a beginner, I need help figuring out how to build a simply VI that uses boolean logic to switch between three different screens. I need a "Home" screen, the next screen which has a button to go back "Home" and a third screen which has two buttons to go "Home" and "Previous Screen". Can someone help me with a simple block diagram?

    Hi,
    Or put the data in three tab controls. The tabs itself are hidden. The
    program switches between the tab sheet if one of the buttons is pressed.
    The buttons are best not copied, e.g. the same buttons are used in every tab
    sheet (buttons hover above the tab, a black shadow will apear). If the first
    sheet is shown, button 2 and 3 are hidden, sheet two: only button 3 is
    hidden, sheet three no button is hidden.
    Showing the tabs allows the user to choose the views directlly. The button
    logic is not needed anymore. But you'll have to live with a simple tab
    sheet, instead of a fancy button system!
    Regards,
    Wiebe.
    "Jason R" wrote in message
    news:[email protected]...
    > Another solution if you want to avoid property-node hell...
    >
    > Divide your screen into 1/4ths. That is, make your FP 4x larger than
    > your desktop.
    >
    > Place screen 1 on the upper left quadrant.
    > Place screen 2 on the upper right quadrant.
    > Place screen 3 on the lower left quadrant.
    > Screen 4 (lower right quadrant) is unused.
    >
    > Disable the ability to scroll at run time.
    >
    > As the user clicks buttons, use the properties of this vi to move what
    > the user can see on the front panel.
    >
    > Cheating? yep. Easier? yep.
    >
    > Hope this helps! =)
    >
    > btw - be sure not to update the FP controls when they are not visible,
    > or this will eat processor cycles.
    >
    > Sincerely,
    > Jason G Richmond
    > Project Engineer II and LVAAD Instructor
    > VI Engineering
    > [email protected] (domain should be vieng.com (no A's))
    >
    >
    > missileman wrote:
    > > Is it possible to use booleans to build a VI that uses buttons to
    > > switch between screens (3 only) while the other screens disappear?
    > >
    > > As a beginner, I need help figuring out how to build a simply VI that
    > > uses boolean logic to switch between three different screens. I need a
    > > "Home" screen, the next screen which has a button to go back "Home"
    > > and a third screen which has two buttons to go "Home" and "Previous
    > > Screen". Can someone help me with a simple block diagram?
    >
    >

  • Segment builder - Refine view

    Dear all,
                     I am facing problem in opening Refine View in segment bulilder ,I have created segment builder with segment type - Campaign & Saved.When we try to open Refine view in GOTO.The refine view is displaying in newly opened window. But only a blank screen appears.
    The same view is opening in other systems. We have checked security settings in Internet options and looks okay.
    Why is it that the particular Java applet is not getting loaded while trying to open Refine View that too in some systems only.
    Is there anything we have to do? We face the same problem while trying to open Marketing Calendar also.
    We are using only standard applications and views. We are working in CRM 5.0 and EP 7.0.
    Regards,
    Basavaraj patil

    What you ask for is a development, within standard this is not possible. Be aware that depending on the number of BP's you will encounter performance problems as the PPR assignment is using several tables below.

  • Internet Explorer stops responding while using CodedUI test builder to record a test

    Hi,
    Here is my problem description:
    Internet explorer (9, 10, 11) stops responding while using CodedUI Test Builder to record a test scenario in IE. I am not able to input any values or click any buttons or perform any action on IE while recording a test on a remote desktop (visual studio
    and IE are both on remote machine). Also tried by directly accessing the machine but no luck. The test builder says 'could not record the last action...'
    A hand-coded script plays back fine without any problem.
    System Details:
    OS: Window 7 Professional with SP1 64-bit
    Browser: IE 11 (tried with IE 9/10 also with no luck)
    Visual Studio 2013 Ultimate Edition
    I have tried the following from my past similar experiences.
    1. Checked that I am recording on 32 bit IE
    2. Tried with IE 9/10/11
    3. Reset IE to factory settings
    I will appreciate if someone can share some thoughts on the likely problem(s) and any recommended solution.
    Regards,
    Pankaj

    Hi Pankaj,
    >>'could not record the last action...'.
    Actually it means that the coded UI test builder doesn't record the actions, I met this issue before when my machine is so busy, so I will get this issue if I record the steps so quickly.
    I'm not very sure that how you connect to your remote desktop and record the actions, but like the above actions, we have to make sure that the steps were recorded in the Recorded Action window like A.
    If not, please delete the steps from the no-recorded steps and re-record them again, maybe you could record the steps slowly.
    I doubt that the remote connection impacts the recorded actions performance.
    Best Regards,
    Jack
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Why use ojdeploy when building ViewController jar/war?

    Hi,
    It is known that ojdeploy is the recommended way to go when building/deploying an ADF app. The advantages are stated in many blog posts in the web.
    IMHO the most important reason for using ojdeploy instead of javac when creating an EAR is that javac CANNOT validate your BC. This means for example that if you refactor-rename an attribute of a VO and then commit only xml and not the related View Row Impl class, the build in your CI server will succeed if using only javac and fail if using ojdeploy (as it should be). So ojdeploy is the only way when building jars of Model projects if you want to be 100% sure the you have valid ADF code.
    The question is if the is a similar reason for using ojdeploy when building ViewController jars/wars??
    Thanx in advance for any feedback.
    Spyros Doulgeridis
    adfhowto.blogspot.com
    Edited by: spido on Jul 6, 2011 10:04 AM

    ojdeploy makes changes to your descriptors javac or jar does not know about. Actually nobody knows about the changes as you have to look into the war to see them. I'm not even sure that they are documented.
    Timo

  • 4.0EA1 - Query Builder Graphical View

    Liking the time saver tweaks in this EA tester edition, I use the query builder alot, a good enhancement to this would be an option to default the building of the graphical view of the query to a collapsed nature with a toggle to expand the individual table to selecting fields.
    Makes it easier to graphically understand the query and rearrange the table objects (drag/drop) without the need to spend ages reducing the length to table with 200+fields in of which or dragging tables to rearrange at one screen length at a time, an option could be to set how many fields to table expands to as a default ie 10 fields, rest you get to by scrolling through the list and have the toggle that cycles through 3 states when clicked – Minimised, Default, Maximised
    I notice on the right click on a graphical table an option to fully expand, so the toggle could be linked to this right click option

    Liking the time saver tweaks in this EA tester edition, I use the query builder alot, a good enhancement to this would be an option to default the building of the graphical view of the query to a collapsed nature with a toggle to expand the individual table to selecting fields.
    Makes it easier to graphically understand the query and rearrange the table objects (drag/drop) without the need to spend ages reducing the length to table with 200+fields in of which or dragging tables to rearrange at one screen length at a time, an option could be to set how many fields to table expands to as a default ie 10 fields, rest you get to by scrolling through the list and have the toggle that cycles through 3 states when clicked – Minimised, Default, Maximised
    I notice on the right click on a graphical table an option to fully expand, so the toggle could be linked to this right click option

  • Order of Installation of Flex Builder, SVG Viewer, XML Parser

    Hello VC Experts,
    I am beginner. I need to create Reports in VC using BW Queries. I am Facing Flex application error while deploying the model. Is there any specific order of Installation of Flex Builder, SVG Viewer, XML Parser?
    Kindly help me to *** up this pblm.
    Regards,
    Geeta

    Hi Geeta,
    please do not open twice threads for the same issue.
    I close your first thread here:
    Error in compiling Flex application (1). Consult log file for details.
    But first enable the flex error log in VC, then you can post us the error message.
    Best Regards,
    Marcel

  • Text scroll on website is invisible on Mozilla but visible with IE. Used Intuit Website Builder. Thye say it is a Mozilla issue. I have no access to the java HTML code. Even so, how does this get fixed for all who use Mozilla to see?

    I am not a web designer. I used Intuit Website Builder to build my company website. The text scroll on the index (home) page is invisible when viewed on Mozilla...but visible with internet Explorer. Intuit said its a Mozilla issue. I am concerned because so many people who use Mozilla will not be able to see the scroll. Help!! BTW, the image scroll on another page on the site (Design A La Carte) is visible on Mozilla and IE.
    == URL of affected sites ==
    http://vpdesignalacarte.com

    Do you mean the scrolling text by that Java applet?
    In Firefox 3.6 and later versions you need the Next-Generation Java™ Plug-In (present in Java 6 U10 and later).
    See http://java.com/en/download/faq/firefox_newplugin.xml
    Your plugins list shows outdated plugin(s) with known security and stability risks.
    # Java Plug-in 1.4.2_03
    # Shockwave Flash 10.0 r32
    Update the [[Java]] and [[Flash]] plugin to the latest version.
    See
    http://java.sun.com/javase/downloads/index.jsp#jdk (you need JRE)
    http://www.adobe.com/software/flash/about/

  • Report Generation for Excel does not work after using the Application Builder

    I have a VI that writes data to an Excel file using the Report Generation Toolkit. I recently compiled the VI into a single Application (EXE) using the Application Builder. My VI runs its tests properly, but no data is written to Excel. What could be the cause? I don't receive any error messages.

    Hi
    I usually build exe-files, which sometimes also have report functionality.
    Open the Application Builder and check the following things:
    1. Add the following vis: _Word Dynamic VIs.vi, _Excel Dynamic VIs.vi They should be located in the directory ..\LabVIEW X.X\vi.lib\addons\_office in the llbs _wordsub.llb and _exclsub.llb (report1.jpg)
    2. If you use an Installer, go to the Advanced Settings. There you can select some things to include in the Installer. Check if "NI Reports Support" is selected. (report2.jpg)
    These are the things I always do, if I need reports and I never had problems up to now. I made two screen-shots of these settings.
    Hope this helps.
    Thomas
    Using LV8.0
    Don't be afraid to rate a good answer...
    Attachments:
    report.zip ‏25 KB

  • Using a variable in a view?

    I know that it may not be possible to use a variable within a view, but I'm wondering if there isn't a work-around? If there is a single value---pulled from another table---you wish to reuse in a view that does not use dynamic SQL, how do you do so? I've been toying around with WITH statements, but that's getting me nowhere. I'm using 11r2.
    BTW, please do not ask me the standard litany of angry-dba questions (why are you doing this? your database is f*****, RTFM, etc.), this is just for my own curiosity. :)
    Thank you
    Example for demo purposes only (I know it's not syntactically correct):
    variable var_value varchar2(30)
    begin
    select this_is_just_one_value
    int :var_value
    from tableX where column1 = 'BOB';
    end;
    select
    numerous_columns
    from tableY
    where
    column5 = :var_value;

    893968 wrote:
    BTW, please do not ask me the standard litany of angry-dba questions (why are you doing this? your database is f*****, RTFM, etc.), this is just for my own curiosity. :)Why are you doing this? your database is f*****! RTFM! Etc!! ;-)
    SQL is not a procedural language - so you cannot create a view for example that has a parameter signature. E.g. this is possible in a procedural language:
    declare
            cursor c( deptID number ) is
                    select * from emp where deptno = deptID;
    begin
            open c( 1234 ); --// open SQL cursor using a parameter/variable
            --// etc..
            close c;
    end;This is not possible using a SQL object like a view. As a view is not a procedure. So the same approach as the above using SQL (silly example, but do demonstrates the basics):
    // define
    create or replace view emp_view as select * from emp;
    // use
    select * from emp_view where deptno = 1234;The CBO is clever - and it will likely push such a predicate into the emp_view SQL statement.
    To parameterise such a view, is ugly. And should only be considered when dealing with issues such as security and data restrictions. A context is created - this can contain a number of name-values. The view can then use a name-value from the context. Oracle's data dictionary views use this approach.

  • URGENT | Need HELP to build programmatic view criteria

    Hi
    I need to build programatic view criteria like below,
    ((JobId = "SH_CLERK" AND Salary > 2500) OR ( Salary > 2500))
    AND (DepartmentId =100)
    Kindly help how can we achieve this,
    The ViewCriteriaItem objects like below, how to link them to achieve like above statement.
    ViewObjectImpl empVOImpl = getEmployeesView1();
    ViewCriteria vc = empVOImpl.createViewCriteria();
    ViewCriteriaRow vcr = vc.createViewCriteriaRow();
    //criteria for employee id
    ViewCriteriaItem vci1 = vcr.ensureCriteriaItem("JobId");
    vci1.setValue("SH_CLERK");
    //criteria for showing employees whose salary are more than 10000
    ViewCriteriaItem vci2 = vcr.ensureCriteriaItem("Salary");
    vci2.setOperator(">");
    vci2.setValue(new Number(2500));
    //criteria for department
    ViewCriteriaItem vci3 = vcr.ensureCriteriaItem("DepartmentId");
    vci3.setOperator("=");
    vci3.setValue(new Number(100));
    vc.addElement(vcr);
    empVOImpl.applyViewCriteria(vc);
    - Rajesha
    Edited by: user12820425 on May 15, 2013 10:18 AM

    Hi Rajesha,
    You can follow below steps.
    1)Create VOImpl for VO on which you have query based.
    2)Remove Column(eg.JobId) from standard Default ViewCriteria
    3)In VOImpl create method to Create View custom Criteria, Add element
    public ViewCriteria  addCustomVC(){
                ViewCriteria vc = null;
                vc = this.createViewCriteria();
                vc.setName("customVC");
            ViewCriteriaRow vcRow = vc.createViewCriteriaRow();
            vcRow.setConjunction(ViewCriteriaRow.VC_CONJ_AND);
            if(getJobId() != null){ 
                vcRow.setAttribute("JobId", "' job_id = "+getJobId()+"'"); 
            }else {
                vcRow.setAttribute("JobId",null);
            vc.addElement(vcRow);
    return vc;
    }4)Override standard method public String getCriteriaItemClause to exclude above columns
        @Override
        public String getCriteriaItemClause(ViewCriteriaItem viewCriteriaItem) {
            //JobId
            if( "JobId".equals(viewCriteriaItem.getName()) ) {
                return (String) viewCriteriaItem.getValue();   
            }else{
                return super.getCriteriaItemClause(viewCriteriaItem);
        }5)Override public void executeQuery() method to add custom view criteria
    @Override
        public void executeQuery()
                applyViewCriteria(addCustomVC(), true);
                super.executeQuery();
                removeApplyViewCriteriaName("customVC");
        }Thanks,
    Jit

  • After installing an application that was created using the Application Builder

    After installing an application that I created using the Application Builder I get this error if I try to run " ANY " LabVIEW App's that I have built. "Executable Version 7.1.1 doesn't match Resource File 7.1. Check your configuration."
    The way that I tried to fix this is to reload LabVIEW 7.1 and DAQmx 8.0. I am using two NI-6528 switch cards.
    After I reload LabVIEW and DAQmx I can run my applications but as soon as I install one on this development machine the error begins again.
    The executable that I built works fine on the development machine and any other machine that I try it on but it appears that the Run-Time engine 7.1 becomes corrupt after I run setup.exe for the newly created application.
    I have built numerous Installers, setup.exe's in the past without this error. Just this latest one caused this problem to start.
    I can NOT upgrade to 7.1.1. I am doing work for many different sections of this factory and I can not force them to upgrade. I've asked. Others supply code for the same machines using LabVIEW 7.1.
    I am stuck creating executables and manualing moving the correct files to the target machines.
    What can be done?

    No. The KB article was talking about a machine with 7.1.1 installed. I have LabVIEW 7.1 installed.
    The machine that I am having trouble with is my development machine. LabVIEW 7.1, DAQmx 8.0.
    If I build the executable all is fine. I can still run old executables including the one I just built.
    If I create the installer all is fine. I can still run old executables including the one I just built.
    When I install the app on my development machine the corruption occurs. I can " NOT " run old executables including the one I just built. The subject error pops up.
    I have not moved any executables to the other machines yet. I don't want to corrupt others.

  • Exception while opening a JSP file created using oracle report builder

    I have created a JSP page which contains embedded Oracle reports build using Oracle Report Builder.
    I have deployed the JSP created above to the Oracle Application Server
    but when i try to open the JSP file it gives the following error:
    500 Internal Server Error
    javax.servlet.jsp.JspException: rwlib-1: REP-1202: ORACLE logon not specified. at oracle.reports.jsp.ObjectsTag.doEndTag(ObjectsTag.java:206) at testing.test1._jspService(_test1.java:75) [SRC:/testing/test1.jsp:0] at com.orionserver[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].http.OrionHttpJspPage.service(OrionHttpJspPage.java:56) at oracle.jsp.runtimev2.JspPageTable.compileAndServe(JspPageTable.java:567) at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:302) at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:509) at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:413) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65) at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source) at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:604) at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317) at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:790) at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.AJPRequestHandler.run(AJPRequestHandler.java:208) at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].server.http.AJPRequestHandler.run(AJPRequestHandler.java:125) at com.evermind[Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192) at java.lang.Thread.run(Thread.java:534)
    can anybody help regarding this
    this is of high priority to me
    thanks and regards
    Subhajit

    bump

  • HT5824 I have 4 calendars on my ICloud at work - I used to be able to view one calendar at a time or multiple - now when I check off to see just one calendar it automatically comes back on...?

    I have 4 calendars on my Icloud - I used to be able to view one at a time or multiple just by clicking on the check mark - now when I want to view just one calendar I click off the check mark but it automatically comes back on.  Any ideas?

    Can anyone help?

Maybe you are looking for

  • Error Occured while transporting theme in to Netweaver Portal 7.3

    Dear All, We have installed fresh Portal 7.3 and we are trying to transport the theme from Netweaver portal 7.0 to 7.3, but i am getting error while importing the theme Error Message: " Cannot perform upgrade: Exception caught while upgrading: Image

  • Opening an External Window which shares the same context.

    Hi, I have a requirement where <b>I need to open an external window which shares the same context</b>. (i.e, A window which belongs to the same application in a seperate browser) If I use the following coding <b>it only opens a model window in the sa

  • What is the Executable file name of my new RXi report

    Hi friends, Im registering a new RXi report in oracle 11i. Can anyone pls tell me how can i identify the newly developed RXi Executable file name and its Execution method? Ive been searching for it for last several weeks but not found any. pls help m

  • Item Import Error Message

    Hi I'm running the import items program to update the existing item in inventory. For that it is throwing some error when the record move from interface table to inventory base table. See below error message. TRANSACTION ID : 203532465 ORGANIZATION I

  • Appending Rows To Editable ALV Grid

    Hi, I have a requirement to allow users to append rows to ALV grid in order to insert new data.  The standard append button works to add the row on the front end, however, when I go to process the row through the DATA_CHANGED event of the CL_GUI_ALV_