Applet sends SQL and servlet queries and returns results to applet

So, this is what my problem is. I've tried several different ways on this so my code probably don't work at all.
Could someone post me an example on how to send the sql query from the Applet and how to pick up the data from the servlet.
Thank you,
Derek Lung

I suggest you to use:
* one JavaBean that handles db connections and queries;
* a Servlet that uses the JavaBean and receives a String that rappresents the query from the Applet: such String will be passed to JavaBean in order to execute the query and retrieve the data from db;
* the Applet that uses the Servlet to retrieve the results (you can store them in a structure that MUST be serializable.
Let me know if you find problems in costructing such architecture!
-- Ivan

Similar Messages

  • Is it possible to run Go URL SQL and return raw data using Java?

    Hi All,
    I just got GO URL SQL working in HTML, when i type the following URL on to the address bar.
    https://odsau.oraclecorp.com/analytics/saw.dll?Go&SQL=select+"MFG Serial Number"."Job Name","MFG Serial Number".Item+from+"Supply Chain Management"
    It prints out a table with all the data that query from the database in a HTML page. However, I want to be able to manipulate these data in a JAVA script.
    Is there a similar function i can use in Java script and return raw data so i can store them into a variable for data manipulation?
    Or is there a work around that someone has already done ?
    Thanks
    John Lau

    You can excute SQL statemetns throught JDBC, but that doesn't have a facility to read those statements from a file. You'd have to write code to read the file and create and execute statements through JDBC. That should be pretty straightforward though.
    It's conceivable that there's a third party library out there that does it, if you know what to look for.
    If you're not familiar with JDBC, check out http://java.sun.com/developer/onlineTraining/Database/JDBC20Intro/

  • Thread to search a web page and return results

    Hi, I am writing a program where the user will key in an ISBN, after the user inputs the number I want to create a thread to query a website like amazon and return the title of the book and name of the author. Any suggestions on how to accomplish this in Java? Are there any libraries available to do something like this
    Thanks

    I would suggest you start by seeing what APIs Google and/or Amazon have to offer you. Accessing web content from a program is in many cases, against the terms of service for the site. But many popular sites have special feeds or API resources to let you access content like this.
    Then at some point you'll be wanting to go through the [_Custom Networking Tutorial_|http://java.sun.com/docs/books/tutorial/networking/index.html]

  • Store procedure which get list of values separated by semicolon and return result set as a string semicolon separated strin

    Hello,
    I am trying to make stored procedure in what i am getting i_group_id  as a list of groups seprated by semicoln like 1,2,14,17,23.
    And i want list of emails based on that group. And result set will be as a list of emails seprated by semicolon.
    Can anybody please help me for that. Thanks in advance.
    PROCEDURE get_groups_email(i_group_id    IN VARCHAR2,
                               x_group_email_dtl_cur OUT resultcur)
    IS
    x_group_email VARCHAR2(4000):=NULL;
    BEGIN                            
       FOR i IN (SELECT   TRIM(emp.email) email
                   FROM   ems.employee emp,
                          ems.groups_employee egrp
                  WHERE   egrp.group_id IN (i_group_id)
                    AND   emp.person_id = egrp.person_id) LOOP
        x_group_email:= x_group_email || i.email ||';';
      END LOOP;
      x_group_email := RTRIM(x_group_email,';');
       OPEN x_group_email_dtl_cur FOR  
         SELECT   x_group_email
           FROM   DUAL;  
    DBMS_OUTPUT.PUT_LINE('x_group_email:' || x_group_email);                                        
    END get_groups_email;
    PROCEDURE get_groups_email(i_group_id    IN VARCHAR2,
                               x_group_email_dtl_cur OUT resultcur)
    IS
    x_group_email VARCHAR2(4000):=NULL;
    BEGIN                            
       FOR i IN (SELECT   TRIM(emp.email) email
                   FROM   ems.employee emp,
                          ems.groups_employee egrp
                  WHERE   egrp.group_id IN (i_group_id)
                    AND   emp.person_id = egrp.person_id) LOOP
        x_group_email:= x_group_email || i.email ||';';
      END LOOP;
      x_group_email := RTRIM(x_group_email,';');
       OPEN x_group_email_dtl_cur FOR  
         SELECT   x_group_email
           FROM   DUAL;  
    DBMS_OUTPUT.PUT_LINE('x_group_email:' || x_group_email);                                        
    END get_groups_email;

    >
    Can anybody please help me for that
    >
    Not in this forum they can't. This forum, as the title says, is for SQL Developer questions only.
    Please mark this question ANSWERED and repost it in the SQL and PL/SQL forum
    https://forums.oracle.com/community/developer/english/oracle_database/sql_and_pl_sql

  • Executing Java CGI Program and Returning Result to Browser

    Hi all, I'm an experienced ASP/PHP/JS programmer but completely new to Java. I'm building a site where I need to execute the same piece of code in every language I can manage, and I'm onto Java. For the purpose of illustration, my goal is to replicate the following PHP code as Java code:
    <?php echo($_GET['message']); ?>I've written and compiled a "Hello World!" application and uploaded it to my server (Dreamhost shared hosting, Linux platform with JDK installed). Using this line form telnet, the application prints "Hello World!" to the screen:
    java -classpath . helloworld.classSo, following a very old tutorial I found online, I created a CGI script and CHMOD'd it to 755 containing the following:
    #!/usr/sh /usr/bin/java -classpath . regex.classBut this returns a 500 "Internal server error". After a few unsuccessful alterations I tried to emulate the CGI script in PHP like so:
    <?php exec('java -classpath . regex', $output); echo(join($output, '<br />')); ?>But all I get back from that is "Error occurred during initialization of VM. Could not reserve enough space for code cache".
    Any advice would be very much appreciated. I can learn the Java language - there's plenty of resources available for that, but I'm struggling to get started because I can't get the application to run as CGI.
    Many Thanks,
    -William

    wwarby wrote:
    Hi, and thanks for the responses.
    paulcw, my ultimate goal is obviously a little more ambitious than printing "Hello World!" to the browser but for simplicity's sake I thought I'd start there. I tried this in a .cgi file:
    #!/bin/sh
    /usr/local/dh/java -version...and I still get a 500 internal server error. I have uploaded the script in ASCII mode and CHMOD'd it to 755, and checked with my host that I have the Java path correct (I've also tried just "java" and "/usr/bin/java" which do the same thing).Well that's because you're confusing running Java generally vs running it as a CGI vs running ANYTHING as a CGI. The web server expects CGI scripts to send certain content to standard output, and in a certain format. Generally speaking it's headers, then a blank line, then other content.
    Furthermore, I think you might be confusing executing arbitrary code from PHP vs executing a CGI script. I'm not familiar with PHP but the way you called exec suggests to me that it can run arbitrary code and doesn't expect the output to necessarily be in CGI format.
    You've got to do things one step at a time here.
    spoon_, the #!/usr/sh" thing was a mistake on the forum post - in the script it is "#!/bin/sh" and it is on a line of it's own. The full .cgi file is now:
    {code}#!/bin/sh
    /usr/local/dh/java -classpath . hello{code}
    And the .java file is now:
    {code}class hello {
         public static void main(String args[]) {
              System.out.println("Content-type: text/html");
              System.out.println();
              System.out.println("Hello World!");
    }{code}
    as per your instructions. I compliled it on the server using javac, and when I run:
    {code}java -classpath . hello{code}
    in telnet, it returns:
    {code}Content-type: text/html
    Hello World!{code}
    to the telnet window. Unfortunately when run from the CGI script I still get the 500 Internal server error.Have you checked your web server logs?
    I'm going to guess here that your web server doesn't have permission to run the JVM executable.
    That's an interesting path: "/usr/local/dh". What does "dh" stand for?
    My server definitely supports Java (version 1.5.0_02) and CGI - it says so on their Wiki and specifically mentions Java as one of the languages that CGI scripts can use. What am I doing wrong?
    Edited by: wwarby on Dec 25, 2007 1:30 AMCheck your web server logs. There should be both an access log and an errors log. The errors log will probably contain more information.

  • Procedure to take inpot data set and return result set

    Hi all,
    I have a situation where there will be one "standard" set of data (source_data below) and I will need to get information on results for certain groups of clients (client_data being an example). As straight SQL this would be very easy (see below) -- real world problem is a little more complicated. However, what I would like to do is set up a procedure so that I can pass it my variable client data and it will spit back out a data set the same as the output from the given SQL.
    A pointer in the right direction would be appreciated. If I could "pass the client data" as a string containing a SQL query, that would be even better, e.g.
    GetResults('select client_id,min(whatever_date) from some_client_data where .....',MyOutputRefCursor?)
    create table source_data
    (client_id integer,
    tdate date,
    amount number(6,2));
    create table client_data
    (client_id integer,
    critical_date date);
    insert into source_data values(1,to_date('20090104','yyyymmdd'),1000);
    insert into source_data values(1,to_date('20100104','yyyymmdd'),2000);
    insert into source_data values(1,to_date('20110104','yyyymmdd'),3000);
    insert into source_data values(1,to_date('20120104','yyyymmdd'),4000);
    insert into source_data values(2,to_date('20090104','yyyymmdd'),5000);
    insert into source_data values(2,to_date('20090604','yyyymmdd'),1000);
    insert into source_data values(2,to_date('20100104','yyyymmdd'),2000);
    insert into source_data values(3,to_date('20091004','yyyymmdd'),3000);
    insert into source_data values(3,to_date('20091104','yyyymmdd'),4000);
    insert into source_data values(4,to_date('20090104','yyyymmdd'),5000);
    insert into source_data values(4,to_date('20090604','yyyymmdd'),2000);
    insert into client_data values(1,to_date('20110104','yyyymmdd'));
    insert into client_data values(2,to_date('20090604','yyyymmdd'));
    select c.client_id,
      sum(CASE WHEN tdate < critical_date then amount else null end) used_before,
      sum(CASE WHEN tdate >= critical_date then amount else null end) used_after
    from source_data s
    inner join client_data c on s.client_id = c.client_id
    GROUP BY c.client_id;Thanks,
    Jon

    JonWat wrote:
    I have a situation where there will be one "standard" set of data (source_data below) and I will need to get information on results for certain groups of clients > (client_data being an example). As straight SQL this would be very easy (see below) -- real world problem is a little more complicated. Can you give a more accurate representation of the real world problem?
    A pointer in the right direction would be appreciated. If I could "pass the client data" as a string containing a SQL query, that would be even better, e.g.Passing a query as as string for execution is rarely the correct approach. This approach won't scale and most likely will result in maintenance and security problems.
    If you can update your post to have a more accurate representation of the problem you are trying to solve you'll probably get an acceptable answer. Other than that all I can suggest is that you need to rethink the approach a bit. For example, if you know you need to filter out a set of data to join to your SOURCE_DATA table, why couldn't you do that inside the procedure?
    SELECT c.client_id
         , SUM
           ( CASE
             WHEN tdate < critical_date
             THEN amount
             END
           ) AS used_before
        ,  SUM
           ( CASE
             WHEN tdate >= critical_date
             THEN amount
             END
           ) AS used_after
    FROM   source_data s
    JOIN   ( SELECT client_id
                  , MIN(<date column>) AS critical_date
             FROM   client_data
             WHERE  <where clause>
             GROUP BY client_id
           ) c on s.client_id = c.client_id
    GROUP BY c.client_id;

  • Dequeue Business event (AQ or AppsAdapter) in OSB and return results fails

    I am new to OSB. The scenario is to publish out the results to SFDC (SalesForce.Com) any changes in EBS.
    The Dequeueing works well within OSB. However when I am trying to return the results back.. It is failing. Is it because Dequeueing wsdl has only an input structure
    and does not have an output structure?

    I get the following error message
    BEA-382040: Failed to set the value of context variable "body". Value must be an instance of {http://schemas.xmlsoap.org/soap/envelope/}Body. So basically the input definition of the Event is
      <soapenv:Envelope   xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Header   xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    </soap:Header>
    <soapenv:Body>
    <even:WF_EVENT_T   xmlns:even="http://xmlns.oracle.com/xdb/APPS/EventListener">
    <!--Optional:-->
    <PRIORITY>1.051732E7</PRIORITY>
    <!--Optional:-->
    <SEND_DATE>string</SEND_DATE>
    <!--Optional:-->
    <RECEIVE_DATE>string</RECEIVE_DATE>
    <!--Optional:-->
    <CORRELATION_ID>string</CORRELATION_ID>
    <!--Optional:-->
    <PARAMETER_LIST>
    <!--Zero or more repetitions:-->
    <PARAMETER_LIST_ITEM>
    <!--Optional:-->
    <NAME>string</NAME>
    <!--Optional:-->
    <VALUE>string</VALUE>
    </PARAMETER_LIST_ITEM>
    </PARAMETER_LIST>
    <!--Optional:-->
    <EVENT_NAME>string</EVENT_NAME>
    <!--Optional:-->
    <EVENT_KEY>string</EVENT_KEY>
    <!--Optional:-->
    <EVENT_DATA>string</EVENT_DATA>
    <!--Optional:-->
    <FROM_AGENT>
    <!--Optional:-->
    <NAME>string</NAME>
    <!--Optional:-->
    <SYSTEM>string</SYSTEM>
    </FROM_AGENT>
    <!--Optional:-->
    <TO_AGENT>
    <!--Optional:-->
    <NAME>string</NAME>
    <!--Optional:-->
    <SYSTEM>string</SYSTEM>
    </TO_AGENT>
    <!--Optional:-->
    <ERROR_SUBSCRIPTION>ZQ==</ERROR_SUBSCRIPTION>
    <!--Optional:-->
    <ERROR_MESSAGE>string</ERROR_MESSAGE>
    <!--Optional:-->
    <ERROR_STACK>string</ERROR_STACK>
    </even:WF_EVENT_T>
    </soapenv:Body>
    </soapenv:Envelope>
    and then I replace the body with
    <soapenv:Envelope  xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Header  xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    </soap:Header>
    <soapenv:Body>
    <get:GetSystemDateInput  xmlns:get="http://xmlns.oracle.com/pcbpel/adapter/db/GetSystemDate"/>
    </soapenv:Body>
    </soapenv:Envelope>
    before the call to the business service GetSystemDate and then I get this error
      <soapenv:Envelope   xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Body>
    <soapenv:Fault>
    <faultcode>soapenv:Server</faultcode>
    <faultstring>
    BEA-382040: Failed to set the value of context variable "body". Value must be an instance of {http://schemas.xmlsoap.org/soap/envelope/}Body.
    </faultstring>
    <detail>
    <con:fault   xmlns:con="http://www.bea.com/wli/sb/context">
    <con:errorCode>BEA-382040</con:errorCode>
    <con:reason>
    Failed to set the value of context variable "body". Value must be an instance of {http://schemas.xmlsoap.org/soap/envelope/}Body.
    </con:reason>
    <con:location>
    <con:node>PipelinePairNode1</con:node>
    <con:pipeline>PipelinePairNode1_request</con:pipeline>
    <con:stage>stage1</con:stage>
    <con:path>request-pipeline</con:path>
    </con:location>
    </con:fault>
    </detail>
    </soapenv:Fault>
    </soapenv:Body>
    </soapenv:Envelope>

  • How to run SQL and export results to Excel

    My task is to run a custom SQL script and create Excel file via running SQL Developer from command line (invoked by a scheduled script). Is this possible using SQL Developer?
    The thing I'm trying first is to run a user-defined report in SQL Developer and save the results to an Excel file. Only 16000 result rows, but took 10 minutes to do the export and still cannot finish. Is there another way to do it?
    Many thanks.

    Thanks K for the update.
    I have done csv files before using pl/sql, no problem at all. It's just that in current work environment, we're using a 3rd party tool to make the Excels and I was asked to study the feasibility of using SQL Developer instead of our current commercial tool to do the job.

  • Store procedure which get list of values separated by semicolon and return result set as a string semicolon separated string

    Hello,
    I am trying to make stored procedure in what i am getting i_group_id  as a list of groups seprated by semicoln like 1,2,14,17,23.
    And i want list of emails based on that group. And result set will be as a list of emails seprated by semicolon.
    If you know how to install that in stored procedure please help me. Appreciate your help.
    Thanks.
    PROCEDURE get_groups_email(i_group_id    IN VARCHAR2,
                               x_group_email_dtl_cur OUT resultcur)
    IS
    x_group_email VARCHAR2(4000):=NULL;
    BEGIN                           
       FOR i IN (SELECT   TRIM(emp.email) email
                   FROM   ems.employee emp,
                          ems.groups_employee egrp
                  WHERE   egrp.group_id IN (i_group_id)
                    AND   emp.person_id = egrp.person_id) LOOP
        x_group_email:= x_group_email || i.email ||';';
      END LOOP;
      x_group_email := RTRIM(x_group_email,';');
       OPEN x_group_email_dtl_cur FOR 
         SELECT   x_group_email
           FROM   DUAL; 
    DBMS_OUTPUT.PUT_LINE('x_group_email:' || x_group_email);                                       
    END get_groups_email;
    PROCEDURE get_groups_email(i_group_id    IN VARCHAR2,
                               x_group_email_dtl_cur OUT resultcur)
    IS
    x_group_email VARCHAR2(4000):=NULL;
    BEGIN                           
       FOR i IN (SELECT   TRIM(emp.email) email
                   FROM   ems.employee emp,
                          ems.groups_employee egrp
                  WHERE   egrp.group_id IN (i_group_id)
                    AND   emp.person_id = egrp.person_id) LOOP
        x_group_email:= x_group_email || i.email ||';';
      END LOOP;
      x_group_email := RTRIM(x_group_email,';');
       OPEN x_group_email_dtl_cur FOR 
         SELECT   x_group_email
           FROM   DUAL; 
    DBMS_OUTPUT.PUT_LINE('x_group_email:' || x_group_email);                                       
    END get_groups_email;

    1013527 wrote:
    I am using Oracle 9.7.2. Not 11g.
    No Database at hand to provide a working example.
    So use http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:73830657104020 to split your list into rows.
    Join that to your table of e-mail addresses
    then take a look at http://www.sqlsnippets.com/en/topic-11787.html maybe chosing http://www.sqlsnippets.com/en/topic-12087.html
    and you're done.
    Regards
    Etbin
    something to play with (still NOT TESTED!)
    with
    e_mails as
    (select 1 user_id,'alpha' || chr(64) || 'domain.eu' e_mail from dual union all
    select 2,'beta' || chr(64) || 'domain.eu' from dual union all
    select 3,'gamma' || chr(64) || 'domain.eu' from dual union all
    select 4,'delta' || chr(64) || 'domain.eu' from dual union all
    select 5,'epsilon' || chr(64) || 'domain.eu' from dual union all
    select 6,'zeta' || chr(64) || 'domain.eu' from dual union all
    select 7,'eta' || chr(64) || 'domain.eu' from dual union all
    select 8,'theta' || chr(64) || 'domain.eu' from dual union all
    select 9,'iota' || chr(64) || 'domain.eu' from dual union all
    select 10,'kappa' || chr(64) || 'domain.eu' from dual union all
    select 11,'lambda' || chr(64) || 'domain.eu' from dual union all
    select 12,'mu' || chr(64) || 'domain.eu' from dual union all
    select 13,'nu' || chr(64) || 'domain.eu' from dual union all
    select 14,'xi' || chr(64) || 'domain.eu' from dual union all
    select 15,'omicron' || chr(64) || 'domain.eu' from dual union all
    select 16,'pi' || chr(64) || 'domain.eu' from dual union all
    select 17,'rho' || chr(64) || 'domain.eu' from dual union all
    select 18,'sigma' || chr(64) || 'domain.eu' from dual union all
    select 19,'tau' || chr(64) || 'domain.eu' from dual union all
    select 20,'upsilon' || chr(64) || 'domain.eu' from dual union all
    select 21,'phi' || chr(64) || 'domain.eu' from dual union all
    select 22,'chi' || chr(64) || 'domain.eu' from dual union all
    select 23,'psi' || chr(64) || 'domain.eu' from dual union all
    select 24,'omega' || chr(64) || 'domain.eu' from dual
    groups as
    (select 1 g_id,'1,15,21,17' members from dual union all
    select 2,'23,10,3,20,7,23,15,9' from dual union all
    select 3,'3,4,5,6,7,8' from dual union all
    select 4,'23,24,15,16,7,18' from dual
    select g_id,
           substr(sys_connect_by_path(e_mail,';'),2) e_mail_list
      from (select g.g_id,
                   e.e_mail,
                   row_number() over (partition by g.g_id order by e.user_id) rn
              from e_mails e,
                   groups g
             where instr(','||g.members||',',','||to_char(e.user_id)||',') > 0
               and instr(','||:group_list||',',','||to_char(g.g_id)||',') > 0
    where connect_by_isleaf = 1
    start with rn = 1
    connect by rn = prior rn + 1
            and g_id = prior g_id
    Message was edited by: Etbin provided a small example

  • Query database and return result set to cells.

    hello all i have vsto solution im building im trying to put together a generic query text box for my end user the only problem is that it appears to be that with oracle data access when you do a query you must pass all the values to a variable.
    Sub Orcl()
            Dim oradb As String = "Data Source=(DESCRIPTION=(ADDRESS_LIST=" _
                       + "(ADDRESS=(PROTOCOL=TCP)(HOST=xxx)(PORT=1521)))" _
                       + "(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=xxx)));" _
                       + "User Id=xx;Password=xx;"
             Dim conn As New Oracle.DataAccess.Client.OracleConnection(oradb) ' Visual Basic
            conn.Open()
            Query = select * from fabinvh
            Dim cmd As New Oracle.DataAccess.Client.OracleCommand
            cmd = conn.CreateCommand()
            cmd.Connection = conn
            cmd.CommandText = Query
            Dim dr As Oracle.DataAccess.Client.OracleDataReader = cmd.ExecuteReader()
            While dr.Read()
                Globals.ThisAddIn.Application.ActiveCell.Value = (dr.Item(1))''' HOW DO I CHANGE HERE TO JUST BRING IN ALL THE COLUMNS AND HEADERS?
                Globals.ThisAddIn.Application.ActiveCell.Offset(1, 0).Select()
            End While
            dr.Dispose()
            cmd.Dispose()
            conn.Dispose()
        End Subthanks in advance im able to do this with oo4o rather easily but I'm tryint go learn more of the odp.net oracle data access and learning is pretty slow right now.

    ok I think im getting closer to my answer i believe i need to use the
    GetValues. property. does anyone have an example on how to use this i keep getting errors when i try it.

  • Dynamic SQL and Data with Single Quotes in it.

    Hi There,
    I have a problem in that I am using dynamic SQL and it happens that one of the columns does contain single quotes (') in it as part of the data. This causes the resultant dynamic SQL to get confused as the single quote that is part of the data is taken to mean end of sting, when in fact its part of the data. This leaves out a dangling single quote that was meant to enclose the string. Here is my dynamic SQL and the result of the parsed SQL that I have captured:
    ****Dynamic SQL*****
    l_sql:='select NOTE_TEMPLATE_ID '||
    'FROM TMP_NOTE_TEMPLATE_VALUES '||
    'where TRIM(LEGACY_NOTE_CODE)='''||trim(fp_note_code)||''' '||
    'and TRIM(DISPLAY_VALUE)='''||trim(fp_note_text)||''' ';
    execute immediate l_sql INTO l_note_template_id;
    Because the column DISPLAY_VALUE contains data with single quotes, the resultant SQL is:
    ******PARSED SQL************
    select NOTE_TEMPLATE_ID
    FROM TMP_NOTE_TEMPLATE_VALUES
    where TRIM(LEGACY_NOTE_CODE)='INQ' and TRIM(DISPLAY_VALUE)='Cont'd'
    And the problem lies with the single quote between teh characters t and d in the data field for DISPLAY_ITEM. How can I handle this?
    Many thanks,

    I have been reliably informed that if one doesn't enclose char/varchar2 data items in quotes, the right indices may not be usedI am into oracle for past 4 years and for the first time i am hearing this.
    Your reliable source is just wrong. Bind variables are variables that store your value and which are used in SQL. They are the proper way to use values in your SQL. By default all variables in PL/SQL is bind variable.
    When you can do some thing in just straight SQL just do it. Dynamic SQL does not make any sense to me here.
    Thanks,
    Karthick.

  • JDeveloper and PL/SQL queries which return XML

    Hi,
    I need to deploy WS with JDeveloper. I have an Oracle9i database which I query with PL/SQL. How can I return XML from my PL/SQL queries? I know I can use SQLX to return XML datatypes, but JDeveloper doesn't seem to be compatible. There is also XSQL, but I don't think JDeveloper allows you to publish this as a web service.
    Any help would be greatly appreciated!!! Thanks!!!!

    The following function should work for what you are trying to do.
    htp.p(htf.escape_sc(:P1_ITEM));To escape columns from the database just include it in your select statement:
    SELECT htf.escape_sc(COLUMN_NAME) alias
      FROM TABLETo escape items on your apex page:
    INSERT INTO table
               (COLUMN_NAME)
         VALUES(htf.escape_sc(:P1_ITEM))Good Luck,
    Tyson
    Edited by: Tyson Jouglet on Nov 25, 2008 4:12 PM

  • How can I create an csv/excel file using pl/sql and then sending that file

    How can I create an csv/excel file using pl/sql and then sending that file to a clients site using pl/sql?
    I know how to create the csv/excel file but I can't figure out how I would get it to the clients site.

    968776 wrote:
    How can I create an csv/excel file using pl/sql and then sending that file to a clients site using pl/sql?
    I know how to create the csv/excel file but I can't figure out how I would get it to the clients site.You are trying to do it at a wrong place..
    Whay do you want database (pl/sql) code to do these things?
    Anyhow, you may be interested in :
    {message:id=9360007}
    {message:id=9984244}

  • Sometimes when I am texting the screen freezes.  I have to go out of messages and return and then I can send.

    Sometimes when I am texting the screen freezes.  I have to go out of messages and return and then I can send.

    Hello mdcrab1,
    Thank you for participating in the Apple Support Communities.
    If your screen freezes sometimes when you're texting until you quit and re-launch Messages, try these troubleshooting steps first:
    Restart your device and check for updates
    Restart your device.
    Check for a carrier settings update.
    Check for an iOS software update.
    You can find these steps and more troubleshooting tips at this link:
    If you can't send or receive messages on your iPhone, iPad, or iPod touch - Apple Support
    If the issue continues, and it only happens in the Messages app, I recommend trying the rest of the steps in the above article.
    If the screen freezes sometimes when you're using other apps, the steps in this article can help:
    If the screen on your iPhone, iPad, or iPod touch doesn't respond to touch - Apple Support
    Sincerely,
    Jeremy

  • T-SQL and CLR types for return value do not match

    Hi I am trying to create a CLR function to call a webservice, the CLR function return data type is double, whether I try
    to create this as a table valued funcion or a scalar to return a distance travelled value I am receiving the error below. I've tried changing data types around in the CLR side and the SQL side but keep receiving the same error message, any help would be appreciated,
    Thank you,
    [Microsoft.SqlServer.Server.SqlFunction(Name = "DistanceCalc")]
    public static Double DistanceCalc(Double SrcLat, Double SrcLong,
    Double DestLat, Double DestLong)
    MileageWS ws = new MileageWS();
    ws.Url = "http://test.isp.ca/Distance.asmx";
    int intUom = 0; // 0 = Mile, 1 = KM
    RouteType RouteMethod = RouteType.Practical;
    Requester RequestedFrom = Requester.LinkRoute;
    Double distance;
    distance = ws.GetDistanceInfoForLonLat(SrcLat, SrcLong, DestLat, DestLong, intUom, RouteMethod, RequestedFrom);
    return distance;
    CREATE FUNCTION DistanceCalc
    @SrcLat as float, @SrcLong as float,
    @DestLat as float, @DestLong as float
    RETURNS TABLE (Distance float)
    External NAME CLRfunctions.RIFunctions.DistanceCalc
    GO
    Error received when try to Create function ...
    1, Level 16, State 2, Procedure pcMiler, Line 6
    CREATE FUNCTION for "pcMiler" failed because T-SQL and CLR types for return value do not match.

    You defined at table-valued CLR function, but I think you meant to define a scalar CLR function. That might be the cause of the error.
    RETURNS TABLE (Distance float)
    should be
    RETURNS (Distance float)

Maybe you are looking for

  • Unable to create Virtual Teams

    Whenever I try to create any new Virtual Teams I get the following error: javax.naming.NameNotFoundException::[LDAP: error code 32 - NDS error: no such entry (-601)] After getting this error if I look in the Teams Organizational Unit it shows the cre

  • About creating pre-filled purchase invoices

    Hello guys, Would you have any idea of how I can create some generic purchase invoices? The point is to have a set of pre-filled direct invoices (no need for GR) with reference, text, VAT, supplier, quantity = 1, accounts and imputation fields alread

  • Sort a Vector

    Hi, I have save the elements of my Node in a Vector and now I want to sort the Elements. A Vector contains 3 fields (Descr, date, FileName). My question is now how is it possible to sort the elements by the value of a Vector like the value of Descr?

  • How to export equations from pdf

    I want to export all the math equations appearing in pdf as png format. Is there any way to get it done?

  • Why is it so difficult to find how to add audio file to a slide

    In the past it was simple to attache audio file to specific item/slide.  Now I can only find information on adding background music.  Searching web solutions require round about processes.