XSQL File - Dynamic query from standard Browser - XML response.

Hi, this is my first post !
I need to query an Oracle DB from the web browser and get the data in XML format.
I've made some progress but they're still not enough.
I wrote a FIXED query from JDeveloper XSQL File (here is my big lack of knowledge) and then I compiled it, and run it. Doing so, a tcp service listening to specific port was created. (I also have a program called lsnrctl running at server side). For example:
http://IP:PORT/Application1-test1-context-root/query.xsql
Ok, pointing that address from explorer, I happily have the result of my FIXED query in XML format:
<?xml version="1.0" encoding="windows-1252"?>
<ROWSET>
<ROW NUM = '1'>
<field_1>value_1</field_1>
<field_2>value_2</field_2>
<field_3>value_3</field_3>
<field_4>value_4</field_4>
</ROW>
<ROW NUM = '2'>
<field_1>value_A</field_1>
<field_2>value_B</field_2>
<field_3>value_C</field_3>
<field_4>value_D</field_4>
</ROW>
</ROWSET>
BUT I need to pass the query as a DYNAMIC parameter. Something like:
http:IP:PORT/...?SQL="SELECT * FROM MY_TABLE WHERE my_condition ORDER BY my_column" from the browser.
Please, I will appreciate any suggestion, to put me in the right way!!
I am struggling to find out the solution since last two weeks!
Thank you in advance !
JM

Ok,what I needed was this xsql file:
<?xml version = '1.0' encoding = 'windows-1252'?>
<page xmlns:xsql="urn:oracle-xsql" connection="jdbc/user_xsql_1DS">
<xsql:query max-rows="-1" null-indicator="no" tag-case="lower">
{@sql}
</xsql:query>
</page>
So, from the web browser i can pass ?sql=MY_GENERIC_QUERY. And it works just as I expect.
BUT. I tried this running Embedded OC4J Server (from the IDE). The last step I need is to achive the same result but from a generic web server like Apache.
If I copy the .xsql file to ../htdocs/ the root apache directory for documents, and I ask for http://localhost/query.xsql what I get is the QUERY but not the RESPONSE. I don't get the values from the selected table, what I get again is:
<?xml version = '1.0' encoding = 'windows-1252'?>
<page xmlns:xsql="urn:oracle-xsql" connection="jdbc/user_xsql_1DS">
<xsql:query max-rows="-1" null-indicator="no" tag-case="lower">
{@sql}
</xsql:query>
</page>
Can anybody guide me to configure Apache in order to get the resulting XML, not my query!!
Thank you in advance!
Juan Manuel

