How to use database as  MS excel

All,
I have working knowledge of Sql but sometimes some problems do creep up .
we have a 4 tables A,B,C,D and a master X having similar columns within them orderid,orderdate,ordertime and orderval.
now the issue here is :
1. i need to do a left join (for X )and find out if anyorderid from ABCD matches X and if it does then in a new table hold Column name in P
but couldnt decide if there are more than 1 match then point 2 should come in.
2. if there are more than 1 match then select the most recent orderdate and time from ABCD and place in P the second lowest in Q and .......
E.g: if c has the lowest date and time then the new column P should hold C as a value.
Table "PQRS" with coulm names XPQRS and X populated from master
X P Q R S
451 c d b a
452 d a b c
The above one shows a new table where i want to have columns which will sort the ordertime and date according to the lowest to highest in the row but hold the column names as value instead time or date.
Any thoughts.

Hi,
UOOLK wrote:
All,
I have working knowledge of Sql but sometimes some problems do creep up .
we have a 4 tables A,B,C,D and a master X having similar columns within them orderid,orderdate,ordertime and orderval.
now the issue here is :
1. i need to do a left join (for X )and find out if anyorderid from ABCD matches X and if it does then in a new table hold Column name in P
but couldnt decide if there are more than 1 match then point 2 should come in.
2. if there are more than 1 match then select the most recent orderdate and time from ABCD and place in P the second lowest in Q and .......
E.g: if c has the lowest date and time then the new column P should hold C as a value.
Table "PQRS" with coulm names XPQRS and X populated from master
X P Q R S
451 c d b a
452 d a b cI'm not sure I understand the problem.
Whenever you have a problem, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and the results you want from that data. Simplify as much as possible. Your real problem involves 5 or 6 tables, but if you post a problem using only 3 or 4 tables, you'll get an answer that can easily be adapted to any number of tables. Just make it clear how your real data differs from what you post.
In the case of a DML operation (such as INSERT) the sample data should show what the tables are like before the DML, and the results will be the contents of the changed table(s) after the DML.
Explain, using specific examples, how you get those results from that data.
Always say what version of Oracle you're using.
The above one shows a new table where i want to have columns which will sort the ordertime and date according to the lowest to highest in the row but hold the column names as value instead time or date.Do you really want a new table, or do you just want a result set that has 2 rows and 5 columns, as shown above? (You can use a result set in queries as if it were a table.)
Any thoughts.This sounds like a Pivot problem. See the forum FAQ
SQL and PL/SQL FAQ
"4. How do I convert rows to columns?"
Use the analytic ROW_NUMBER function to number the original rows in descending order by date (that is, 1 will be the most recent), and use this computed number to determine the output column.
What part does MS Excel have in this problem?

