Tables used in Views, Trigger

Hi,
Please let me know the query to find the tables used for creating a view and database trigger.
Thanks and Regards.

Hi,
{sorry but your question is unclear "we don't use a query to create..."
if you want to:
to create a view:
http://download.oracle.com/docs/cd/B12037_01/server.101/b10759/statements_8004.htm
to create a trigegr
http://download.oracle.com/docs/cd/B12037_01/server.101/b10759/statements_7004.htm#i2235611
to check existing views:
{code}
select * from all_views
to check existing triggers:select * from all_triggers

Similar Messages

  • Dynamic binding of items in sap.m.Table using XML views

    Dear SAPUI5 guru's,
    Let's start by saying I'm an ABAP developer who's exploring SAPUI5, so I'm still a rookie at the time of writing. I challenged myself by developing a simple UI5 app that shows information about my colleagues like name, a pic, address data and their skills. The app uses the sap.m library and most of the views are XML based which I prefer.
    The data is stored on an ABAP system and exposed via a gateway service. This service has 2 entities: Employee and Skill. Each employee can have 0..n skills and association/navigation between these 2 entities is set up correctly in the service. The data of this service is fetched from within the app using a sap.ui.model.odata.ODataModel model.
    The app uses the splitApp control which shows the list of employees on the left side (master view). If a user taps an employee, the corresponding details of the employee entity are shown on the right (detail view).
    Up till here everything is fine but I've been struggling with my latest requirement which is: show the skills of the selected employee in a separate XML view when the user performs an action (for the time being, I just created a button on the detail view to perform the action). After some hours I actually got it working but I doubt if my solution is the right way to go. And that's why I'm asking for your opinion here.
    Let's explain how I got things working. First of all I created a new XML view called 'Skills'. The content on this view is currently just a Table with 2 columns:
    <core:View xmlns:core="sap.ui.core" xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m"
      controllerName="com.pyramid.Skills" xmlns:html="http://www.w3.org/1999/xhtml">
      <Page title="Skills"
           showNavButton="true"
           navButtonPress="handleNavButtonPress">
      <content>
      <Table
       id="skillsTable">
      <columns>
      <Column>
      <Label text="Name"/>
      </Column>
      <Column>
      <Label text="Rating"/>
      </Column>
      </columns>
      </Table>
      </content>
      </Page>
    </core:View>
    The button on the Detail view calls function showSkills:
    showSkills: function(evt) {
      var context = evt.getSource().getBindingContext();
      this.nav.to("Skills", context);
      var skillsController = this.nav.getView().app.getPage("Skills").getController();
      skillsController.updateTableBinding();
    Within 'this.nav.to("Skills", context);' I add the Skills view to the splitApp and set its bindingContext to the current binding context (e.g. "EmployeeSet('000001')"). Then I call function updateTableBinding in the controller of the Skills view which dynamically binds the items in the table based on the selected employee. So, when the ID of the selected employee is '000001', the path of the table's item binding should be "/EmployeeSet('000001')/Skills"
    updateTableBinding: function(){
      var oTemplate = new sap.m.ColumnListItem(
      {cells: [
              new sap.m.Text({text : "{Name}"}),
              new sap.m.Text({text : "{Rating}"})
      var oView = this.getView();
      var oTable = oView.byId("skillsTable");
      var oContext = oView.getBindingContext();
      var path = oContext.sPath + "/Skills";
      oTable.bindItems(path, oTemplate);
    Allthough it works fine, this is where I have my first doubt. Is this the correct way to bind the items? I tried to change the context that is passed to this.nav.to and wanted it to 'drill-down' one level, from Employee to Skills, but I couldn't manage to do that.
    I also tried to bind using the items aggregation of the table within the XML declaration (<Table id="skillsTable" items="{/EmployeeSet('000001')/Skills}">). This works fine if I hard-code the employee ID but off course this ID needs to be dynamic.
    Any better suggestions?
    The second doubt is about the template parameter passed to the bindItems method. This template is declared in the controller via javascript. But I'm using XML views! So why should I declare any content in javascript?? I tried to declare the template in the XML view itself by adding an items tag with a ColumnListItem that has an ID:
                    <items>
                        <ColumnListItem
                        id="defaultItem">
                        <cells>
                            <Text text="{Name}"/>
                            </cells>
                            <cells>
                            <Text text="{Rating}"/>
                            </cells>
                        </ColumnListItem>
                    </items>
    Then, in the updateTableBinding function, I fetched this control (by ID), and passed it as the template parameter to the bindItems method. In this case the table shows a few lines but they don't contain any data and their height is only like 1 mm! Does anyone know where this strange behaviour comes from or what I'm doing wrong?
    I hope I explained my doubts clearly enough. If not, let me know which additional info is required.
    Looking forward to your opinions/suggestions,
    Rudy Clement.

    Hi everybody,
    I found this post by searching for a dynamic binding for well acutally not the same situation but it's similar to it. I'm trying to do the following. I'm having a list where you can create an order. On the bottom of the page you'll find a button with which you're able to create another order. All the fields are set to the same data binding ... so the problem is if you've filled in the values for the first order and you'll press the button you'll get the same values in the second order. Is it possible to generate a dynamic binding?
    I'm going to post you a short code of what I'm meaning:
    <Input type="Text" value="{path: 'MyModel>/Order/0/Field1'}" id="field1">
         <layoutData>
                    <l:GridData span="L11 M7 S3"></l:GridData>
               </layoutData>
    </Input>
    As you can see I need to set the point of "0" to a dynamic number. Is there any possibility to reach this???
    Hope you can help
    Greetings
    Stef

  • Table used in view

    Hi all,
    How can i get tables uses uinformation in view as hiererchy order.
    example.
    Table name : Employee
    I want to know in which view this table is using and also other view name which is using earlier view too.
    Example
    1. view A is created on table Employee
    2. View B is created on view A
    3. View C is created on View B .
    output should be
    view affected for employee table
    A
    B
    C
    Thanks in advance
    Tnaks & regards
    Deb

    debasishghosh wrote:
    Can you please send me the querySELECT [column list] FROM ALL_DEPENDENCIES;
    What to put in [column list] is left as an exercise for the student. Clues can be found be reading the very good description of ALL_DEPENDENCIES in the fine Reference Manual.
    =================================================
    I don't want to be flippant or rude, but if people want to be professionals in ANY field, the first knowledge they need to acquire is how to locate AND USE+ the fundamental reference materials for that profession. And the most important trait, the one for which they are really hired, is the ability to do independent research, and having a modicum of curiosity that would drive one to do that research. We don't mind helping newbies, and even the most experienced person on this board will run into something they are not familiar with, or occasionally just require a second set of eyes to look at something. But a professional+ needs, above all, a willingness and capability to check the docs. A professional isn't necessarily someone who has all the answers at their fingertips or has a full understanding about every arcane subject in their field. It certainly isn't someone who has an encyclopedia full of memorized answers but little understanding of how it all fits together. It's someone who knows where to find the answers when needed, how to recognize them when he sees them. It's less about knowing than it is about attitude. Everything you asked can be answered in the Oracle Concepts Manual at tahiti.oracle.com. You should bookmark that site. You were told the name of the view that has the information you seek. It is not an unreasonable assumption that anyone who comes to this forum knows how to write simple SQL. It is also NOT unreasonable to expect a a professional to be able to take a clue like that and use it. A professional does NOT expect to be spoon-fed everything.
    =================================================
    Learning how to look things up in the documentation is time well spent investing in your career. To that end, you should drop everything else you are doing and do the following:
    Go to tahiti.oracle.com.
    Drill down to your product and version.
    <b><i><u>BOOKMARK THAT LOCATION</u></i></b>
    Spend a few minutes just getting familiar with what is available here. Take special note of the "books" and "search" tabs. Under the "books" tab you will find the complete documentation library.
    Spend a few minutes just getting familiar with what <b><i><u>kind</u></i></b> of documentation is available there by simply browsing the titles under the "Books" tab.
    Open the Reference Manual and spend a few minutes looking through the table of contents to get familiar with what <b><i><u>kind</u></i></b> of information is available there.
    Do the same with the SQL Reference Manual.
    Do the same with the Utilities manual.
    You don't have to read the above in depth. They are <b><i><u>reference</b></i></u> manuals. Just get familiar with <b><i><u>what</b></i></u> is there to <b><i><u>be</b></i></u> referenced. Ninety percent of the questions asked on this forum can be answered in less than 5 minutes by simply searching one of the above manuals.
    Then set yourself a plan to dig deeper.
    - Read a chapter a day from the Concepts Manual.
    - Take a look in your alert log. One of the first things listed at startup is the initialization parms with non-default values. Read up on each one of them (listed in your alert log) in the Reference Manual.
    - Take a look at your listener.ora, tnsnames.ora, and sqlnet.ora files. Go to the Network Administrators manual and read up on everything you see in those files.
    - When you have finished reading the Concepts Manual, do it again.
    Give a man a fish and he eats for a day. Teach a man to fish and he eats for a lifetime.
    =================================

  • How to maintain  data in tables using maintenace view of the tables in ECC6

    Hi,
    I have  two table  SBUSPART (Business partner) and STRAVELAG (Travel agency).
    SBUSPART  is foreign key table while STRAVELAGE is a reference table.  The relationships is :
            SBUSPART-MANDANT          =     STRAVELAGE-CLIENT
            SBUSPART-BUSPARTNUM    =     STRAVELAGE-AGENCYNUM
    now, I create a maintenance view ZVI_HT_PARTNER in which SBUSPART is primary table and STRAVELAGE is secondary table. I have also created maintenace interfaces by generating maintenance modules in function group zht_fg. Authorization group is SUNI  and maintenance type is one-step, the number maintenace screen is 100.
    Now I want to maintain the data in tables SBUSPART and STRAVELAGE together in the maintenace view. If i want to enter a new partner dirctly I have to enter it in table SBUSPART first, only then could I enter the corresponding data in STRAVELAGE.
    in older version I easyly do this by the way: in maintenace screen of zvi_ht_partner ( in se11) I choose:  system/ services/table maintenace/Enhance.Tab.maintain.
    but in ECC6 when I choose:  system/ services/table maintenace, there is no Enhance.Tab.maintain instead there are two options Extended table maintenace and View cluster maintenace.
    So in this case I don't know how to tackle this problem, Please help me if you have a solution. 
    Thanks,

    Hi,
        I suppose 'Extended table maintenace ' would be same as 'Enhance.Tab.maintain'.
    Regards,
    Himanshu

  • Dynamic binding of items in sap.m.Table using JS views

    HI,
    I am developing a master detail page for a Purchase Order application. In master page, i display the list of Purchase Orders & on clicking the PO, i should display the detail page.
    We use different ODATA models for Master & detail page. I am able to successfully list the POs in master page & i am struggling on the part where i have to pass the selected PO number to the new ODATA service URL & then display the details in a table.
    Below is the code i use on TAP of Purchase order from master page:
    tap: function(oEvent)
          sap.ui.getCore().byId("PODetailstable_nodata_id").setVisible(false);
          var oContext=oEvent.getSource().getBindingContext();
          var odataModel_PO_detail = new sap.ui.model.odata.ODataModel(detailServiceUrl,false,  "dev_sde", "28aug@2013");
          odataModel_PO_detail.setCountSupported(false);
          var tappedPONumber= oContext.getProperty("PONumber");
          var path = "/POHeaderSet('"+tappedPONumber+"')/HDRtoITM";
          PO_DetailsPage.setBindingContext(oContext);
          sap.ui.getCore().byId("po_details_table_id").setModel(odataModel_PO_detail);
          sap.ui.getCore().byId("po_details_table_id").bindContext(path);
          sap.ui.getCore().byId("po_details_table_id").setVisible(true);
    And below is the code of my Detail page & the table: I set the bindcontext with new path at "tap" function in master page, i also do bindaggregation for the table with the new path.
    The issue is i am able to HIT the new service URL, but no data is displayed. There is also a demo application on the same, but w/o source code it doesnt help me much in resolving this issue.
    var PODetailstable_nodata = new sap.m.Table("PODetailstable_nodata_id",{title : "No Data"});
      var po_details_table =  new sap.m.Table("po_details_table_id", {
      inset: true,
             headerText: "table for Detail page",
             columns: [
                       new sap.m.Column({
                           header: new sap.m.Label({ text: "PO Number" })       }),
                       new sap.m.Column({ header: new sap.m.Label({ text: "Vendor" }) }),
                       new sap.m.Column({
                           header: new sap.m.Label({ text: "Vendor Name" })  }),
      var oTemplate = new sap.m.ColumnListItem({
                cells: [
                        new sap.m.Text({ text: "{PoNumber}" }),
                        new sap.m.Text({ text: "{Vendor}" }),
                        new sap.m.Text({ text: "{VendorName}"})
      po_details_table.bindAggregation("items", {
             path:"/POHeaderSet('"+"{PONumber}"+"')/HDRtoITM",
             template: oTemplate
      var PO_DetailsPage = new sap.m.Page("PO_DetailsPage_id",
      // title : "Purchase Order Details",
      title :  "{PoNumber}",
      content : [
               PODetailstable_nodata,
               po_details_table,
        footer : new sap.m.Bar
           contentRight: [
                          new sap.m.Button({
                          text : "Approve",
                          //press: oController.approve_pr,

    I have modified my code by referring another forum,
    on Tap, i now invoke a method from controller to update the binding i.e to pass the clicked PO number to the context.
    updateBinding: function(oEvent)
      alert("updatebinding");
      var detailServiceUrl = "http://incas1054.ind.cldsvc.accenture.com:8000/sap/opu/odata/sap/ZPURCHASE_PAY_SRV";
      var odataModel_PO_detail = new sap.ui.model.odata.ODataModel(detailServiceUrl,false,  "dev_sde", "28aug@2013");
      odataModel_PO_detail.setCountSupported(false);
      var tableView=sap.ui.getCore().byId("po_details_table_id");
      tableView.setModel(odataModel_PO_detail);
      alert(tableView.getModel());
      var oContext = tableView.getBindingContext();
      //tableView.bindContext("/POHeaderSet");
      alert(oContext);
      var path=  oContext.sPath + "/HDRtoITM";
      var oTemplate = new sap.m.ColumnListItem({
                cells: [
                        new sap.m.Text({ text: "{PoNumber}" }),
                        new sap.m.Text({ text: "{Vendor}" }),
                        new sap.m.Text({ text: "{VendorName}"})
      tableView.bindItems(path, oTemplate);
    Now, i see the PO number is set in the context, but i want to set a different context for details page as i hit different URL, Can anyone suggest on how to set a different context for details page & then pass the PO number from master to detail page?

  • How can i insert character data in a table using the report trigger

    well here is my query
    do_sql ('insert into report_trigger_details values(po report,before parameter)');
    i need to to insert data from within the report using the before parameter form trigger.Error is as follows:
    error: rep-1425,cant parse the statement,missing comma
    This error got removed by removing the space in ''po report" and before parameter"
    Now the error that i get is :ora-00984:column not allowed here
    Also i need to keep the spaces between the values while inserting data
    Please help!!!
    Thanks
    Edited by: 924271 on Mar 29, 2012 7:02 AM
    Edited by: 924271 on Mar 29, 2012 7:07 AM
    Edited by: 924271 on Mar 29, 2012 7:08 AM

    I know this isnt a great way of using query but its part of the assignment ,so any help will be greatly appreciated.
    Here it is again......
    function BeforePForm return boolean is
    segment2 varchar2(10);
    begin
         srw.message(001,'I just got executed first');
    srw.do_sql('select segment1 into :segment2 from xxmssl_po_headers_all');
    srw.do_sql('insert into report_trigger_details values(seq2.nextval,:segment2,''po report'',''before parameter form'',''po number is'')');
    srw.do_sql('commit');
    return (TRUE);
    end;
    the that i was getting earlier was resolved by using two single quotes....Now the error is....
    Error: error putting value in column....
    column 'segment2' may not be referenced by parameter triggers..
    The insert ran fine until I changed the above function as follows:
    function BeforePForm return boolean is
    segment2 varchar2(10);
    type_code varchar2(10);
    org_no number(4);
    begin
         srw.message(001,'I just got executed first');
    srw.do_sql('select segment1,type_lookup_code,org_id into :segment2,:type_code,:org_no from xxmssl_po_headers_all');
    srw.do_sql('insert into report_trigger_details values(seq2.nextval,:segment2,''po report'',''before parameter form'',''po number is'':segment2 '',type_code is'':type_code '',org_no is'':org_no )');
    srw.do_sql('commit');
    return (TRUE);
    end;
    When i ran it ,it started giving the above mentioned error.I reverted the changes back and recompiled my report but still getting the same error....
    Thanks in advance
    Edited by: 924271 on Mar 29, 2012 11:59 PM
    Edited by: 924271 on Mar 30, 2012 12:11 AM

  • Error in Decision Table using Analytic View

    Dear experts,
    I am trying to create a Decision table on an Analytic view. As per the HANA document guidelines, the Analytic view has one Calc. Attribute, the Action is created from a Parameter and Conditions are created from Analytic View column.
    But no luck while activationg the Decision Table and facing below errors. Has anybody gone through such scenario. Please suggest if I am missing something.
    Message :
    XML Parser error: ; Decision Table XML Parser Error: attribute 'ce-id-refs' of element 'av' is missing
    XML Parser error: ; Decision Table XML Parser Error: actionVal is NULL
    XML Parser error: ; Decision Table XML Parser Error: actionNode is NULL
    HANA Version is 1.0 SPS8 Rev80
    Thanks in advance,
    ~Papil

    Hi,
    I have resolved this issue by performing following steps.
    1. Exported Decision Table Data into XL.
    2. Removed the action variable.
    3. Added again the same parameters as Action
    4. Imported XL file of Decision table.
    5. Validated and Activated. It worked.
    regards,
    Shweta

  • Query DB2 tables from oracle using normal view

    This is with regard to querying db2 tables using oracle views. The view is created using dblink. The querying is not an one time activity.querying will be done once in a day. Can i use normal view (will it work ) or should i use materialised view. will i be able to view the added records in db2 table using normal view?
    thanks,
    vinodh

    Vinodh2 wrote:
    This is with regard to querying db2 tables using oracle views. The view is created using dblink. The querying is not an one time activity.querying will be done once in a day. Can i use normal view (will it work ) or should i use materialised view. will i be able to view the added records in db2 table using normal view?How can the SQL select statement via a dblink not work for a view, but the same SQL select statement work for a materialised view?
    Do you think the database link or remote database care whether the select SQL that hits it, comes from a PL/SQL procedure, a view, a materialised view, a job or whatever else? It has no idea what/who is behind that select SQL - and nor does it care.
    As for the benefits of a view vs. a materialised view - that depends on the requirements for needing to use that foreign database's data in the local database.

  • How can I retrieve the condition in an update or delete using instead of trigger

    I have 2 tables, on which a view is created. To distinguish the tables within the view trigger, a column "source" had been added in the view creation. I want to be able to delete row(s) in table t1 or table t2 through the view, depending on a condition. The problem is that I don't know how I can get back the delete condition IN the INSTEAD of trigger :
    CREATE TABLE t1(m NUMBER, n VARCHAR2(10), o date);
    CREATE TABLE t2(a NUMBER, b VARCHAR2(10), c date);
    -- The view is created based on the 2 tables.
    CREATE OR REPLACE VIEW vt12 AS
    SELECT 't1' source, m, n, o
    FROM t1
    UNION
    SELECT 't2' source, a, b, c
    FROM t2;
    -- The trigger will fire whenever INSERT is performed on the tables through the view
    create or replace trigger tvt12 instead of insert or delete on vt12
    begin
    if inserting then
    if :new.source = 't1' then
    insert into t1 values (:new.m, :new.n, :new.o);
    else
    -- will insert a default value of -1 for the fourth column "d"
    insert into t2(a,b,c,d) values (:new.m, :new.n, :new.o, -1);
    end if;
    elsif deleting then
    -- We don't know the condition for the deletion, so all rows from the
    -- table from which the current row is coming will be deleted
    if :old.source = 't1' then
    delete t1;
    else
    delete t2;
    end if;
    end if;
    end;
    show error
    insert into vt12 values ('t1',1,'1',sysdate);
    insert into vt12 values ('t2',2,'2',sysdate+1);
    insert into vt12 values ('t1',3,'3',sysdate+2);
    insert into vt12 values ('t2',4,'4',sysdate+3);
    insert into vt12 values ('t1',5,'5',sysdate+4);
    insert into vt12 values ('t2',6,'6',sysdate+5);
    commit;
    select * from vt12;
    select * from t1;
    select * from t2;
    delete vt12 where m = 1;
    commit;
    select * from vt12;
    select * from t1;
    select * from t2;
    When I execute this script, the delete statement seems to recognize that the condition is affecting a row in table t1, and therefore deletes all rows from the table, as specified in the delete statement of the trigger... But, what I want to do is ONLY to delete the row affected by the original condition. So my question is to know how I can get back the original condition for the delete, and still use it in the trigger, that will be executed INSTEAD of the delete statement.. I checked in the doc, and everywhere an example of INSTEAD OF trigger can be found, but it's always and only using an INSTEAD OF INSERT trigger, which doesn't need a condition.
    Can anyone help ?
    null

    I've never faced this case myself, but from the documentation it would seem that the INSTEAD OF DELETE is also a FOR EACH ROW trigger. Therefore, you don't really have to worry about the actual "where" clause of the original "delete" operation: Oracle has it all parsed for you, so you just need to redirect, in turn, each view record being deleted to the appropriate table.
    In extenso: for your
    delete vt12 where m = 1;
    => the INSTEAD OF trigger fires once for all records in vt12 where m=1, and I would guess that you trigger code should look like:
    begin
    delete from t1 where m = :old.m and n = :old.n and o = :old.o;
    delete from t2 where a = :old.m and b = :old.n and c = :old.o;
    end;
    It's a bit of overkill compared to the "where" clause of the original "delete" statement, but it should do the job...
    BTW, if by any luck you do have some primary key on tables t1 and t2 (say: columns o and c respectively), then obviously you can make the thing simpler:
    begin
    delete from t1 where o = :old.o;
    delete from t2 where c = :old.o;
    end;
    HTH - Didier

  • How to get list data and bind to data table or Grid view in share point 2010 using j query

    hi,
    How to bind list data in to data table or  grid view  using Sp Services.
    How to use sp services in share point 2010 lists and document library 

    Hi, You can use List service, SPServices and JQuery to get your requiement done-
    See here for an sample implementation -
    http://sympmarc.com/2013/02/26/spservices-stories-10-jqgrid-implementation-using-spservices-in-sharepoint/
    http://www.codeproject.com/Articles/343934/jqGrid-Implementation-using-SpServices-in-SharePoi
    Mark (creator of SPServices) has some good documentation on how to use SPServices-
    http://spservices.codeplex.com/wikipage?title=%24().SPServices
    SPServices Stories #7 – Example Uses of SPServices, JavaScript and SharePoint
    http://sympmarc.com/2013/02/15/spservices-stories-7-example-uses-of-spservices-javascript-and-sharepoint/
    Hope this helps!
    Ram - SharePoint Architect
    Blog - SharePointDeveloper.in
    Please vote or mark your question answered, if my reply helps you

  • How to find how name of view and table using in Discoverer report

    Hi all,
    Please help me, i have requirement, i need name of views and tables used in discoverer reports.
    plz help its urgent.
    regards,
    Vivek Gautam

    As per my knowledge goes, We can see from Administrator which Folder is associated with a Workbook. Else you may have to manually open each and every workbook and look for the objects.

  • Using a view to join two tables

    Thank you in advance for any advice you can lend.
    I am using this code in my MySQL db to create a view.
    select
        job.id as job_id,
        umr_cost_calculation.plant_name,
        max(umr_cost_calculation.id) as max_id
    from
        job,
        umr_cost_calculation
    where
        job.id = umr_cost_calculation.job_id
    group by job.id , umr_cost_calculation.plant_name
    I did this so I can join two tables and pull in the most current cost data for a specific plant. The report will, at times, show the wrong (older) data. I can re-run the report, filter to just the one job and see again the wrong data. When I add the max_id to the report, it display the id and updates the report with the correct data. It appears that the view was stale and by adding the ID to the report this fixed the issue.
    1) Is this the best way to make this join? I don't see how Crystal supports a subquery to make a join (this is why I used the view).
    2) If I leave the max_id on the report, will this force the view to always update?

    Try:
    Select
    D1.EmpLoginID,
    Count(D1.ID),
    Count(D1.AlarmCode),
    D1.EmpName,
    D1.EmpAddress,
    D2.Db2Count
    FROM DB1.Data D1
    LEFT JOIN (SELECT
    empLoginID, Count(*) as Db2Count
    FROM DB2.ALL_Database
    WHERE site = 'Atlanta'
    GROUP BY empLoginID
    ) D2
    ON D1.EmpLoginID = D2.EmpLoginID
    GROUP BY D1.empLoginID, D1.EmpName, D2.EmpAddress, D2.Db2Count
    Order BY D1.empLoginID ASC
    For every expert, there is an equal and opposite expert. - Becker's Law
    My blog
    My TechNet articles

  • Using SQL view object to create ADF table

    Hi,
    I have created a column called "Month" (which extracts month from the date column) and another column to count the no. of requests.
    i want to create an ADF table with 2 columns, a column showing the month and another is showing the no. of requests for that month.
    However, now I only managed to achieve the ADF table to show the overall total requests, which means if i add up all the requests for all the months and i get 500
    My ADF table shows this:
    Jan: 500
    Feb: 500
    Mar: 500
    How should I create the view or what should I do to make it such that the no. of request is based on the month?
    Please advice.
    Thanks (:

    Hi,
    For the given situation you can create a Query Based View Object with the following query
    SELECT
    COUNT(TEMP1.DT) REQUEST,
    TO_CHAR(TEMP1.DT, 'Mon') MONTH
    FROM
    TEMP1
    GROUP BY
    TO_CHAR(TEMP1.DT, 'Mon')
    where DT is the date column and temp1 is the name of the database table.
    Following are the steps that i followed to get this query :
    i have taken the following sample table :
    create table temp1
    (srno number primary key,
    dt date)
    *Note you may use any existing column instead of srno or use dt only (i took an extra column as u know we need a primary key /row id)
    the following is the sample data
    insert into temp1 values (1,sysdate);
    insert into temp1 values (2,sysdate);
    insert into temp1 values (3,add_months(sysdate,1));
    insert into temp1 values (4,add_months(sysdate,1));
    insert into temp1 values (5,add_months(sysdate,3));
    insert into temp1 values (6,add_months(sysdate,5));
    the table appears as follows
    SRNO DT
    1 22-JUN-12
    2 22-JUN-12
    3 22-JUL-12
    4 22-JUL-12
    5 22-SEP-12
    6 22-NOV-12
    To start with ADF View Object Creation (Using Jdeveloper 11.1.2):
    Create the view object using Create View Object wizard
    In Step 1. Name window
    set the value for Name : Viewab (you can use any of ur choice)
    In the data source section : select query
    In Step 2. Query window
    a. Click Query builder (it will pop up sql statment window)
    b. In the SQL Statement window
    in quick-pick objects section -> select temp1 table -> shuttle the columns from available list to selected list
    in select clause section -> select srno column from select list-> choose count() function from function drop down list -> insert function -> set alias to REQUEST-> click validate
    now select dt column from select list -> choose to_char() function -> click insert function -> alter the function to to_Char(temp1.DT,'Mon') -> set alias to Month -> click validate
    in the group by clause section -> Click the green symbol to add -> from the expression palette insert dt column -> insert the to_char function -> alter the function to to_char(temp1.DT,'Mon') -> click validate
    in the Entire SQL Query section -> click test query -> in the test query window -> click query result-> you will see the result -> click close -> click ok
    Click next
    Step 3: Bind Variables
    Click Next
    Step 4: Attribute Mappings
    click Finish
    So the view object is ready :)

  • Abort inserting a record in a table using a trigger

    Hi there,
    Is there any way to abort inserting a record in a table using a trigger?
    For full details, I have the following table ("myTable"):
    BSC INTEGER NOT NULL,
    BTS VARCHAR2(20) NOT NULL,
    INFO1 INTEGER,
    INFO2 INTEGER
    myTable_PK = PRIMARY KEY (BSC,BTS)
    I have also a stored procedure that imports a data from text file and inserts them to the specified table (using UTL_FILE package). The stored procedure works great.
    But the thing that in the text file itselft it might be (due to third-parity report generation bug) that the primary key will be violated or the BSC/BTS field has null value. In such case I just want to ignore the insertion statement using a trigger.
    Thanks

    Ok Jens, could you tell me what exception could I use?
    Below a protion of my StoredProcedure.
    CREATE OR REPLACE PROCEDURE update_myTable() IS
    FHANDLE UTL_FILE.FILE_TYPE;
    BSC INTEGER;
    BTS VARCHAR2(20);
    INFO1 INTEGER;
    INFO2 INTEGER;
    BEGIN
    FHANDLE := UTL_FILE.FOPEN('LOG_FILE_DIR',FILENAME,'R',4000);
    LOOP
    UTL_FILE.GET_LINE(FHANDLE,STR);
    -- Process the line STR and generates BSC, BTS, INFO1, and INFO2 values
    EXECUTE IMMEDIATE 'INSERT INTO myTable VALUES(:1,:2,:3,:4)' USING BSC,BTS,INFO1,INFO2;
    END LOOP;
    EXCEPTION WHEN NO_DATA_FOUND THEN UTL_FILE.FCLOSE(FHANDLE);
    END UPDATE_R205BTS;
    Remember that I am already using an exception with NO_DATA_FOUND to indicate the end of file then closing it.
    Thanks for your reply

  • How to rearrange the structure of a table by using a view?

    At wits end: I need to reorganize the structure of a table into a new structure - either as a view or actually moving the data from the old structure to the new structure (using a view).
    The old structure is:
    TESTNAME, SCHOOL_ID, PTILE1, PTILE2, PTILE3 ... PTILE99
    Test1,0001,18,19,20...
    Test1,0002,23,24,28...
    Test1,0003,20,21,26...
    Test2,0001,48,52,55...
    Test2,0002,50,54,54...
    Test2,0003,60,62,64
    The new structure is:
    SCHOOL_ID,PTILE,TESTNAME1,TESTNAME2...
    1,0001,Score1,Score2...
    1,0002,Score1,Score2...
    1,0003,Score1,Score2...
    2,0001,Score1,Score2...
    2,0002,Score1,Score2...
    2,0003,Score1,Score2...
    99,0001,Score1,Score2...
    99,0002,Score1,Score2...
    99,0003,Score1,Score2...
    What this data shows are the percentiles for test scores for different tests for each school who took the tests.
    It seems like creating a view to arrange the data through a bunch of selects and unions would work, but I can't figure out how.

    Tricky.
    When confronted with a problem like this I try to write out an algorthm in pseudocode to work out what I want to do. If you have more than 2 or 3 tables to merge I'd consider going with a new structure; otherwise the view approach might be a good idea. Remember that if you go with a new structure you can insert once and update the other values later, something like
    foreach school insert row
    update testname1
    update testname2
    Good luck.

Maybe you are looking for

  • IPhoto calendar won't complete uploading?

    The uploading process to producing a calendar in iPhoto is freezing about halfway through. Any ideas?

  • PO Vendor and Frieght vendor will be differe

    Hi Frds, I have one query regarding PO vendor(100001) and Freight vendor(100002) is different.I posted MIRO for PO vendor.Now i am trying to post MIRO for frieght vendor by using main PO but system is showing error different invoice party can not be

  • Alternative data for Vendor

    Hello, I would like to use the alternative data for the vendors. But, I canu2019t manage information such as planning cycle at the vendor level. The information comes from the material and not from the alternative data of the vendor. For example, the

  • Future updates to iPad 1, beyond 5.1.1?

    Will there be futher updates to iPad 1, beyond 5.1.1?

  • Doubts in RWB

    1. when i am doing message monitoring.in RWB for each message i am getiing in each row i could get sendersystem and all and atlast reciever system and succesful..below that in another row i could not find reciever system and saying that unsuccesful..