Similar Messages

  • Dynamic query from Infopath

    Greetings.  My ultimate goal is to be able to type in an account number in a browser enabled InfoPath form textbox and have it retrieve information about that account (customer's name, address, etc.).  I've set up an External content type
    to a SQL table with 100,000+ rows and created the external list to hold the data (after disabling the throttling limits).  I set a filter when creating the ECT and can't filter the data any more for my purposes.  I increased the data
    connection timeouts and response sizes in InfoPath just to see how long it would take to retrieve this data in InfoPath so that I could use a form to interface and query the data.  The performance of the form is unacceptable to me as it took nearly 7
    minutes to load.  So, my question: are there alternatives to custom code that will work for my situation?  Can I somehow dynamically set the content type filter through an InfoPath field so that I need not query all 100,000 records?  I
    know I can dynamically adjust a querystring directly to SQL through C# or VB but I'm trying to avoid that because I want to publish my form as a site content type (as opposed to an administrator approved form template). 
    Thanks in advance.
    Andy
     

    Hi,
    According to your post, my understanding is that you wanted to dynamic query from Infopath.
    I recommend to add code to the "click" event of a button to modify a SQL Server secondary data connection to use a "filter" from your form.
    Here is a similar thread for your reference:
    http://social.technet.microsoft.com/Forums/en-US/5aa4519c-b8e0-4a7c-85b4-09f7e1d0747a/dynamic-sql-data-connection-in-infopath?forum=sharepointcustomizationprevious
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • Tricky - PDF file not Opening from Web Browser based application

    Hi Guys,
    Just a brief history about the issue:
    At my client site everything was fine when IE7 was there and everybody were able to open PDF files from web applications in browsers. But after a IE8 upgrade, things changed and customers are facing problems. All are Windows XP SP3 machines
    Issue: If they try to open a pdf file from the browser it just stucks at 0% and hangs with "Cancel" button. Even if they try to save that file it tell downloading and hangs again in the screen without downloading the file.
    Initial fix:
    Open Adobe Reader
    -> select the menu "Edit"
    -> select "Preferences"
    -> select the Category "Internet"
    -> set the indicator "Display PDF in browser"
    -> Reboot the machine
    This fix worrked for some people but many user are still experiencing the same thing even after changing the setting many times.
    Friends, Is there anything else might be creating the trouble here. Please let me know, and why it is that for some systems it is working and for it is not ?
    Thanks,

    There was a browser bug with IE in the past that seemed to span several browser versions.  It had to do with the interaction of the browser and the webserver.  The short version is that I had to toggle the caching option on the folder.
    Here's what I ended up doing for my client:
    Move their PDF documents into a subfolder called forms and all Flash animations into a subfolder called flash
    Marked all folders in the site to "Expire Immediately" (IIS -> highlight root folder -> Properties)
    Individually marked the "/forms" and "/flash" folders to toggle this caching option
    In this way, it allowed dynamic pages to deliver non-cached content (from the server's perspective) and it allowed binary downloads like Flash animations and PDF files to work as expected without errors.  The bug has to do with the cache-negotiation handshaking that goes on between the browser and server.
    This may not be what you're seeing but it's good to remember because I've seen it often:  the settings that you'd use to optimize a web applications don't seem to work for binary downloads like a PDF document.

  • Data download from CRM from standard browser based transactions

    This is, I'm afraid, rather a general question. I'm doing some R&D for a software development company (SAP Partner), and we're looking for a few use cases for where data is downloaded from CRM, specifically from browser based transactions. We're not interested in anything that downloads from ALV - we've got that covered. Our main concern is other download mechanism that might be available in standard CRM functionality.
    If anyone can point to some use cases, involving data download from a browser front end (web dynpro, presumably), that would be very useful.

    Hello Matthieu,
    As far as CRM7.0 is concerned (which is bsp-based) here are a few applications where users can download information from sap to local pc:
    - Take any result list table and hit the "download to excel button".
    - Start the "data import tool" that is available in UTIL_SALES business role, you'll be able to download an Excel file as well
    - Click any link to attached documents to a business object (sales order transaction for example)
    - Etc.
    If you need help to start one of those application just let me know.
    Regards
    Nicolas.

  • Uploading the file to server from the browser using JSP

    I have facing difficulty while uploading the file from the browser using user interface to the server or to the database. As previousy i was working in coldfusion, i find it very easy there with cffile command, but i am confused how to do that in JSP
    please reply soon, as i am stuck in my project because of that
    Sarosh

    Check out http://www.jspsmart.com , They have a nice free upload api that can be used w/ JSPs or Servlets. I hear O'Reilly has a nice one too. May as well use someone elses if they've done it already.

  • How to dynamically query from an LOV CO?

    Hi,
    I have a page and AM
    I also have an LOVVO linked to LOVAM.
    The LOV Vo is query based and contains a whereclause like user_id = :1
    I have created a LovRN and LovCO based on the RN
    I want to filter LOV values based on logged in user ID during PR
    How to dynamicaly invoke the execute query from Lov CO PR() ?
    I have written a method in LOV AM and when I try to invoke it from Lov CO, i get an error 'Method does not exist'. Should I write the method in Room AM?
    In case I write the method in Root AM (linked to OA pages), how can I access the LOV VO as it is assigned to LOv AM only.
    Thanks,
    Kamath

    Hi
    write this code in CO
    OAApplicationModuleImpl am =
    (OAApplicationModuleImpl) pageContext.getApplicationModule(webBean);
    System.out.println("Inside CO");
    am.invokeMethod("initEmpVO");
    write this code in AM
    public void initEmpVO()
    VacancyVOImpl vo = getVacancyVO();
    System.out.println("Inside initEmpVO");
    if(vo == null)
    MessageToken errTokens[] = {
    new MessageToken("OBJECT_NAME", "VacancyVO")
    throw new OAException("AK", "FWK_TBX_OBJECT_NOT_FOUND", errTokens);
    } else
    vo.executeQuery();
    System.out.println("Execute Query");
    Thanks
    Nilesh

  • Finding minimum value in each row using dynamic query

    need to find the minimum and maximum value from each row using dynamic query
    [from curr] will be given as input
    Tuky

    DECLARE @t TABLE(a INT,b INT,c INT);
    INSERT @t VALUES(1,2,3),(9,8,7),(4,6,5);
    SELECT *
    ,      (   SELECT  MAX(val) 
               FROM    (VALUES (a)
                           ,   (b)
                           ,   (c)
                       ) AS value(val)
           ) AS MaxVal 
    ,      (   SELECT  MIN(val) 
               FROM    (VALUES (a)
                           ,   (b)
                           ,   (c)
                       ) AS value(val)
           ) AS MinVal 
    FROM @t;
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Dynamic query in 10g

    i am calling a report from a 10g form. i wanna to pass a dynamic query from form to report. I am able to perform this with 6i but can't using 10g. is there any way to create a dynamic query in reports 10g
    thanks

    Actually, i am creating the whole query upon based on a condition in form, then i am passing this query to report via a data parameter. following is the some part of code, which i am using
    IF :CONTROL.VOUCHER_FORMAT='S' THEN
    V_QUERY:=('select bvno vno,bvdate vdate from bvrm where bvno ='''||:vno||''' AND bvrm.bvdate='''||:VDATE||''' and ccode='''||:PARAMETER.ccode||''' and fycode='''||:PARAMETER.fycode||''' AND BVRM.BVTYPE='''||:VTYPE||''' GROUP by bvdate,bvno');
    else
    V_QUERY:=('select bvno vno,bvdate vdate from bvrm where bvrm.bvdate BETWEEN '''||TO_DATE(:FROMDATE,'DD/MM/YYYY')||''' AND '''||to_date(TO_DATE(:TODATE,'DD/MM/YYYY')+1)||''' and ccode='''||:PARAMETER.ccode||''' and fycode='''||:PARAMETER.fycode||''' AND BVRM.BVTYPE = '''||:VTYPE||''' GROUP by bvdate,bvno');
    end if;
    RG_ID:=CREATE_GROUP_FROM_QUERY(RG_NAME,V_QUERY);
    NUM:=POPULATE_GROUP(RG_NAME);
    ADD_PARAMETER(PL_ID,'Q_MAIN',DATA_PARAMETER,RG_NAME);
    after this code, i am calling the run_report_object normally. this code works fine with 6i, but doesn't with 10g     
    thanks

  • Duplicate records for Dynamic Query in WLS 7

    I am getting duplicate records back when I run a dynamic query. If I run the same
    query via a finder method, I get the correct results.
    Here's the query:
    SELECT DISTINCT OBJECT(a) FROM Company AS a, b IN a.userRole WHERE b.userId = ?1
    AND a.deptId IN ('1', '2', '3')
    Company EJB maps to LU_Company (look up table for company)
    Company to UserRole is a one-to-many relationship.
    The number of duplicates is equal to the number of records I have for the same company_id
    in User_Role table.
    The ids for the object I should get back are 1, 2, 3.
    Instead I get back 1, 1, 2, 2, 2, 2, 2, 3, 3, 3
    In the database, company_id 1 occurs twice in user_role table; company_id 2 occurs
    five times.
    Any ideas of why the dynamic query has this problem whereas the same query for a
    finder method works fine?
    Thanks for your help.

    Thanks Greg, that worked!
    "Greg Nyberg" <greg.nyberg.at.objectpartners.com> wrote:
    You can supply properties on the query request, perhaps there is a
    SQL_SELECT_DISTINCT property:
    Properties p = new Properties();
    p.setProperty("GROUP_NAME", "fieldgroup");
    p.setProperty("INCLUDE_UPDATES", "true");
    p.setProperty("SQL_SELECT_DISTINCT", "true");
    Collection people = myQuery.find(
    "SELECT OBJECT(o) FROM PersonCMPEJB o WHERE o.lastName = 'Smith'", p);
    -Greg
    Check out my WebLogic 6.1 Workbook for O'Reilly EJB Third Edition
    www.amazon.com/exec/obidos/ASIN/1931822468 or www.titan-books.com
    "Mike" <[email protected]> wrote in message
    news:[email protected]...
    Matt,
    <sql-select-distinct> needs to be set in <weblogic-query> element. I amgenerating
    a dynamic query from within a local client. So I don't have a finderdefined for
    this method. (I don't want to define a finder for this method). How doyou suggest
    I can use this? Thanks again for your help.
    Matthew Shinn <[email protected]> wrote:
    Hi Mike,
    I just filed a bug report for this (CR079471). As a work around, you
    can
    use the
    setSQLSelectDistinct flag so the database will weed out the duplicates.
    The only thing to
    look out for when using this flag is that Oracle will not allow the use
    of 'SELECT DISTINCT'
    in conjunction with a 'FOR UPDATE' clause, thus,<sql-select-distinct>True
    CANNOT be used if
    any Bean in the calling chain has a method with <transaction-isolation>
    set to
    <isolation-level>TRANSACTION_READ_COMMITTED_FOR_UPDATE. Sorry for theinconvenience.
    - Matt
    Mike wrote:
    I am getting duplicate records back when I run a dynamic query. If
    I
    run
    the same
    query via a finder method, I get the correct results.
    Here's the query:
    SELECT DISTINCT OBJECT(a) FROM Company AS a, b IN a.userRole WHERE
    b.userId
    = ?1
    AND a.deptId IN ('1', '2', '3')
    Company EJB maps to LU_Company (look up table for company)
    Company to UserRole is a one-to-many relationship.
    The number of duplicates is equal to the number of records I have forthe same company_id
    in User_Role table.
    The ids for the object I should get back are 1, 2, 3.
    Instead I get back 1, 1, 2, 2, 2, 2, 2, 3, 3, 3
    In the database, company_id 1 occurs twice in user_role table;
    company_id
    2 occurs
    five times.
    Any ideas of why the dynamic query has this problem whereas the same
    query
    for a
    finder method works fine?
    Thanks for your help.

  • How to open a file (*.html,*.pdf) in new browser using servlet

    Dear Friends,
    I am having some files (*.html,*.pdf) in local drive , im getting the path whichy includes dir name + file dynamically, im using the following code
    response.sendRedirect(response.encodeRedirectURL(file))
    this is displaying the file in same window, now i want open in new window is there any method except java script like window.open("URL");
    Thanks in advance....
    Thangavel

    Hi Balu !
    Thanks for u r reply ,
    this is html code ok
    <a onclick="view()" >View </a>
    im callinig view function in java script
    function view()
    window.document.formname.submit()
    so it will submit the action URL which given in form ok
    filename contains full path ok
    in server side im sending as i told previously encoderURL(file) ok
    but im given target="_blank" as per ur suggestion in anger tag like
    <a target="_balnk" onclick="view()" >View </a> tag
    it is opening in new window the content which is displaying in jsp but not file
    pls give ur valueable suggestion .....
    Thanks in advance...
    Thangavel

  • Viewing xsql files through browser

    Hi all,
    a basic question regarding creating xsql files using jDeveloper...
    Once created if I hit run, a Netscape browser pops up, accessing ...myhtml/WebAppRunner.html
    this in turn pops up a new Internet explorer browser with the results of the database query as a temp xml file.
    My question is that if I access the <file>.xsql through either browser directly (not using run in jdev) then I just get the textual contents of the file, I thought the database query would be automatically run and only the results shown?
    I want to do simple queries, and be able to enter the filename (and ?paramters) in to the location bar within the browser but currently this doesnt seem to work. Do I have to change any properties or plug-ins for the browser?
    All info gratefully received, regards from an Oracle developer having his first look at this funky xml-world!
    Julian

    The query executes when you "run" the XSQL page through a Web server (JDeveloper includes a simple one-person Web server for development and testing) that invokes the underlying Java code. When you access the same XSQL page through the file system, the code doesn't execute, and, as you have seen, the browser displays the contents of the file.
    To do the kind of testing you describe, you need a Web server, for example, the Web-to-Go server that comes with the XSQL Servlet, or Apache (it's free). OTN has some sample apps that show how to do this. See
    [list][*]WebStore B2B Exchange
    [*]XML Flight Finder[list]
    for more information.
    Regards,
    -rh
    null

  • How to retrieve elements from 3 different xml file in one url

    Hi all,
    Could anyone please let me how can we retrieve elements from 3 different xml file in one url?
    i just can only do it with one file only, any help would very appreciate.
    Thank in advance
    Jim

    Hi Philip
    Thanks for replying me.
    I tried on that way, In my mdx query i am using one slice attribute (i.e [Customer].[Gender].allmembers) in rows so getting error "The  Hierarchy already appears in Axis1".
    SELECT
    {[Measures].[Internet Sales Amount] } ON 0,
    NON EMPTY
    {[Customer].[Gender].allmembers } ON 1 -- Used
    FROM
    [Adventure Works]
    WHERE
    [Customer].[Gender].&[M]
    ,[Product].[Size Range].[(All)]
    ,[Customer].[Country].[All Customers]
    [Customer].[Gender].[All Customers]
    ,[Product].[Size Range].&[XL]
    ,[Customer].[Country].[All Customers]
    [Customer].[Gender].[All Customers]
    ,[Product].[Size Range].[(All)]
    ,[Customer].[Country].&[Australia]
    Can you provide alternate ways to get resolved.
    Thanks in advance

  • Error when trying to run a procedure from the .xsql file

    Here is the error message pasted below.
    - <test>
    - <xsql-error action="xsql:include-owa">
    <statement>declare buf htp.htbuf_arr; param_names owa.vc_arr; param_values owa.vc_arr; rows integer := 32767; outclob CLOB;begin param_names(1) := 'HTTP_COOKIE'; param_values(1) := ''; param_names(2) := 'SERVER_NAME'; param_values(2) := 'shanthi.ijs.com'; param_names(3) := 'SERVER_PORT'; param_values(3) := '8080'; param_names(4) := 'SCRIPT_NAME'; param_values(4) := '/xsql/test/myex.xsql'; param_names(5) := 'PATH_INFO'; param_values(5) := ''; param_names(6) := 'HTTP_USER_AGENT'; param_values(6) := 'Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)'; owa.init_cgi_env(6,param_names,param_values); scott.get_date; owa.get_page(buf,rows); dbms_lob.createtemporary(outclob,true,dbms_lob.session); for i in 1..rows loop dbms_lob.writeappend(outclob,length(buf(i)),buf(i)); end loop; ? := outclob; ? := DBMS_LOB.INSTR(outclob,CHR(10)&#0124; &#0124;CHR(10));end;</statement>
    <message>ORA-06550: line 3, column 75: PLS-00302: component 'SESSION' must be declared ORA-06550: line 3, column 28: PL/SQL: Statement ignored ORA-06550: line 3, column 120: PLS-00302: component 'WRITEAPPEND' must be declared ORA-06550: line 3, column 111: PL/SQL: Statement ignored</message>
    </xsql-error>
    <xsql-error action="xsql:include-owa" />
    </test>
    My .xsql file is:
    <test connection="system" xmlns:xsql="urn:oracle-xsql">
    <xsql:include-owa>
    scott.get_date;
    </xsql:include-owa>
    </test>
    Any help in this regard is greatly appreciated.
    Shanthi
    null

    I tried this way:
    <?xml version="1.0"?>
    <datapage connection="system" xmlns:xsql="urn:oracle-xsql">
    <xsql:dml>
    begin
    get_rec;
    end;
    </xsql:dml>
    </datapage>
    Here it doesn't give any error, Why is it that it works here but not with <xsql:include-owa>, ofcourse I need to get a proper output from the procedure yet. Looks like the procedure doesn't support "out" variable, should I specifically use a function ?
    Anyhelp will be appreciated.
    Shanthi

  • How to populate target directory from the source XML in Receiver File Adap?

    Hi All,
    Our scenario is IDoc - XI -(Receiver File adapter) File. Is it possible to populate complete "Target Directory" from the source XML message??
    Lets say we added field to maintain target directory in Idoc structure and some how populated value to it, then grab this target directory from the IDoc-XML and pass in Comunication Channel. I think its possible through Variable Substitation ...just want to make sure and if sombody has done the similar scenario their inputs would be great.
    Thanx
    Navin

    Hi,
    Please see the belowlinks
    /people/jayakrishnan.nair/blog/2005/06/28/dynamic-file-namexslt-mapping-with-java-enhancement-using-xi-30-sp12-part-ii
    /people/sriram.vasudevan3/blog/2005/11/21/effective-xsl-for-multimapping-getting-source-filenames-in-legacy-legacy-scenarios
    Re: Dynamic  File Name for Receiver File Adapter
    Variable Substitution
    http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
    try with adapter specific
    Example code...
    String newfilename="";
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    // Get Sourcefilename
    String oldfilename=conf.get(key);
    //extract first 3 chars of source filename
    newfilename=oldfilename.substring(0,2);
    //get the date
    java.text.SimpleDateFormat dateformat = new java.text.SimpleDateFormat( "yyyyMMdd" );
    dateformat.format( new java.util.Date() );
    //append sourcedateL
    newfilename=newfilenamedateformat"L";
    // determine if prod/ dev / qa
    map = container.getTransformationParameters();
    senderService = (String) map.get("SenderService");
    if(senderServcie.equald("Prod"){
    newfilename=newfilename+"P";
    // change to new file name
    conf.put(key, newfilename+".tmp");
    Change it according to your requirement
    Regards
    Chilla..

  • Run BW query from R/3, need output file saved on application server

    Hello all,
    We are currently working on BI 7.0. Is there a way where we can run a BW query from R/3 by some program or tcode? We need to run the BW query and use the output of that query as an input to some other custom program in R/3.
    If we can save the output file on application server than the R/3 program will pick up that file from there.
    Is there any standard delivered functionality that will allow us to do that or how can we achieve this.
    Can some help help with some suggestions or links?
    Thanks in advance.

    Hi,
       Refer the following threads:
    [Calling BW Query from R/3;
    [Saving Bex Report / query in BW App server;
    Regards.

Maybe you are looking for

  • How can I highlight with a PDF file?

    How can I highlight text in a PDF file?

  • Disabled foreground color in JComboBox

    what's the correct way to set the disabled foreground color of a jcombobox? i don't want to set the disabled color for the entire ui to the same color, but for one jcombobox specifically. i searched the web and found many posts with the same question

  • [CS5] Project Manager Trimming not supported for HDV footage?

    Yes, I have the licensed version of CS5 Production Premium. The Premiere Pro "Project Manager" allows you to create a "trimmed" version of your project. That is, only the footage actually used in sequences (along with some handles) is placed in the n

  • Merging  OBIEE server and OBIEE presenation services????

    I had installed OBIEE presentation services(SAW) in one server (Linux - 1) and OBIEE server(SAS) in another Server(Linux- 2). Now i want to install or merge OBIEE server(SAS) in Linux-1 without disturbing the configuration settings of OBIEE presentat

  • Using fonts with pictures on Aperture

    Hi, I'm a new user of Aperture and have been trying to figure out how to put words on a picture i have been editing there. I'm sure it's quite easy i'm just not seeing it. Thanks a lot! Bryn