Similar Messages

  • How to use database look up table function in xsl mapping

    Can anybody tell me how to use database look up table function while mapping xsl between 2 nodes.
    I have an XML file coming in and depending on one of XML elements we need to decide which further path to take. But, using this XML element, we need to query database table, get metadata and accordingly take appropriate path. I have written lookup function which returns metadata value.
    Now, the issue is how do I pass the XML element valu as input to look up function? When I tried to drag it to the input node of lookup function, it throws an error like "Maximum number of parameters exceeded"
    Thanks,

    If the lookup table is always going to remain the same (e.g. a character generator or something similar) you can place the values in a 2D array constant on your diagram, with the input value as one column, the equivalent as the other. When you need to perform the lookup you use an index array to return all the values in the "input column", search it using "search 1D array" and use the resulting index number to index the other column's data. If the values may change, then it would probably be best to load an array control with your equivalent values from a file.
    P.M.
    Putnam
    Certified LabVIEW Developer
    Senior Test Engineer
    Currently using LV 6.1-LabVIEW 2012, RT8.5
    LabVIEW Champion

  • How to import database created in Excel to appropriate fields in a PDF form?

    I am trying to use Database created in Excel to fill multiple PDF Visa application forms.
    The fields in PDF forms are basically the same except the order of appearance on the
    form could be different. However the field names remain the same in all PDF Visa Application forms.
    Can anyone make me wiser?
    Appreciate all suggestions.
    Sajith Panduka

    If you export to a tab delimited format and the first row contains the exact field names of the fields in the form (order doesn't matter), then you can import a row of data into the form using Acrobat. You can also automate the process using JavaScript in Acrobat.

  • How to use Database views in XI

    Hi Folks,
    Any idea about how to use Database views for sending and receiving messages in XI ?
    Regards,

    Farooq,
    My doubt is do i have work in the same fashion as if i am working on a Database Table...?
    For Ex :
    Creating Source and Target Data structure for JDBC adapter in the same format....etc
    Regards.

  • How to use ActiveX Microsoft Office Excel Chart?

    Does anyone know how to use "ActiveX Microsoft Office Excel Chart" from CVI 7.0? I tried with following code but it did not draw anything.
    HRESULT MakeChartInExcelActivexCtrl(void)
    HRESULT error = 0;
    char szErrMsg[256];
    // Create a new chart with its own worksheet
    // ExcelRpt_ChartNew(workbookHandle,-1,&chartsheetHandle);
    SetWaitCursor (1);
    // Open new Range for Worksheet
    error = CA_VariantSetCString (&MyCellRangeV, EXCEL_ARRAY_OF_CELLS);
    error = Excel_WorksheetRange (ExcelWorksheetHandle, NULL, MyCellRangeV, CA_DEFAULT_VAL, &ExcelRangeHandle);
    CA_VariantClear(&MyCellRangeV);
    if (error<0)
    CA_GetAutomationErrorString(error, szErrMsg, sizeof(szErrMsg) );
    goto Error;
    error = Excel_GetProperty (excelChart, NULL, Excel_WindowActiveChart, CAVT_OBJHANDLE, &ExcelChartHandle);
    if (error<0)
    CA_GetAutomationErrorString(error, szErrMsg, sizeof(szErrMsg) );
    goto Error;
    // Create a XY scatter chart using the data we wrote to the worksheet as its data source.
    error = ExcelRpt_ChartWizard(ExcelChartHandle, ExcelWorksheetHandle, EXCEL_ARRAY_OF_CELLS,
    ExRConst_GalleryXYScatter, ExRConst_Columns, 0, 0, 0, 0, "Filtered Data Chart", "",
    "Weather Data", NULL);
    if (error<0)
    CA_GetAutomationErrorString(error, szErrMsg, sizeof(szErrMsg) );
    goto Error;
    // Change the plot lines to not display markers and smooth out
    // the plot lines. This is one of the plot styles available in Excel.
    error = ExcelRpt_SetChartAttribute (ExcelChartHandle, ER_CH_ATTR_CHART_TYPE, ExRConst_XYScatterSmoothNoMarkers);
    if (error<0)
    CA_GetAutomationErrorString(status, szErrMsg, sizeof(szErrMsg) );
    goto Error;
    Error:
    SetWaitCursor (0);
    CA_VariantClear(&MyCellRangeV);
    CA_VariantClear(&MyVariant);
    ClearObjHandle (&ExcelRangeHandle);
    ClearObjHandle (&ExcelChartHandle);
    ClearObjHandle (&ExcelChartObjHandle);
    ClearObjHandle (&ExcelChartsHandle);
    if (error < 0)
    ReportAppAutomationError (error);
    return 0;
    Attachments:
    excelActivexCtrl.zip ‏4692 KB

    I use C:\Program Files\National Instruments\CVI90\toolslib\activex\excel\excelreport.fp to  build/modify excel report.there is very detail configuration in this function moudule , hope it can help you 
    Sonic
    Diffrent Strokes for Different Folks

  • How to use Database adapter as inbound adapter without having polling strategies?

    Hi All,
    I have a requirement wherein I have to use Database adapter to retrieve the data for every half an hour from one(X app) database and update that data into another application(Y app) .That database adapter will be along with BPEL process.My Flow would be like this:
    Database Adapter( In 'exposed services' section) ----->   BPEL (in 'Components') -----> Y app service( in 'External References' section)
    My questions for each step are below
         1) I have to retrieve the data from database(x app database) for every half an hour.So I have to schedule my whole process such that it should execute for every half an hour.
    Means I have to get  whatever the data is updated in the last half an hour in that database.
          The database adapter should be inbound in SOA composite editor(in 'Exposed services' section).
    But in order to have inbound adapter,we have select the 'Poll for New or Changed Records in a Table' option in turn we have to select one of polling operations below:
             Delete the Row(s) that were Read
    Update a Field in the [Table_Name] Table (Logical Delete)
    Update a Sequencing Table
    Update an External Sequencing Table on a Different Database
    Control Table Strategy
    But the problem is I don't have any control on the database(X app database) ,So (I can't update any data on that table,because that table may not have a field or table to update the processed rows)I can't choose any of the above operations.
    How can I achieve what I want that is to retrieve the data and schedule the process?
    Thanks in advance.

    Hi Heckler,
      Thank you very much for your answer that I can proceed further somehow.
    I still need to have some clarifications.
    In order to have a process which retrieves the data (Inbound operation) and updates the data into other application, the data(from X app)  should be the request(through DB adapter) of the BPEL process.
    X app does not do anything to send.We have(the BPEL process) to receive the data (or) no event is triggered.
    The flow :
    Database Adapter( In 'exposed services' section to retrieve data) ----->   BPEL (in 'Components') -----> Y app service( in 'External References' section)
    How can we ensure the data will be  request to BPEL process(means it will be in 'exposed services' section in SOA composite editor) for every half an hour if we use pick activity and database adapter as first activity?
    When we use ''Poll for New or Changed Records in a Table' ,then only adapter becomes inbound and comes into the 'exposed services' section.I can't use it as I don't have any control on the source table.
    I have this confusion before starting the process.Please help me to clear out the doubts.
    And this whole process should be executed automaticallly for every half an hour(means it creates instance for every half an hour)  Once we build the BPEL process.
    How to schedule it?
    And where do I need to create control table ?You mean I have to use some different database where in I have to create the table?

  • How to use Database Adapter in BPEL

    I want to use Database Adapter in BPEL to transfer data from one table to other table and the data is still hold in the read table?
    I can find a example from http://download.oracle.com/docs/cd/B31017_01/integrate.1013/b28994/adptr_db.htm#BDCIGDCB.
    And the general design of my BPEL is as following:
    1. Add a "status" column to the read table. And alter the value of status column of all data in read table to "unreaded".
    2. Then create a empty BPEL (BPELAdapter) Project.
    3. Add a Database Adapter:
    (1) In step 1 of Adapter Configuration Wizard, configure the Service Name to datain.
    (2) In step 2, configure the database connection.
    (3) In step 3, choose "Poll for New or Changed Records in a Table".
    (4) Then click Import Tables button, and choose the read table.
    (5) In step 5, choose a column.
    (6) Don’t do anything in step 6 and 7.
    (7) In step 8, choose "Update a Field in the [Datain] Table (Logical Delete)".
    (8) In step 9, configure Logical Delete Field to STATUS, configure Read Value to readed and configure Unread Value to unreaded.
    (9) Don’t do anything in step 10 and 11.
    4. Add a receive activity to connect to above database adapter.
    5. Add another Database Adapter. Then configure this database adapter service WSDL:
    (1) In step 1 of Adapter Configuration Wizard, configure the Service Name to dataout.
    (2) In step 2, configure the database connection.
    (3) In step 3, choose Perform an Operation on a Table (and all items under it).
    (4) Then click Import Tables button, and choose the write table.
    (5) In step 5, choose a column.
    (6) Don’t do anything in step 6, 7 and 8.
    6. Add a invoke activity to connect to above database adapter.
    7. Add a assign activity between the receive activity and invoke activity. And configure the assign copy operation.
    But after I deploy this BPEL project to the BPEL server and invoke this project, I get following error. Meanwhile, this BPEL don't take effect.
    The following exception occured while processing this request:
    Can't find partnerLinkType 2.
    in
    "file:/D:/soft/SOASuite/product/10.1.3.1/OracleAS_1/bpel/domains/default/tmp/.bpel_BPELAdapter_1.0_e82210b05e4d3e997eed581d0d220293.tmp/_BPELAdapter.wsdl" WSDL to find PartnerLinkType "{http://xmlns.oracle.com/pcbpel/adapter/db/datain/datain_plt"。
    How to resolve?
    Thanks,
    Melody

    Now, I can insert data into the table through Database Adapter.
    But still can't select data from the table through Database Adapter.
    Above error still happen when invoke the read database table with Database Adapter project:
    Can't find partnerLinkType 2.
    in
    "file:/D:/soft/SOASuite/product/10.1.3.1/OracleAS_1/bpel/domains/default/tmp/.bpel_BPELAdapter_1.0_e82210b05e4d3e997eed581d0d220293.tmp/_BPELAdapter.wsdl" WSDL to find PartnerLinkType "{http://xmlns.oracle.com/pcbpel/adapter/db/datain/datain_plt"。

  • How to use database without wizard

    Can anyone help me to use recordsets without using the appwizard at the creation of my project?
    the purpose is to input on the database values from a form without using a database project, so in my MFC project I do the following and then I faced problems :
    In the class which I use the database I add the member variable
    CDatabase m-Mydatabase;
    on an "OnButton" function of this class I do :
    m_Mydatabase.Open(NULL,FALSE,FALSE,stringconnect)
    I have many dialog boxes, each dialog has a form from which I get data and put them on the database and vice versa.
    I create fo each dialog box a RecordSet, and I include the .h file of the record set in the dialog class in which I'm going to use it.
    So now how to use this recordset and put the values from controls to database ?
    thank's in advance.

    MFC? CDatabase?
    Hmmmm.....are you aware that this forum is for Java (a programming language) and you are asking a question about MFC (Microsoft C++ windows framework.)
    Perhaps if you could clarify the exact problem that you are having with java, jni or one of the other java libraries?

  • How to use database control to execute sql queries which change at run time

    Hi all,
    I need to execute sql queries using database controls , where the sql changes
    at run time
    based on some condition. For eg. based on the condition , I can add some where
    condition.
    Eg. sql = select id,name from emp where id = ?.
    based on some condition , I can add the following condition .
    and location = ?.
    Have anybody had this kind of situation.
    thanks,
    sathish

    From the perspective of the database control, you've got two options:
    1) use the sql: keyword to do parameter substitution. Your observation
    about {foo} style sbustitution is correct -- this is like using a
    PreparedStatement. To do substitution into the rest of the SQL
    statement, you can use the {sql: foo} substitution syntax which was
    undocumented in GA but is documented in SP2. Then, you can build up
    the filter clause String yourself in a JPF / JWS / etc and pass it into
    the DB control.
    For example:
    * @jc:sql statement="select * from product {sql: filter}"
    public Product[] getProducts(String filter) throws SQLException;
    This will substitute the String filter directly into the statement that
    is executed. The filter string could be null, "", "WHERE ID=12345", etc.
    2) you can use the DatabaseFilter object to build up a set of custom
    sorts and filters and pass that object into the DB control method.
    There have been other posts here about doing this, look for the subject
    "DatabaseFilter example".
    Hope that helps...
    Eddie
    Dan Hayes wrote:
    "Sathish Venkatesan" <[email protected]> wrote:
    Hi Maruthi,
    The parameter substituion , I guess is used like setting the values for
    prepared
    statements.
    What I'm trying to do , is change the sql at run time based on some condition.
    For example ,
    consider the following query :
    select col1,col2 from table t where t.col3 > 1
    At run time , based on some condition , I need to add one more and condition.
    i.e. select col1,col2 from table t where t.col3 > 1 and t.col4 < 10.
    This MAY not address your issue but if you are trying to add "optional" parameters
    you may try including ALL the possible parameters in the SQL but send in null
    for those params that you don't want to filter on in any particular case. Then,
    if you word your query
    as follows:
    select col1, col2 from table t where t.col3 > 1 and (t.col4 = {col4param} or
    {col4param} is null) and (t.col5 = {col5param} or {col5param} is null) ...
    you will get "dynamic" filters. In other words, col4 and col5 will only be
    filtered if you send in non-null parameters for those arguments.
    I have not tried this in a WL Workshop database control but I've used
    this strategy dozens of times in stored procedures or jdbc prepared statements.
    Good luck,
    Dan

  • How to use database link in from6i?

    I can use database link in sql plus,but i can't use it in forms6i,why? thanks

    Don't know why.
    What I always do is create a synonym on the local database which points (through the db link) to the object on the other database.
    Regards,
    Meine

  • How to use database file within jar archive

    Hi. I'm quite new in Java programming, and I'm wondering if what I did makes sense or not.
    In my applet I'm using a MS Access Database file, which is contained in the same Jar Archive like the Applet class file. I tried and tried to use this Database file directly but it wouldn't work. Than I read in some other forum that it is not possible to use the database file directly within the archive. First question: Is that true?
    Than I desided to extract the DB file in the init() method of my applet to the default temporary foulder. When the program is closed I use the destroy() method to delete it again. Everything works well now. But is this the typical way this is done?
    Thanks for help!

    Hi,
    here is the code which extracts the database file out of the jar archive (the same archive in which the class file is):
    //get the user temporary folder
    File TempFolder = new File(System.getProperty("java.io.tmpdir"));
    //create (empty) db file
    efile = new File(TempFolder, "steelSections.mdb");
    // if database file is not yet extracted
    if (!efile.exists()) {
    //get an input stream for the database file
    InputStream in = new BufferedInputStream(this.getClass().getClassLoader().getResourceAsStream(
    "FaST/db/steelSections.mdb"));
    //create an output stream for the db file on the file system
    OutputStream out = new BufferedOutputStream(new FileOutputStream(efile));
    //-Buffer to copy the data
    byte[] buffer = new byte[2048]; //buffer to copy the binary
    for (;;) {
    int nBytes = in.read(buffer); //read data
    if (nBytes <= 0)
    break; //no more data to read
    out.write(buffer, 0, nBytes); //write data
    out.flush(); //close out and in streams
    out.close();
    in.close();
    If you have the db file in an other jar archive file you need a referenze to the entry in the other jar archive. I'm not sure how to get this, but I'm sure you fill find a solution by searching in this forum...
    Good luck!

  • [Urget Help] [BPEL 11g] How to use Database 11g as Identity Service source?

    Dear all,
    My customer is using BPEL 11g for current project. They have a legacy user database (Oracle DB 11g) which store all accounts info.
    Now we want to connect BPEL with this database as identity service and pick up the users and groups as approver. I saw following graph from below link, but I don't know how to implement it. It seems a huge change in BPEL 11g.
    Can you give me an idea on it? Any suggestions are welcome.
    http://download.oracle.com/docs/cd/E12839_01/integration.1111/e10224/bp_workflow.htm#BABEIHDD
    Thanks in advance.

    repost

  • How to use database link

    OS in both systems is linux. database oracle 10g
    how to connect two databases present in other locations;
    that is sitting at place A i should be able to access database at B

    Hi Mate;
    If you make google, you can see what is dblink&how you can use it&what is usage of dblink etc. etc. wiht many good oracle article and some good oracle blog.
    Please check this search
    Regard
    Helios

  • How can use the active x excel to change the assigned data/number in my VI?

    I have an assigned data in my vi using build array and insert into array. i can change the data in excel,
    but i can't change the data in array, How can I connect/communicate/control the data in aray using active x excel.
    (i know this is complicated that's why i'm trying to get helped)
    (please lend me a simple example)
    Thank You very much.

    The one I pointed you to before was a bad example. Try the one here. The example returns the cell value as a string but that's easy enough to change. You can also modify it to return a range of cells to create a LabVIEW array. You can also search NI Dev Zone for other examples by going here and you can also search this forum for Excel examples.

  • How to use Entity Attributes in excel Rule File

    Hello,
    I have defined two entities Entity A with two attributes and Entity B child of A with two attributes.
    I needed to have many instances of theses objects thats why i have chosen entities.
    I need to calculate for each entity a result depending on the values of the attributes filled by the user.
    My final goal is to have the sum of these calculated results.
    The issue i am facing is whenever i try to define a rule in Excel, OPM considers the attribute as global (and creates it) and not as entity level. I therefore have duplicate error.
    How can i tell Excel/OPM that the attribute is entity level ?
    Thank you.

    Make sure you are using exactly the same attribute text in Excel and in your properties file. You can also use the legend key to map from the attribute text to a shorter form.
    There isn't any magic here! If the text is the same it will match.
    If you provide the actual text of the attributes and entities you are using, we might notice something else.
    Davin.

Maybe you are looking for

  • How to refer latest jar(shared library) in ear?

    Hi , I have created one share library(myappshared) which refer myapp.jar. this jar is getting updated freequently. I deployed one ear which is reffering this shared library(myapp.jar). This reference is working fine  but once jar is getting changed,

  • Mechanism for Info Object Data elements inherit source documentation?

    Say I am in ECC. I go to SE11, give table name MARA and then doubleclick on the dataelement 'MATNR'. Then I click on documentation. I get a popup with Short text " Material Number" and Definition "Alphanumeric key uniquely identifying the material'.

  • How to copy all vpd policies to another schema ?

    Hi all, I have two schema : app_test app_live app_test has 70 VPD policies implemented. How to copy those policies to be implemented also in app_live ? (to avoid runnng the script one by one again ?) Thank you, xtanto

  • Whoops - Need to locate Calendar Data File Please

    I set up corporate google e-mail and calendar on my iPhone 4, and somehow it wiped out my calendar data on my MacBook Pro and iPhone 4. I back up to Time Machine and to Norton Cloud. How can I retrieve the Calendar data file? Thanks.

  • Need customizing help

    hello all Gurus, I m a MM consultant but as a sole I m having responsibility for rollout of new plant for FICO, MM, PP, SD  modules. Almost cusomization is completed from implementation team but work yet has not started on system. SO can any one of u