Apex.ajax.clob - retrieving data from a clob field

I have an application that uses a table that stores xml data, and the field in the table that stores the data is a clob. I used Carl Backstrom's example to build what I have so far, (God's blessings on his family). Here is the script I use to store the data from an HTML Editor into the database:
function clob_set(request){
var oEditor = FCKeditorAPI.GetInstance('P59_CONTENT');
var clob_ob = new apex.ajax.clob(
function(){
var rs = p.readyState
if(rs == 1||rs == 2||rs == 3){
$x_Show('AjaxLoading');
}else if(rs == 4){
$x_Hide('AjaxLoading');
$s('P59_CONT', p.responseText);
doSubmit(request)
}else{return false;}
$x('P59_CONT').value = oEditor.GetHTML();
oEditor.SetHTML('');
if(!$v_IsEmpty('P59_CONT')){clob_ob._set($v('P59_CONT'))};
The submit calls a process that inserts the data from the clob001 field in the CLOB_CONTENT collection into my table.
How do I get the data out of the table again to present in the HTML Editor? Each option I use gets me into trouble with the 32k length limitation that is extant in Apex. What would be the best way to address this?

Inserting or retrieving a clob in the database is simple and can be done with a pl/sql process. It gets more more complex when the clob is large; I believe the limit is 32k? Larger than that and the HTTP process cannot manipulate the data stream.
The key to manipulating clobs successfully is through the use of collections, and javascript. In my case, I used the standard html editor item (fckeditor) to retrieve the data and present it on the page through the apex.ajax.clob javascript function. The clob_set method in the apex.ajax.clob function that I mention in the previous sections of this post calls the 'doSubmit(request)' that causes a pl/sql function to be fired that writes the clob to the database from the collection created by the clob_get method. The collection that the clob_get method creates is called 'CLOB_CONTENT', and can be accessed through the 'apex_collections' view through standard sql within APEX. In my case, the pull the 'clob001' field from the 'CLOB_CONTENT' collection after the clob_set method runs, and I insert the value from 'clob001' into the table I have created for storing the clob content. The clob_set pulls the data from the HTML editor (FCKeditorAPI.GetInstance('P59_CONTENT')) through the GetHTML() method that is part of the FCKeditorAPI.
function clob_set(request){
var oEditor = FCKeditorAPI.GetInstance('P59_CONTENT');
var clob_ob = new apex.ajax.clob(
function(){
var rs = p.readyState
if(rs == 1||rs == 2||rs == 3){
$x_Show('AjaxLoading');
}else if(rs == 4){
doSubmit(request);
$x_Hide('AjaxLoading');
}else{return false;}
var p_html = oEditor.GetHTML();
if (p_html){
clob_ob._set(p_html);
else {
p_html = ' '
clob_ob._set(p_html);
The clob_get method pulls the data from the 'CLOB_CONTENT' collection and puts it into the html editor item I have created, performing the process in reverse. The primary difference with reversing the process is that a pl/sql function is created that populates the clob001 field in the 'CLOB_CONTENT' collection prior to the clob_get function firing:
declare
l_clob clob:= empty_clob();
begin
if apex_collection.collection_exists(p_collection_name=>'CLOB_CONTENT') then
apex_collection.delete_collection(p_collection_name=>'CLOB_CONTENT');
end if;
apex_collection.create_or_truncate_collection(p_collection_name=>'CLOB_CONTENT');
dbms_lob.createtemporary( l_clob, false, dbms_lob.SESSION );
if trim(:P123_ID) <> 0 then
select
nvl (ltr,'There is no letter assigned.')
into
l_clob
from grant_tbl
where id = to_number(:P123_ID);
apex_collection.add_member(p_collection_name => 'CLOB_CONTENT'
,p_clob001 => l_clob
ELSE
apex_collection.add_member(p_collection_name => 'CLOB_CONTENT'
,p_clob001 => 'You must select an item to view its letter.');
end if;
end;
The clob_get function is below. Notice that the line "$s('P123_CONTENT',p.responseText);" is taking the output from the clob_get and setting the value of the P123_CONTENT page item (which is my standard html editor item) with the 'responseText'. the 'p' object and the 'responseText' method are built into the clob_get function when a 'new apex.ajax.clob' object is created. Confusing? Tell me about it!
function clob_get(){
var clob_ob = new apex.ajax.clob(
function(){
var rs = p.readyState
if(rs == 1||rs == 2||rs == 3){
null;
}else if(rs == 4){
$s('P123_CONTENT',p.responseText);
null;
}else{return false;}
clob_ob._get();
}

Similar Messages

  • Help with writing and retrieving data from a table field with type "LCHR"

    Hi Experts,
    I need help with writing and reading data from a database table field which has a type of "LCHR". I have given an example of the original code but don't know what to change it to in order to fix it and still read in the original data that's stored in the LCHR field.
    Basically we have two Function modules, one that saves list data to a database table and one that reads in this data. Both Function modules have an identicle table which has an array of fields from type INT4, CHAR, and type P. The INT4 field is the first one.
    Incidentally this worked in the 4.7 non-unicode system but is now dumping in the new ECC6 Unicode system.
    Thanks in advance,
    C
    SAVING THE LIST DATA TO DB
    DATA: L_WA(800).
    LOOP AT T_TAB into L_WA.
    ZDBTAB-DATALEN = STRLEN( L_WA ).
    MOVE: L_WA to ZDBTAB-RAWDATA.
    ZDBTAB-LINENUM = SY-TABIX.
    INSERT ZDBTAB.
    READING THE DATA FROM DB
    DATA: BEGIN OF T_DATA,
                 SEQNR type ZDBTAB-LINENUM,
                 DATA type ZDBTAB-RAWDATA,
               END OF T_TAB.
    Select the data.
    SELECT linenum rawdata from ZDBTAB into table T_DATA
         WHERE repid = w_repname
         AND rundate = w_rundate
         ORDER BY linenum.
    Populate calling Internal Table.
    LOOP AT T-DATA.
    APPEND T_DATA to T_TAB.
    ENDLOOP.

    Hi Anuj,
    The unicode flag is active.
    When I run our report and then to try and save the list data a dump is happening at the following point
    LOOP AT T_TAB into L_WA.
    As I say, T_TAB consists of different fields and field types whereas L_WA is CHAR 800. The dump mentions UC_OBJECTS_NOT_CONVERTIBLE
    When I try to load a saved list the dump is happening at the following point
    APPEND T_DATA-RAWDATA to T_TAB.
    T_DATA-RAWDATA is type LCHR and T_TAB consists of different fields and field types.
    In both examples the dumps mention UC_OBJECTS_NOT_CONVERTIBLE
    Regards
    C

  • Downloading data from a BLOB Field using mod_plsql

    Hi,
    I am trying to use the mod_plsql to download data from a blob field, I have a web page where I can pick the file name to be downloaded from the documents table This table has the BLOB field that has the Data formatted in a text file format(contains carriage returns), when I open it up in the browser it is displaying it correctly , but when I right click on the file name and choose "Save Target As" and save it as text file it is ignoring the carriage returns and displaying entire blob in one line.
    Can somebody help me figure out why it's not recognizing the carriage returns?
    Any help would be greatly appreciated.
    Thanks

    Hi and welcome to the forum.
    Is there a way to retrieve data from a blob field and save it to temp table.Why would you want to do that?
    Can you provide some more details regarding your requirement?
    (Don't forget to mention your database version as well)
    Also, I wonder why you've added a 'decompress' tag to your question?
    edit, after seeing Tubby's reply
    Dang, the connection must be frozen here ;)
    Edited by: hoek on Jan 6, 2010 9:06 PM

  • How to retrieve data from a field of CLOB datatype?

    How can I retrieve data from a field of CLOB datatype in Oracle
    8 being called from an ASP or VB application? The recordset
    object in ASP or VB doesn't support the CLOB datatype.
    Thank you in advance for your help.

    How can I retrieve data from a field of CLOB datatype in Oracle
    8 being called from an ASP or VB application? The recordset
    object in ASP or VB doesn't support the CLOB datatype.
    Thank you in advance for your help. Hello.. were you able to solve your problem? I'm faced with pretty much the same task.. I have a VBA application that needs to pull various pieces of data(CLOBs, BLOBs, etc..) from an Oracle8i db.

  • Retrieving data from a relational table and CLOB as a whole XML file

    I created the table lob_example and I have managed to insert XML document into it using XML SQL Utility. In this document I put contents of <DESCRIPTION> tag into CDATA section.
    LOB_EXAMPLE
    Name Null? Type
    ID NOT NULL NUMBER
    DESCRIPTION CLOB
    NAME VARCHAR2(40)
    But I could not retrieve this data properly. I can think of only one solution - to parse and build the whole XMLDocument. I found the suggestion of another solution to use Oracle8i views to do that in http://technet.oracle.com/tech/xml/infoocs/otnwp/about_oracle_xml_products.htm, but this text is not clear enough for me.
    I would like to quote the fragment from document mentioned above, which is ambiguous for me:
    "Combining XML Documents and Data Using Views
    Finally, if you have a combination of structured and unstructured XML data, but still want to view and operate on it as a whole, you can use Oracle8i views. Views enable you to construct an object on the "fly" by combining XML data stored in a variety of ways. So, you can store structured data (such as employee data, customer data, and so on) in one location within object -relational tables, and store related unstructured data (such as descriptions and comments) within a CLOB. When you need to retrieve the data as a whole, you simply construct the structure from the various pieces of data with the use of type constructors in the view's select statement. The XML SQL Utility then enables retrieving the constructed data from the view as a single XML document."
    The main question is - how to use type constructors in the view's select statement?

    Hello
    Sorry for asking the same question again, but any responses would be greatly appreciated.
    How to use type constructors in the view's select statement?
    I could not find any answers for this question on Technet. Maybe the other approaches are more efficient to combine the part of data from CLOB with data from other column types?
    Thank you

  • Problem retrieving Data from a CDATA-Section using XMLDOM

    Hello,
    Ware: Oracle 8.1.7.4 64bit, XDK for PL/SQL Version 9.2.0.3, Solaris8 64bit
    I can't retrieve Data from the CDATA-Section of an XML-String, neither with
    getData(DOMCharacterData) or substringData. Also getLength fails. I get always
    the following error:
    ERROR at line 1:
    ORA-29532: Java call terminated by uncaught Java exception: java.lang.ClassCastException
    ORA-06512: at "XML_SCHEMA.XMLCHARDATACOVER", line 0
    ORA-06512: at "XML_SCHEMA.XMLDOM", line 853
    ORA-06512: at "SCHWABE.XML_TEST", line 47
    ORA-06512: at line 1
    I can successfully cast the DOMNode to a CharacterData with makeCharacterData
    and check with isNull (DOMCharacterData) (returns FALSE).
    My Testcase:
    1) A Function which build a XML-Document:
    CREATE OR REPLACE FUNCTION XML_ResponseCalc RETURN VARCHAR2 IS
    doc VARCHAR2(32767);
    BEGIN
    doc :=
    '<?xml version="1.0" encoding="UTF-8"?>
    <RSDecEng>
    <Version>1.00</Version>
    <ResponseCalc>
    <ID>00000000000000000014</ID>
    <Burst>
    <Definition>
    <Count>1</Count>
    <ID>
    <Start>1</Start>
    <Length>4</Length>
    </ID>
    <Var>
    <Name>Risiko_1</Name>
    <Start>5</Start>
    <Length>5</Length>
    </Var>
    </Definition>
    <Data>
    <Length>9</Length>
    <Count>5</Count>
    <![CDATA[
    1 0.001
    2 0.002
    3 0.003
    4 0.004
    5 0.005
    6 0.006
    7 0.007
    8 0.008
    9 0.009
    10 0.010
    ]]>
    </Data>
    </Burst>
    </ResponseCalc>
    </RSDecEng>
    2) The Procedure which parses the XML-Document (no Exception-Handling):
    CREATE OR REPLACE PROCEDURE XML_TEST IS
    Parser XML_SCHEMA.XMLParser.Parser;
    DOMDocument XML_SCHEMA.XMLDOM.DOMDocument;
    DOMNode XML_SCHEMA.XMLDOM.DOMNode;
    DOMNodeItem XML_SCHEMA.XMLDOM.DOMNode;
    DOMNodeList XML_SCHEMA.XMLDOM.DOMNodeList;
    DOMCharacterData XML_SCHEMA.XMLDOM.DOMCharacterData;
    TheDocument CLOB;
    ID VARCHAR2(100);
    Data VARCHAR2(200);
    BEGIN
    -- LOB
    DBMS_LOB.CREATETEMPORARY(TheDocument, TRUE);
    DBMS_LOB.WRITEAPPEND(TheDocument, LENGTH(XML_ResponseCalc), XML_ResponseCalc);
    -- Parse
    Parser := XML_SCHEMA.XMLParser.NewParser;
    XML_SCHEMA.XMLParser.ParseCLOB(Parser, TheDocument);
    DOMDocument := XML_SCHEMA.XMLParser.GetDocument(Parser);
    XML_SCHEMA.XMLParser.FreeParser(Parser);
    -- Node
    DOMNode := XML_SCHEMA.XMLDOM.MakeNode(DOMDocument);
    -- Get ID
    DOMNodeList := XML_SCHEMA.XSLProcessor.SelectNodes
    (DOMNode,'/RSDecEng/ResponseCalc/ID/text()');
    IF XML_SCHEMA.XMLDOM.GetLength(DOMNodeList) > 0 THEN
    DOMNodeItem := XML_SCHEMA.XMLDOM.Item(DOMNodeList, 0);
    XML_SCHEMA.XMLDOM.WriteToBuffer(DOMNodeItem, ID);
    SYS.DBMS_OUTPUT.PUT_LINE ('ID: '||ID);
    END IF;
    -- Get CDATA
    DOMCharacterData := XML_SCHEMA.XMLDOM.MakeCharacterData(DomNode); -- <-- ok here...
    IF NOT XML_SCHEMA.XMLDOM.isNull (DOMCharacterData) THEN -- <-- ...and here
    Data := XML_SCHEMA.XMLDOM.GETDATA(DOMCharacterData); -- <-- ...but here Exception raise
    END IF;
    END;
    I hope you can help me.
    Thank you in advance
    Markus Schwabe

    You need to notice the definitions for makecharacterdata:
    FUNCTION makeCharacterData(n DOMNode) RETURN DOMCharacterData;
    PURPOSE
    Casts given DOMNode to a DOMCharacterData
    It only do the casting.

  • Retrieving Data from database to combobox

    Hi
    Can anyone help in retrieving data from database to combobox..
    All the names of employees and their designations are stored in database.so i want retrieve them in other page.
    both designation and names of employees are comboboxes.
    after loading tha page i need to get all the designations which are stored in database in first combobox and when i select a particular designation i need get all tha names of employees of that designation in other combobox.this has to be done using jsp and ajax.
    please can anyone give me the code for this using Ajax and Jsp.

    Hello Friend try this code
    dbdata.jsp
    <%@page language="java" import="java.sql.*"%>
    <html>
    <%
    Class.forName("..........");
    Connection n=DriverManager.getConnection ("....","...","...");
    Statement st=con.createStatement();
    ResultSet rs=st.executeQuery("select ename from emp");
    %>
    <body>
    <form>
    <select>
    <%
    while(rs.next())
    %>
    <option><%=rs.getString("ename")%></option>
    <%
    %>
    </select>
    </form>
    </body>
    </html>

  • How to retrieve data from table(BOM_ITEM)

    Hi All,
    I wrote webservices using axis1.4 to get BOM information from SAP.. funtional module is CAD_DISPLAY_BOM_WITH_SUB_ITEMS
    webservices works fine..I'am able to retrieve data from Export Parameter..But not able to retrieve data from table
    How to retrieve data from table(BOM_ITEM)..?
    Cheers, all help would be greatly appreciated
    Vijay

    Hi,
    1. Create Page Process.
    2. Select Data Manipulation
    3. In category select "Automated Row Fetch"
    4. Specify process name, sequence, select "On Load - Before Header" in point.
    5. Specify owner, table, primary key, and the primary key column(Item name contains primary key).
    6. Create a process.
    7. In each item select "Database Column" in "Source Type".
    Regards,
    Kartik Patel
    http://patelkartik.blogspot.com/
    http://apex.oracle.com/pls/apex/f?p=9904351712:1

  • How to increase speed while retrieving data from tableand showing it in pop

    Hi,
    In one form ,I have used f9 key to retrieve data from table in oracle database . i.e. in any input field in my form, once I press f9 key, it execute JavaScript windows. Open command.
    In that command, I called the servlet which retrieves nearly 7000 rows data from table and then it dispatch request to another jsp page which shows the related data in tabular form. The data may contain nearly 7000-8000 rows.
    So when I press the f9 keys it takes around 10-12 second to open the page.
    Is there any ways to open this pop up windows within 2-3 second once I hit the f9 keys.
    Here with I am attaching hole code for servlet and jsp page.
    Any suggestion is highly appreciated.
    Thanks and Regards
    Harshal
      try {            Class.forName("oracle.jdbc.OracleDriver");            connection = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:bmltest","system","manager");            st = connection.createStatement(); String query = ""; if(find == null){ query = "SELECT A1.ITEMNAME,A1.TECHDESC, A1.ITEMCODE,SUBSTR(A1.MUNITCODE,1,3),A1.MUNITCODE FROM CMSTITEM A1,CMSTITEMGRP A2  WHERE A1.ITEMGROUPCODE=A2.ITEMGROUPCODE AND A2.ITEMCLASS='"+Iclasscode+"' ORDER BY A1.ITEMNAME ASC"; }else{ find = find.toUpperCase(); query = "SELECT A1.ITEMNAME,A1.TECHDESC, A1.ITEMCODE,SUBSTR(A1.MUNITCODE,1,3),A1.MUNITCODE FROM CMSTITEM A1,CMSTITEMGRP A2  WHERE A1.ITEMGROUPCODE=A2.ITEMGROUPCODE AND A2.ITEMCLASS='"+Iclasscode+"' ORDER BY A1.ITEMNAME ASC and A1.ITEMNAME like '%"+find+"%' OR A1.ITEMCODE like '%"+find+"%'"; } rs = st.executeQuery(query); while (rs.next()){ for (int i=1;i<=5;i++){ Itemnamedetail.add(rs.getString(i)); } } connection.close(); }catch(Exception e){ e.printStackTrace(); }                request.setAttribute("rowid",rowid); request.setAttribute("select",Itemnamedetail); RequestDispatcher view = request.getRequestDispatcher("Itemname.jsp"); view.forward(request,response); 
    and here is an jsp code
    <%@page import ="java.util.*,java.sql.*,java.text.*"%><% ArrayList<String> arr1 = (ArrayList<String>)request.getAttribute("select"); String rowid = (String)request.getAttribute("rowid"); String itmcd = "itmcd"+rowid;        String itmnm = "itmnm"+rowid;        String uom = "uom"+rowid;        String mcode = "mcode"+rowid;%>  <html><head> </head><body>  <form name = "unitsel" action = "SelectUnit" method = post><p align="center"><b>Find :    <input type = "text" id = "find" name = "find" ></p></form><table border = 2px align = "center" width = 75%> <tr> <th>Item Name</th> <th>Tech-Description</th>                <th>Item-code</th> <th>Unit-name</th>                <th>Munit-code</th> </tr> <td width = 65%><h5 align=center><%=b%></h5></td>                <td width = 35%><h5 align=center><%=c%></h5></td> <td width = 35%><h5 align=center><%=d%></h5></td> <td width = 65%><h5 align=center><%=e%></h5></td> </tr> <%j++;}%> </table> </body></html> 

    First of all you will have to apply paging to show data in tables. and retrieve only those sets of data which are required. You will defnitely need to do lot of code for that. but i am hopeful, you will get some thing on net.
    Second thing you can do is use AJAX. It will show your popup and will keep on loading data simultaneously. You can use JQuery and many others for that.

  • Error while trying to retrieve data from BW BEx query

    The following error is coming while trying to retrieve data from BW BEx query (on ODS) when the Characters are more than 50.
    In BEx report there is a limitation but is it also a limitation in Webi report.
    Is there any other solution for this scenario where it is possible to retrieve more than 50 Characters?
    A database error occured. The database error text is: The MDX query SELECT  { [Measures].[3OD1RJNV2ZXI7XOC4CY9VXLZI], [Measures].[3P71KBWTVNGY9JTZP9FTP6RZ4], [Measures].[3OEAEUW2WTYJRE2TOD6IOFJF4] }  ON COLUMNS , NON EMPTY CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( CROSSJOIN( [ZHOST_ID2].[LEVEL01].MEMBERS, [ZHOST_ID3].[LEVEL01].MEMBERS ), [ZHOST_ID1].[LEVEL01].MEMBERS ), [ZREVENDDT__0CALDAY].[LEVEL01].MEMBERS ) ........................................................ failed to execute with the error Invalid MDX command with UNSUPPORTED: > 50 CHARACT.. (WIS 10901)

    Hi,
    That warning / error message will be coming from the MDX interface on the BW server.  It does not originate from BOBJ.
    This question would be better asked to support component BW-BEX-OT-MDX
    Similar discussion can be found using search: Limitation of Number of Objects used in Webi with SAP BW Universe as Source
    Regards,
    Henry

  • Query Report:To Retrieve Data from A/R Invoice and A/P Invoice

    Hii Experts,
          I am a new Sap B1 Trainee.I am facing a problem when retrieving data from A/R Invoice and A/P Invoice in order to track
    Expenditure and Revenue according to a Bussiness partner,
    I am using union to retrieve the information,but it is saying a error that  Error Converting Varchar to Numeric and also
    i would like to know how can i show the total final payment by reflecting Downpayments in A/R Invoice and A/P Invoice
    With Regards
    Cherry.

    Hii.
    My Sap B1 version is 8.8.1 and patch level is 20. Actully i need a scenario where i can able to show both Expenditure and Revenue of a particular bussiness partner and profit/loss in a single query report.
    I need some tips regarding this,When i am doing union i am getting conversion error converting varchar to numeric when i take
    Sum(Line Total) from OINV and Sum(line total) OPCH group by docdate and docentry and BP .
    and another scenario is how to deduct A/P downpayment or A/R downpayment from A/P invoices and A/R invoice to get the final Revenue and Expenditure ..
    Thanks & Regards
    Cherry

  • Retrieve data from a list in SharePoint 2013 provider hosted App using CSOM

    I have developed a provider hosted app in SharePoint 2013. As you already know, Visual Studio creates web application and SharePoint app. The web application gets hosted inside IIS and the SharePoint App in SharePoint site collection. I'm trying to get
    data from a list hosted in SharePoint using CSOM. But I get ran insecure content error. 
    here is my code in Default.aspx
        <script type="text/javascript" src="../Scripts/jquery-1.8.2.js"></script>
        <script type="text/javascript" src="../Scripts/MicrosoftAjax.js"></script>
        <script type="text/javascript" src="../Scripts/SP.Core.js"></script>
        <script type="text/javascript" src="../Scripts/INIT.JS"></script>
        <script type="text/javascript" src="../Scripts/SP.Runtime.js"></script>
        <script type="text/javascript" src="../Scripts/SP.js"></script>
        <script type="text/javascript" src="../Scripts/SP.RequestExecutor.js"></script>
        <script type="text/javascript" src="../Scripts/App.js"></script>
        <html xmlns="http://www.w3.org/1999/xhtml">
        <head runat="server">
            <title></title>
        </head>
        <body>
            <form id="form1" runat="server">
            <div>
                <input id="Button1" type="button" value="Get title via CSOM" onclick="execCSOMTitleRequest()" /> <br />
                <input id="Button2" type="button" value="Get Lists via CSOM" onclick="execCSOMListRequest()" />
            </div>
                <p ID="lblResultTitle"></p><br />
                <p ID="lblResultLists"></p>
            </form>
        </body>
        </html>
    and App.js is:
        var hostwebUrl;
        var appwebUrl;
        // Load the required SharePoint libraries
        $(document).ready(function () {
            //Get the URI decoded URLs.
            hostwebUrl =
                decodeURIComponent(
                    getQueryStringParameter("SPHostUrl")
            appwebUrl =
                decodeURIComponent(
                    getQueryStringParameter("SPAppWebUrl")
            // resources are in URLs in the form:
            // web_url/_layouts/15/resource
            var scriptbase = hostwebUrl + "/_layouts/15/";
            // Load the js files and continue to the successHandler
            //$.getScript(scriptbase + "/MicrosoftAjax.js",
            //   function () {
            //       $.getScript(scriptbase + "SP.Core.js",
            //           function () {
            //               $.getScript(scriptbase + "INIT.JS",
            //                   function () {
            //                       $.getScript(scriptbase + "SP.Runtime.js",
            //                           function () {
            //                               $.getScript(scriptbase + "SP.js",
            //                                   function () { $.getScript(scriptbase + "SP.RequestExecutor.js", execCrossDomainRequest); }
        function execCrossDomainRequest() {
            alert("scripts loaded");
        function getQueryStringParameter(paramToRetrieve) {
            var params = document.URL.split("?")[1].split("&");
            var strParams = "";
            for (var i = 0; i < params.length; i = i + 1) {
                var singleParam = params[i].split("=");
                if (singleParam[0] == paramToRetrieve)
                    return singleParam[1];
        function execCSOMTitleRequest() {
            var context;
            var factory;
            var appContextSite;
            var collList;
            //Get the client context of the AppWebUrl
            context = new SP.ClientContext(appwebUrl);
            //Get the ProxyWebRequestExecutorFactory
            factory = new SP.ProxyWebRequestExecutorFactory(appwebUrl);
            //Assign the factory to the client context.
            context.set_webRequestExecutorFactory(factory);
            //Get the app context of the Host Web using the client context of the Application.
            appContextSite = new SP.AppContextSite(context, hostwebUrl);
            //Get the Web
            this.web = context.get_web();
            //Load Web.
            context.load(this.web);
            context.executeQueryAsync(
                Function.createDelegate(this, successTitleHandlerCSOM),
                Function.createDelegate(this, errorTitleHandlerCSOM)
            //success Title
            function successTitleHandlerCSOM(data) {
                $('#lblResultTitle').html("<b>Via CSOM the title is:</b> " + this.web.get_title());
            //Error Title
            function errorTitleHandlerCSOM(data, errorCode, errorMessage) {
                $('#lblResultLists').html("Could not complete CSOM call: " + errorMessage);
        function execCSOMListRequest() {
            var context;
            var factory;
            var appContextSite;
            var collList;
            //Get the client context of the AppWebUrl
            context = new SP.ClientContext(appwebUrl);
            //Get the ProxyWebRequestExecutorFactory
            factory = new SP.ProxyWebRequestExecutorFactory(appwebUrl);
            //Assign the factory to the client context.
            context.set_webRequestExecutorFactory(factory);
            //Get the app context of the Host Web using the client context of the Application.
            appContextSite = new SP.AppContextSite(context, hostwebUrl);
            //Get the Web
            this.web = context.get_web();
            // Get the Web lists.
            collList = this.web.get_lists();
            //Load Lists.
            context.load(collList);
            context.executeQueryAsync(
                Function.createDelegate(this, successListHandlerCSOM),
                Function.createDelegate(this, errorListHandlerCSOM)
            //Success Lists
            function successListHandlerCSOM() {
                var listEnumerator = collList.getEnumerator();
                $('#lblResultLists').html("<b>Via CSOM the lists are:</b><br/>");
                while (listEnumerator.moveNext()) {
                    var oList = listEnumerator.get_current();
                    $('#lblResultLists').append(oList.get_title() + " (" + oList.get_itemCount() + ")<br/>");
            //Error Lists
            function errorListHandlerCSOM(data, errorCode, errorMessage) {
                $('#lblResultLists').html("Could not complete CSOM Call: " + errorMessage);
    Any solution is appreciated.

    Hi,
    To retrieve data from list in your provider-hosted app using SharePoint Client Object Model(CSOM), you can follow the links below for a quick start:
    http://msdn.microsoft.com/en-us/library/office/fp142381(v=office.15).aspx
    http://blogs.msdn.com/b/steve_fox/archive/2013/02/22/building-your-first-provider-hosted-app-for-sharepoint-part-2.aspx
    Best regards
    Patrick Liang
    TechNet Community Support

  • Retrieve data from a synonym in oracle database through db connect

    Hi Everyone,
    I have created certain synonym for some tables in oracle. I want to retrieve data from it through db connect but where through source system and then selecting database tables, only tables and views are available.
    Synonyms are not available to create data sources and retrieve the data from it. Why is it so. Is this a limitation of db connect.
    Can anyone please let me know about it.
    Thanks,
    Joshua.

    Hi,
    You want to import data from an external Oracle database into your BW 3.X. To do this, you can connect the external database to the BW 3.X release as a source system using the external database connect. BW 3.X here represents BW 3.0, BW 3.1 and BW 3.5 because in other (DB relevant) parts, all 3 versions are based on the same source code.
    General information
    The above function allows you to load data from an external Oracle database (not a BW database) into your BW 3.0 system.
    There may also be constellations which cannot be used directly through the DB Connect access. However, it should be possible to find an adequate, customer-specific solution for most of these scenarios.
    In such situations, the resulting work falls into the area of Consulting and cannot be handled via Support.
    Successful implementation of a connection requires corresponding expertise and experience in the use of the source database in the areas:
                    - Tools
                    - SQL syntax
                    - DB-specific functions
    Corresponding knowledge of the source application is also required to ensure that semantically relevant data arrives in the BW system.
    Procedure
    You should execute the following steps to connect the source system (Q) to the BW system (BW):
    Installing the client software on an BW application server
                         Of course, you only need to install the client software if you are using BW with a non-Oracle database.
                         Use the Oracle setup program on the database CD (runInstaller on Unix) to start the OracleInstaller. Follow the program instructions and the DB installation instructions to install the Oracle Client software on BW.
    Testing connection setup from BW to Q
                         After you install the client software on BW, try to set up a connection from BW to the server on Q. You may need to adjust the tnsnames.ora or sqlnet.ora files for this, to introduce the Oracle systems (to which contact should be made) to BW. You can test the connection by executing the command "tnsping QDB" on BW to check whether the client has established contact to the QDB database on the Q system.
    Creating a separate U user in Q
                         We recommend that you create a separate U user in Q for connection to BW. This means that authorization and administration questions can be solved centrally.
    Displaying data sources in Q for the U user
                         To provide U data for users other than U, you can create views on other user tables as user U:
                         CREATE OR REPLACE VIEW viewname AS
                           SELECT * FROM QDB.tablename
                         You may have to grant SELECT privileges to user U in the QDB schema:
                            GRANT select ON QDB.tablename TO U
                         Of course, you can also restrict or reformat data in the view arrangement (for example, change from internal date format into the SAP date format). JOIN operations using several tables are also available.
                         !!! Synonyms do not yet work!!!
                         Synonyms that you can create as described below are another option for providing a complete table for the user U:
                           CREATE SYNONYM synoname FOR QDB.tablename
                         !!! Synonyms do not (yet) work!!!
                         After you have displayed the require data for user U, you can simply use
                           SELECT * FROM <view or table>
                         on the Q system to check which data is returned.
                         You can now open a link to Q as user U in the BW system with SQLPLUS and check, using the same SELECT, whether this data is also seen in the Oracle client. If this is not the case, there is probably a connection problem.
    Creating a connection from BW to Q in BW
    Including data sources of user U user in Q in BW.
    Solution
    Supported BW, Basis and BW 3.0B database versions, Basis 6.20 Support Package 2 (or higher)
          Oracle 8.1 (or higher, see below)
    Possible problems
    - Synonyms do not (yet) work!
    Up to now, only tables and views have been used as data sources for the DB Connect from the R3 Basis. As soon as synonyms are also used in the Basis, you will be able to convert created views (or even replicated tables) to synonyms as a workaround.
    With Basis 6.40 at the earliest, therefore as of BW 3.5, you will also be able to use synonyms. Until then, the following will help:
      CREATE VIEW <view_on_synonym> AS SELECT * FROM <synonym>
    - The source DB must have at least the release version of the BW DB.
    Oracle only ensures the support of client-server links if the version of the client is not higher than that of the server. So if BW has Oracle version 8.1 and, as in the case of Dbconnect, is run as a client against the server of the source database, the source database must have at least release Oracle 8.1 or higher.
    Of course, you have the option to install the Oracle client software of a lower version and then use this for the DB connect. This is also the procedure used to work with a DB connect on external databases of other vendors.
    Furthermore, the implementation of the DBconnect function in BW uses SAP Basis functions. Specifications of Oracle 8.1 database catalogs are used here. The source database must therefore have at least Version 8.1.
    - Oracle Client Software Version
    If you want to connect from an Oracle BW DB to an Oracle source DB, for the DB connect you naturally use the client software that you already installed on each application server.
    If you want to connect from a non-Oracle BW DB to an Oracle source DB, check item 3 of note 521230 to see which Oracle client software version is released with your BW R3 kernel and use this version.
    - Date and time fields in Oracle and their conversion into SAP-compatible column formats
    Example with a DATE field:
    Since a SAP table does not have a DATE field (date values are NUMC(8) and time specifications are NUMC(6)), we will use the Oracle DBA_TABLES system table as an example.
        SQL> desc dba_tables;
    The Oracle DBA_TABLES system table has a LAST_ANALYZED field. This is a DATE type field and is recognized as a date field of 7 characters by DBA_CONNECT. However, the import does not work because the DATE is a 7-byte conglomerate of "...century, year, month, date, hour, minute and second." (extract from the Oracle documentation).
    To make this DATE field legible for DB connect, you must use the TO_CHAR function in a VIEW. This should display the following examples:
    SQL> select LAST_ANALYZED from dba_tables
          where table_name like 'RS%' and rownum < 10 ;
    The formatting used here is the default used implicitly by SQLPLUS.
    SQL> select  to_char(LAST_ANALYZED,'YYYYMMDD') as dat from dba_tables where table_name like 'RS%' and rownum < 10 ;
    The result now has the SAP compatible format YYYYMMDD and should be loaded correctly by the DB connect as a date.
    SQL> select  to_char(LAST_ANALYZED,'HH24MISS') as tim from dba_tables where table_name like 'RS%' and rownum < 10 ;
    The result now has the SAP compatible format HHMMSS and should be loaded correctly by the DB connect as a time.
    You can use the following example for more detailed experiments:
    SQL> select  to_char(
           TO_DATE('03-FEB-2001 04:05:06','DD-MON-YYYY HH24:MI:SS'),
           'YY-MM-DD HH24-MI-SS') as datim from dual;
    with the result:
      DATIM
      01-02-03 04-05-06
    When you create a VIEW and use the TO_CHAR function (or other functions), you should easily be able to avoid problems with the interpretation of date/time specifications (and other reformatting).
    Details about the functions and the formats are contained in the Oracle documentation.
    - Special characters
    A words that contain special characters can only be imported correctly if the code pages in BW and in the source system are identical. If the code pages are not the same, DB Connect can be used if the characters to be imported appear under the first 127 characters of the character set.
    The use of multibyte code pages in the source system for saving data using character sets with more than 256 characters (Kanji, Katakana, Hiragana, Korean, Chinese, Tagalog, Khmer, Arabic, Cherokee, and so on) can cause the characters to become corrupt.
    For questions concerning the code pages, also refer to the FAQ note 606359 and question/answer 19 that appears there.

  • Retrieve data from a dynamic page via loadURL

    Hello.
    I would like to ask you how it is possible to retrieve data
    from a dynamic page (asp classic in my case) using the loadURL
    method.
    I would like to create an html authentication form (with
    username and password fields). The loadURL method should call an
    asp page and then pass to the usual function 'DoIfSucceded' the
    results of the elaboration.
    Of course I'm going to have a switch in the function in order
    to make different actions depending from the results of the asp
    page (authentication succeded or failed).
    I had a look to the examples at this page:
    Adobe
    samples
    Is there anyone who can explain clearly how the results data
    must be written by the asp page and how the success function can
    retrieve them ?
    I thank you in advance for your help.

    loadURL() uses the the XMLHttpRequest Object so if the
    content you return is XML, you have 2 choices for accessing your
    data. You can either access it as a text string via the
    XMLHttpRequest object's responseText property, or as a DOM document
    via the XMLHttpRequest object's responseXML property:
    function MySuccessCallback(req)
    // If my data is XML, I can access the data that was sent
    from the server
    // as DOM elements via the XMLHttpRequest's responseXML
    property.
    var xmlDOM = req.xhRequest.responseXML;
    // OR, you can access the data sent back from the server as
    text via
    // the XMLHttpRequest object's responseText property.
    var xmlAsAString = req.xhRequest.responseText;
    var req = Spry.Utils.loadURL("GET",
    "/app/book.php?id=1&code=54321", true, MySuccessCallback);
    If your serverside script wants to use some other format as a
    response like JSON or plain text, then you can only access the data
    as text via the responseText property.
    --== Kin ==--

  • Retrieve data from a large table from ORACLE 10g

    I am working with a Microsoft Visual Studio Project that requires to retrieve data from a large table from Oracle 10g database and export the data into the hard drive.
    The problem here is that I am not able to connect to the database directly because of license issue but I can use a third party API to retrieve data from the database. This API has sufficient previllege/license permission on to the database to perform retrieval of data. So, I am not able to use DTS/SSIS or other tool to import data from the database directly connecting to it.
    Here my approach is...first retrieve the data using the API into a .net DataTable and then dump the records from it into the hard drive in a specific format (might be in Excel file/ another SQL server database).
    When I try to retrieve the data from a large table having over 13 lacs records (3-4 GB) in a data table using the visual studio project, I get an Out of memory exception.
    But is there any better way to retrieve the records chunk by chunk and do the export without loosing the state of the data in the table?
    Any help on this problem will be highly appriciated.
    Thanks in advance...
    -Jahedur Rahman
    Edited by: Jahedur on May 16, 2010 11:42 PM

    Girish...Thanks for your reply...But I am sorry for the confusions. Let me explain that...
    1."export the data into another media into the hard drive."
    What does it mean by this line i.e. another media into hard drive???
    ANS: Sorry...I just want to write the data in a file or in a table in SQL server database.
    2."I am not able to connect to the database directly because of license issue"
    huh?? I never heard this question that a user is not able to connect the db because of license. What error / message you are getting?
    ANS: My company uses a 3rd party application that uses ORACLE 10g. And my compnay is licensed to use the 3rd party application (APP+Database is a package) and did not purchased ORACLE license to use directly. So I will not connect to the database directly.
    3.I am not sure which API is you are talking about, but i am running an application of the visual studio data grid or similar kind of controls; in which i can select (select query) as many rows as i needed; no issue.
    ANS: This API is provided by the 3rd party application vendor. I can pass a query to it and it returns a datatable.
    4."better way to retrieve the records chunk by chunk and do the export without loosing the state of the data in the table?"
    ANS: As I get a system error (out of memory) when I select all rows in a datatable at a time, I wanted to retrieve the data in multiple phases.
    E.g: 1 to 20,000 records in 1st phase
    20,001 to 40,000 records in 2nd phase
    40,001 to ...... records in 3nd phase
    and so on...
    Please let me know if this does not clarify your confusions... :)
    Thanks...
    -Jahedur Rahman
    Edited by: user13114507 on May 12, 2010 11:28 PM

Maybe you are looking for

  • IMac 24" with 7600 video card - enough juice?

    Building out my shopping list and I will be editing HDV from either a Sony HDR-HC7 or a Canon HV-20. We are somewhat between the iMac 20/24" and other than the larger screen area, I felt the Nvidea 7600 would give some additional performance. It seem

  • How to read multiple Digital samples and plot a chart with time stamps

    Hi,  Could anyone send me a code that: 1. Reads 'multiple samples(lets say 4) from single digital input'  2. 'plot digital data as a chart with time stamps' 3. Find frequency 4. Log data into file with time stamps I have attached the code which i tri

  • Adobe Captivate Help | Publish projects as HTML5 files

    This question was posted in response to the following article: http://helpx.adobe.com/captivate/using/publish-projects-html5-files.html

  • After Solaris live upgarde disks unavailable

    Hi All, we have two SUN Fire 6800 - cluster node. OS and Kernel Version: Solaris 9 9/05 s9s_u8wos_05 SPARC. After Solaris live upgrade the new root disks are continueously failing. During boot with new boot environment Solaris_9_905 wait and then boo

  • N73 firmware version 4.0735.3.0.2 won't pair over ...

    I've updated my N73's firmware to 4.0735.3.0.2 and it will no longer pair over Bluetooth with my MacBook Pro or iBook. Nor can I send files to and from the phone. It simply drops the connection. I'm running Leopard, but it was working fine with that