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.

Similar Messages

  • "evdre encountered a problem retrieving data from the webserver"

    Hi
    We are using a big report which takes very long time to expand and sometimes we get the error message "evdre encountered a problem retrieving data from the webserver" when expanding the report, but not very often for most of our users. But we have one user who gets this error message almost every second time he expands the report. This user have a computer with same capacity as the rest of us, can there be some setting on the computer or in the client installtion the cause this problem?
    We are using BPC 5.1 SP 5
    /Fredrik

    Hi,
    This error occurs usually if we have huge data in combination of our dimensions.
    Even, if the selection of your memberset is not apt to the combination of the data present in the back end, you may encounter a data retrival error.
    regards
    sashank

  • Error while retrieving data from PL/SQL Table using SELECT st. (Urgent!!!)

    Hi Friends,
    I am using Oracle 8.1.6 Server, & facing problems while retrieving data from a PL/SQL Table:
    CREATE or REPLACE PROCEDURE test_proc IS
    TYPE tP2 is TABLE of varchar2(10); --declared a collection
    dt2 tP2 := tP2('a','b','c');
    i NUMBER(8);
    begin
    SELECT COUNT(*) INTO i FROM TABLE(CAST(dt2 as tP2));
    DBMS_OUTPUT.PUT_LINE('**'||i);
    end;
    While executing the above procedure, I encountered foll. error:
    ERROR at line 1:
    ORA-00600: internal error code, arguments: [15419], [severe error during PL/SQL execution], [], [],
    ORA-06544: PL/SQL: internal error, arguments: [pfrrun.c:pfrbnd1()], [], [], [], [], [], [], []
    ORA-06553: PLS-801: internal error [0]
    Can anyone please help me, where the problem is??
    Is it Possible to retrieve data from PL/SQL TABLE using SELECT statement? & How ?
    Thanks in advance.
    Best Regards,
    Jay Raval.

    Thanks Roger for the Update.
    It means that have to first CREATE TYPE .. TABLE in database then only I can fire a Select statement on that TYPE.
    Actually I wanted to fire a Select statement on the TABLE TYPE, defined & declared in PLSQL stored procedure using DECLARE TYPE .. TABLE & not using CREATE TYPE .. TABLE.
    I was eager to know this, because my organization is reluctant in using CREATE TYPE .. TABLE defined in the database, so I was looking out for another alternative to access PL/SQL TABLE using Select statement without defining it database. It would have been good if I could access a PLSQL TABLE using Select statement Declared locally in the stored procedure.
    Can I summarize that to access a PL/SQL TABLE using SELECT statement, I have to first CREATE TYPE .. TABLE?
    If someone have any other idea on this, please do let me know.
    Thanks a lot for all help.
    Best Regards,
    Jay Raval.
    You have to define a database type...
    create type tP2 is table of varchar2(10)
    CREATE OR REPLACE PROCEDURE TEST_PROC
    IS
    dt2 tP2 := tP2('a','b','c');
    i NUMBER(8);
    begin
    SELECT COUNT(*) INTO i FROM TABLE(CAST (dt2 AS tP2));
    DBMS_OUTPUT.PUT_LINE('**'||i);
    end;
    This will work.
    Roger

  • Problem retrieving data from a JTable.

    Hi All,
    I've just searched to 45th page of this forum but I heven't found a topic containing infos that can help me.
    Well, my problem is: I have to retrieve data from a JTable. I use getValue() method but it seems to work well on all cells of a row but the last cell. I use the TAB to move focus on the row and when it is on the last cell, using TAB, the focus jumps on the next row & 1st column.
    Using TAB moving on system, I can retrieve all data but data on the last cell data.
    I add another info hoping someone has a solution for my problem: If the focus goes back on the last cell of a row just edited, in this case the data retrieving work as well.
    Thank you for your attention!
    Bye.

    I don't understand your question. I don't understand what using Tab and getValueAt(...) have to do with one another. If you want data from a cell then just use getValueAt(...).
    If you want to know what cell currently has focus you use
    getSelectedRow()
    getSelectedColumn()

  • SP 2013 Designer Workflow problems retrieving data from Web Service

    Hi all,
    I am creating a SharePoint 2013 Designer Workflow, and I am having trouble retrieving data from a web service. The web service URL is
    http://services.odata.org/V2/Northwind/Northwind.svc/Customers and the problem I am having is with the SharePoint Designer Workflow “Call HTTP Web Service” action URL. The URL I am
    having problems with is shown below:
    http://services.odata.org/V2/Northwind/Northwind.svc/Customers('[%Current Item:Customer ID%]')?$format=json&$select=CustomerID,CompanyName,ContactName,ContactTitle,Address,City,PostalCode,Country,Phone,Fax
    or
    http://services.odata.org/V2/Northwind/Northwind.svc/Customers('[%Current Item:Customer ID%]')?$select=CustomerID,CompanyName,ContactName,ContactTitle,Address,City,PostalCode,Country,Phone,Fax&$format=json
    The SharePoint 2013 Designer workflow works OK if I try to retrieve two items like "CompanyName" and "ContactName", but when I try to retrieve three or more items the workflow doesn’t work it just pauses
    with no error message. The URL that works OK is shown below:
    http://services.odata.org/V2/Northwind/Northwind.svc/Customers('[%Current Item:Customer ID%]')?$format=json&$select=CompanyName,ContactName
    or
    http://services.odata.org/V2/Northwind/Northwind.svc/Customers('[%Current Item:Customer ID%]')?$select=CompanyName,ContactName&$format=json
    Does anyone know why I cannot retrieve more than two items from a web server? Am I making a mistake with the URL?
    I hope you can
    Colin

    Hi Amit,
    According to your description, my understanding is that you want to approve workflow task using web service in SharePoint 2013.
    For troubleshooting this issue, please provide the more detailed code.
    Here are some similar posts, please check if they are useful:
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/b999a417-dce3-4590-9173-89aea91f23a3/complete-workflow-after-approving-all-tasks?forum=sharepointdevelopment
    http://www.sharepointblog.in/2013/07/programmatically-approvereject-task-in.html
    http://aarebrot.net/blog/2011/10/how-sloppiness-and-spworkflowtask-altertask-could-inadvertantly-lock-your-workflow-task/
    I hope this helps.
    Thanks,
    Wendy
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Wendy Li
    TechNet Community Support

  • Problem reading data from oracle database 11g using OleDbDataReader

    Hi everyone I work with Visual Studio 2010 and C# programming language. I have a problem reading data from the oracle database. I created a WPF application with my main Window Xaml and class files and 1 more class called DataFiles. The thing I want is to read some data from the database on my grid in my WPF window. Problem is even though it connects to the database the grid is always empty. It isn't the connection string as I tested it and it connects to the database the problem seems to be in showing the LASTNAME (PREZIME in my native tongue) on the grid which is what it's supposed to do.
    Here is the code:
    Data Files Code
    using System;
    using System.Collections.ObjectModel;
    using System.Data.SqlClient;
    using System.Data.OleDb;
    namespace SQLKonekcija
        public class clsEmployee
            public string Prezime { get; set; }
        public class DataAccess
            OleDbConnection oleCon;
            OleDbCommand oleComd;
            public DataAccess()
                string connectionString = "provider=ORAOLEDB.ORACLE; data source=ORCL; password=****; user id=****;";
                oleCon = new OleDbConnection(connectionString);
            public ObservableCollection<clsEmployee> GetAllEmployee()
                ObservableCollection<clsEmployee> EmpCol = new ObservableCollection<clsEmployee>();
                oleComd = new OleDbCommand();
                oleComd.Connection = oleCon;
                oleComd.CommandText = "Select PREZIME from UPOSLENICI";
                oleCon.Open();
                OleDbDataReader Reader = oleComd.ExecuteReader();
                Reader.Read();
                while (Reader.Read())
                    EmpCol.Add(new clsEmployee()
                        Prezime = Reader["PREZIME"].ToString()
                oleCon.Close();
                return EmpCol;
            }And here is my main window.cs code
    public partial class MainWindow : Window
            clsEmployee objEmpToAdd;
            DataAccess objDs;
            public MainWindow()
                InitializeComponent();
            private void Window_Loaded(object sender, RoutedEventArgs e)
                objDs = new DataAccess();
                dgEmp.ItemsSource = objDs.GetAllEmployee();And the XAML
    <Window x:Class="SQLKonekcija.MainWindow"
            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            Title="MainWindow" Height="350" Width="525" Loaded="Window_Loaded">
        <Grid>
            <DataGrid AutoGenerateColumns="False" Height="237"
                      HorizontalAlignment="Left" Margin="18,66,0,0" Name="dgEmp"
                      VerticalAlignment="Top" Width="466" ColumnWidth="*"
                       >
                <DataGrid.Columns>
                    <DataGridTextColumn Binding="{Binding PREZIME}" Header="Prezime"></DataGridTextColumn>
                </DataGrid.Columns>
            </DataGrid>
            <TextBlock Height="42" HorizontalAlignment="Left" Margin="18,15,0,0" Name="textBlock1" Text="TEST CONNECTION" VerticalAlignment="Top" Width="462" TextAlignment="Center" FontSize="28" FontWeight="ExtraBold" />
        </Grid>
    </Window>
    The guys on the MSDN forums told me I should ask the question here so sorry if it's not your field.
    Hope u guys can help, thanks.

    I tried it, commented out the reader.read and have the following connection string
    string connectionString = "provider=ORAOLEDB.ORACLE; data source=ORCL; password=****; user id=****; OLEDB.NET=True"
    Unfortunately the result is the same.
    Edited by: Dino2dy on Nov 24, 2011 12:53 AM

  • Inserting and retrieving data from a al32UTF8 database USING SQL Developer

    hi guys,
    Before i post my questions , i think its better for me to provide you guys with my understandings first so that it easier to understand where/if i have gone wrong..
    I am using Window XP and Oracle 10g
    Non-unicode client - a client program that need to use the OS code page for mapping of the retrieved unicode data from the database as well as the support of displaying/inserting the characters from that code page to the database.
    E.G sqlplusw.exe
    Therefore, when using a non-unicode client
    1) we have to set the OS code page (Control panel - regional and language setting - advance - language for non unicode program ) to the code page that contain the characters we are going to display/insert.
    2) we will also have to set the NLS_LANG characterset to the character set of the code page we are going to insert so that when we do a insert (for e.g in thai ) , oracle will know, and auto conversion to UNICODE can take place. This is also true when we retrieve unicode data from the database so that conversion to the correct character set can take place.
    INSERTING
    THAI ---> conversion ----> UNICODE
    RETRIEVING
    THAI <---- conversion <---- UNICODE
    I hope my basic understanding is correct up till this point.
    Unicode client - a client program that supports the displaying/inserting of unicode characters without the need of setting the OS code page (Control panel - regional and language setting - advance - language for non unicode program )
    E.G isqlplus http or SQL developer
    However,
    1) There is still a need to set the NLS_LANG so that correct conversion can take place between the client and the database.
    For e.g, when retrieving if we set the NLS_LANG character set to ZHS16GBK (chinese) and the data store in unicode in database is E.G (THAI) , then the conversion would be wrong .
    Since it is a unicode supported client, then the NLS_LANG character set should be set to UNICODE as well.
    Here come my questions
    *Important - please help if you are busy and have no other time to answer the rest of the questions
    *Q1) If i were to use a unicode client, what should i set my NLS_LANG character set to ?
    AMERICAN_AMERICA.UTF8 ?
    *Q2) Where do i set the NLS_LANG character set information in SQL Developer, i know there is a metalink for setting NLS_LANG using isqlplus but i cant seems to google any result for SQL developer.
    Q3) Is my basic understanding right until this point ? If not, please explain in a more generalised term as i am really not familiar with character sets, code page, unicode , glyphs and fonts..
    Q4) If a unicode client does not need to refer to the OS code page (set in regional and language) , is there a UNICODE code page for the client to refer to , or is there any Window API available ?
    Q5)
    There is still a need to set the NLS_LANG so that correct conversion can take place between the client and the >>database.
    For e.g, when retrieving if we set the NLS_LANG character set to ZHS16GBK (chinese) and the data store in >>unicode in database is E.G (THAI) , then the conversion would be wrong .am i right on this point for UNICODE supported client ?
    Thanks for spending time to read my questions and i hope to hear advices from you guys soon.
    Million thanks again for sharing.
    Best Regards,
    Noob but willing to learn

    The requirement to always set NLS_LANG is not true for JDBC, which ignores NLS_LANG altogether. Java programs fetch text data into String variables, which use Unicode UTF-16 by design. JDBC sets character set conversion so that data is converted between UTF-16 and the database or national character set.
    The requirement to set NLS_LANG is not generally true for OCI, either. The first call in an OCI problem can be OCIEnvNlsCreate(). This call has two parameters that allow the caller to define the character set to use for VARCHAR2/CHAR/LONG/CLOB/statement text and the character set to use for NVARCHAR2/NCHAR/NCLOB. Only if these character sets are specified as 0, NLS_LANG character set is used. Also, OCI programs can specify different character sets for each bind or define variable (i.e. input/output buffer). Note: OCI programs always use NLS_LANG to initialize the language and territory settings for the client program and the database session. Only the character set can be specified is OCIEnvNlsCreate().
    OCIEnvNlsCreate() can specify the client character set as UTF-16 (in platform endianess). This is not possible with NLS_LANG.
    Various interfaces building on OCI, such as Oracle ODBC and ODP .NET, explicitly initialize OCI with Unicode character set, and thus ignore the NLS_LANG character set as well.
    Thnx,
    Sergiusz

  • Retrieving data from a remote DB using ODBC ?

    Hi,
    Has anybody tried to collect some data from a remote DB in InDesign plugin by using ODBC ? I want to know the basic steps including what I have to add in the Xcode project, how to connect to remote DB, and how to retrieve data in plugin by sql query ?
    TIA,
    Nima

    I think you need to add /usr/lib/libiodbc.a to your Xcode project. also you will want to look into sql.h and sqlext.h assuming you're connecting to database such as MySQL to see what's the API you will use to communicate thru ODBC. But the code should be purely C++, nothing InDesign specific, you can write it as a separate library or an InDesign Boss object.
    You will also need to install ODBC driver that's probably would be supplied by your database vendor. So for MySQL, there is a driver you need to download from MySQL site and install, and configure thru OSX's ODBC Administrator tool.
    Thanks!
    lee

  • Retrieve data from R3 to XI using RFC

    Hi,
    I want to get data out from R3 to XI through RFCs or even using idocs. I have done RFC configurations in abap using SM59 with XI as destination. I am not sure whether its right. Please guide me as to how to get data out of R3 by first sending the ID no. to R3 and then retrieving data. Can anybody help me or give me some links where i could get some information about such a scenario?
    Thank you

    Hi Kevin,
    You need not to do any seeting at R3 side for RFC Scenarios.
    For RFC Scenario:
    Make RFC in R3 make sure that it is working fine in R3. take ID as a import parameter.
    Import the RFC Structure in XI in Imported Objects.
    Do the Design & Configuration as you do generaly.
    For IDOC Scenarios :
    Yuo have to do some setting in R3 and XI side . For Required setting refer following Links.
    Trouble shooting ALE settings.
    Troubleshooting of ALE Process
    Configuration steps for Idoc.
    Configuration steps required for posting idoc's(XI)
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/d19fe210-0d01-0010-4094-a6fba344e098
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/cdded790-0201-0010-6db8-beb9bb2b2660
    Reward Points if Helpful
    Thanks
    Sunil Singh

  • Client Socket Problem: retrieving data from my Simple http Server...

    here's the main part of the "sending" of data from my server class:
    write(b.getBytes());
    outtStream.write(version.getBytes());
    outStream.write(replyCode.getBytes());
    here the server sends the data back to the client...i've tested this on a webbrowser and got a correct response...
    now in my client side, I'm having problems...
    1) I dont know how to retrieve the data from the outStreams above...
    2) Can anyone give me some help plz...or descriptive sample code
    here's the main part of the client sending its data first from the user input(client) and then sending the data...(ive created the socket)
    input = new BufferedReader(new InputStreamReader(System.in));
    output = new PrintWriter(socket.getOutputStream(),true);
    while((message = input.readLine()) != null)
    output.println(message);//sends the client's input to server?
    System.out.println(input.readLine());//retrieves server's response
    //then outputs it

    also i tried adding
    input = new BufferedReader(new InputStreamReader(socket.getInputStream()));
    after the System.in one and still no luck :[                                                                                                                                                                                                                                                                                               

  • Store and retrieve data from a FP-2000 using RT application

    Using labview RT build application can i store and retrive the data from Fp-2000. If so how much memory it will be free?
    Karthikeyan @ sivathasan
    Karaikudi - 630006
    India
    hp: +919442047691

    This question is a little like "If I put some water in a one gallon bucket, how much spae will be left?"
    It all depends on how much you put in.
    A clean efficient app will leave more space left over. Its been years since I wrota an app that did that on a FP-2000 but I seem te rember having enough memory left over to buffer a weeks worth of data provided the sample rate is kept low enough and updates are limited by dead-bands.
    I think that's all I can say to try and help for now.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • How to retrieve data from a DB table USING BPEL.

    hi ,
    suppose i have a table XXLOANS in DB so i want to retrive data from db table,so for that i created a DB connection on BPEL and then a DB adapter and then through a INVOKE process i attached with that adapter and then assinging two ASSIGN.
    but i am not getting the output.
    can any body help me regarding this.
    can any body guide me by STEP BY STEP procedure,i think i am doing some thing wrong in ASSIGN.
    Thanks,
    Prakash

    Hey hi..
    create a partner link with a db adapter..
    write a query what you want from the table.
    create a invoke process and just create one assign activity where you can assign the output of the invoke activity into any variable of your choice..and the required datas from the table may be fetched into the variable ..this is db read functionality..
    thanks

  • How to retrieve data from a REF CURSOR using OCI 8.0?

    I found an example in Oracle docs (shown below) that discusses how to bind a REF CURSOR for later data retrieval, but it does not explain actually how to do the later data retrieval.
    I hope someone can explain it to me. Thanks
    The OCI provides the ability to bind and define PL/SQL REF CURSORs and nested tables. An application can use a statement handle to bind and define these types of variables. As an example, consider this PL/SQL block:
    static const text plsql_block = (text )
    "begin \
    OPEN :cursor1 FOR SELECT empno, ename, job, mgr, sal, deptno \
    FROM emp_rc WHERE job=:job ORDER BY empno; \
    OPEN :cursor2 FOR SELECT * FROM dept_rc ORDER BY deptno; \
    end;";
    An application would allocate a statement handle for binding, by calling OCIHandleAlloc(), and then bind the :cursor1 placeholder to the statement handle, as in the following code, where :cursor1 is bound to stm2p. Note that the handle allocation code is not included here.
    err = OCIStmtPrepare (stm1p, errhp, (text *) nst_tab, strlen(nst_tab),
    OCI_NTV_SYNTAX, OCI_DEFAULT);
    err = OCIBindByName (stm1p, (OCIBind **) bndp, errhp,
    (text *)":cursor1", (sb4)strlen((char *)":cursor1"),
    (dvoid *)&stm2p, (sb4) 0, SQLT_RSET, (dvoid *)0,
    (ub2 *)0, (ub2 *)0, (ub4)0, (ub4 *)0, (ub4)OCI_DEFAULT);
    In this code, stm1p is the statement handle for the PL/SQL block, while stm2p is the statement handle which is bound as a REF CURSOR for later data retrieval. A value of SQLT_RSET is passed for the dty parameter.

    ( sorry, i forgot the Link where i get this html fiLes, so i just copy-paste here )
    ( maybe it can heLp you a bit. -- it's heLp me, for sure )
    And the following is thanks to Brett Rosen :
    I noticed that you didn't have an OCI entry
    on http://osi.oracle.com/~tkyte/ResultSets/index.html .
    Here is OCI code to do this (Oracle 81) if you want to include it on
    that page.
    Some error checking and cleanup has been removed, but the below should
    work. (once dbname has been replaced appropriately)
    Brett
    int main(int argc, char* argv[])
    OCIError* pOciError;
    char* pConnectChar = "dbname";
    char* pUsernameChar = "scott";
    char* pPasswordChar = "tiger";
    int answer;
    OCIStmt* pOciStatement;
    char* sqlCharArray = "BEGIN :success := sp_ListEmp; END;";
    int id;
    char ename[40];
    OCIEnv* g_pOciEnvironment = NULL;
    OCIServer* g_pOciServer = NULL;
    OCISession* g_pOciSession = NULL;
    OCISvcCtx* g_pOciServiceContext = NULL;
    sb2* pIndicator=0;
    sb2* pIndicator2=0;
    sb2* pIndicator3=0;
    OCIDefine* pOciDefine;
    OCIDefine* pOciDefine2;
    OCIBind* pBind;
    OCIStmt* cursor;
    answer = OCIInitialize(OCI_THREADED, NULL, NULL, NULL, NULL);
    answer = OCIEnvInit(&g_pOciEnvironment, OCI_DEFAULT, 0, NULL);
    answer = OCIHandleAlloc(g_pOciEnvironment, (void **)&pOciError, OCI_HTYPE_ERROR, 0, NULL);
    answer = OCIHandleAlloc(g_pOciEnvironment, (void **)&g_pOciSession, OCI_HTYPE_SESSION, 0, NULL);
    answer = OCIHandleAlloc(g_pOciEnvironment, (void **)&g_pOciServer, OCI_HTYPE_SERVER, 0, NULL);
    answer = OCIHandleAlloc(g_pOciEnvironment, (void **)&g_pOciServiceContext, OCI_HTYPE_SVCCTX, 0, NULL);
    answer = OCIServerAttach(g_pOciServer, pOciError, (unsigned char *)pConnectChar, strlen(pConnectChar),
    OCI_DEFAULT);
    answer = OCIAttrSet(g_pOciSession, OCI_HTYPE_SESSION, (unsigned char *)pUsernameChar, strlen(pUsernameChar),
    OCI_ATTR_USERNAME, pOciError);
    answer = OCIAttrSet(g_pOciSession, OCI_HTYPE_SESSION, (unsigned char *)pPasswordChar, strlen(pPasswordChar),
    OCI_ATTR_PASSWORD, pOciError);
    answer = OCIAttrSet(g_pOciServiceContext, OCI_HTYPE_SVCCTX, g_pOciServer, 0, OCI_ATTR_SERVER, pOciError);
    answer = OCIAttrSet(g_pOciServiceContext, OCI_HTYPE_SVCCTX, g_pOciSession, 0, OCI_ATTR_SESSION, pOciError);
    answer = OCISessionBegin(g_pOciServiceContext, pOciError, g_pOciSession, OCI_CRED_RDBMS, OCI_DEFAULT);
    answer = OCIHandleAlloc(g_pOciEnvironment, (void **)(&pOciStatement), OCI_HTYPE_STMT, 0, NULL);
    answer = OCIStmtPrepare(pOciStatement, pOciError, (unsigned char *)sqlCharArray, strlen(sqlCharArray),
    OCI_NTV_SYNTAX, OCI_DEFAULT);
    answer = OCIHandleAlloc(g_pOciEnvironment, (void **)(&cursor), OCI_HTYPE_STMT, 0, NULL);
    answer = OCIBindByPos(pOciStatement,&pBind, pOciError, 1, &cursor, 0,SQLT_RSET,
    pIndicator2, 0,NULL, 0,0,OCI_DEFAULT);
    answer = OCIStmtExecute(g_pOciServiceContext, pOciStatement, pOciError, 1, 0, NULL, NULL,
    OCI_COMMIT_ON_SUCCESS);
    answer = OCIDefineByPos(cursor,&pOciDefine, pOciError,2,&id,sizeof(int),
    SQLT_INT,pIndicator, 0, 0,OCI_DEFAULT);
    answer = OCIDefineByPos(cursor,&pOciDefine2, pOciError,1,ename,40,
    SQLT_STR,pIndicator3, 0, 0,OCI_DEFAULT);
    if (answer == 0)
    while ((answer = OCIStmtFetch(cursor,pOciError, 1,OCI_FETCH_NEXT,OCI_DEFAULT)) == 0)
    printf("fetched id %d and name %s\n",id,ename);
    answer = OCIHandleFree(pOciError, OCI_HTYPE_ERROR);
    return 0;
    }

  • Fatal Error while retrieving data from Visual Fox Pro using OLE-DB UDS

    Hello all,
    in a customer project we connected a Visual Fox Pro Database via OLE-DB UDS.
    Whenever data is retrieved, a fatal error shows up:
    Fatal Error: Error occurred while processing data stream, null
    Although the data is retrieved correctly!
    MII used: 11.5
    UDS-Server: xMII OLE DB UDS, version 4.0.1.10
    This is the log from the UDS-Server:
    [02/29/2008-11:22:40.195] oleDB [P:4404, T:4792, Framework,   ERROR] 0x0      {extra params}: {5}     [LHDSChannelHandler.cpp @ 488, CLHDSChannelHandler::ExecuteIOCP]
    [02/29/2008-11:22:40.195] oleDB [P:4404, T:4792, Framework,   ERROR] 0x17009     Exception occured: pid = 5, original = 5, data = <ExecutionContext><param name="MODE" value="QUERY"/><param name="QUERY" value="SELECT artikelnr FROM artikel "/><param name="ENDDATE" value="1204280560164"/><param name="ROWCOUNT" value="100"/><param name="STARTDATE" value="1204276960164"/></ExecutionContext>.     [LHDSChannelHandler.cpp @ 493, CLHDSChannelHandler::ExecuteIOCP]
    ********** Start of Exception Stack Trace **********
         1)     [02/29/2008-11:22:40.210] oleDB [P:4404, T:4792,       UDS, ] 0x0     HRESULT: 0x80004005 [Unspecified error]     [BaseOleDbMode.h @ 1133, BaseOleDbMode<class COleDbQuery>::ProcessDynamicResults]
         2)     [02/29/2008-11:22:40.210] oleDB [P:4404, T:4792,       UDS, RETHROW] 0x0     Rethrowing exception.     [BaseOleDbMode.h @ 1211, BaseOleDbMode<class COleDbQuery>::ProcessDynamicResults]
         3)     [02/29/2008-11:22:40.210] oleDB [P:4404, T:4792,       UDS, RETHROW] 0x0     Rethrowing exception.     [Query.cpp @ 107, COleDbQuery::ExecuteOleDbMode]
         4)     [02/29/2008-11:22:40.210] oleDB [P:4404, T:4792,       UDS, RETHROW] 0x0     Rethrowing exception.     [BaseOleDbMode.h @ 381, BaseOleDbMode<class COleDbQuery>::ExecuteMode]
         5)     [02/29/2008-11:22:40.210] oleDB [P:4404, T:4792,       UDS, RETHROW] 0x0     Rethrowing exception over COM.     [LHDSUtil.h @ 1086, lhds::LHDSModeImpl<class COleDbQuery,struct ILHDSMode>::Execute]
         6)     [02/29/2008-11:22:40.210] oleDB [P:4404, T:4792,       UDS, RETHROW] 0x0     Rethrowing exception.     [LHDSUtil.h @ 1124, lhds::LHDSModeImpl<class COleDbQuery,struct ILHDSMode>::Execute]
         7)     [02/29/2008-11:22:40.210] oleDB [P:4404, T:4792, Framework, RETHROW] 0x0     Rethrowing exception over COM.     [LHDSDispatcher.cpp @ 135, CLHDSDispatcher::CallMode]
         8)     [02/29/2008-11:22:40.210] oleDB [P:4404, T:4792,       UDS, RETHROW] 0x0     Rethrowing exception over COM.     [LHDSUtil.h @ 893, lhds::LHDataServerImpl<class CLHOleDbDataServer>::Execute]
         9)     [02/29/2008-11:22:40.210] oleDB [P:4404, T:4792, Framework, ] 0x0     Caught exception over a COM boundry.     [LHDSChannelHandler.cpp @ 566, CLHDSChannelHandler::OnExecute]
         10)     [02/29/2008-11:22:40.210] oleDB [P:4404, T:4792, Framework, RETHROW] 0x0     Rethrowing exception.     [LHDSChannelHandler.cpp @ 574, CLHDSChannelHandler::OnExecute]
         11)     [02/29/2008-11:22:40.210] oleDB [P:4404, T:4792, Framework, RETHROW] 0x0     Rethrowing exception.     [LHDSChannelHandler.cpp @ 502, CLHDSChannelHandler::ExecuteIOCP]
         12)     [02/29/2008-11:22:40.210] oleDB [P:4404, T:4792, Framework, RETHROW] 0x0     Rethrowing exception over COM.     [LHDSChannelHandler.cpp @ 189, CLHDSChannelHandler::Execute]
         13)     [02/29/2008-11:22:40.210] oleDB [P:4404, T:4792,      Host, HANDLED] 0x0     Handled exception.     [ThreadPool.cpp @ 228, ThreadPool::ThreadProc]
    ************** End of Exception Trace **************
    Any help is very much appreciated.
    Regards,
    Matthias
    Edited by: Matthias Wald on Feb 29, 2008 12:12 PM

    Hi Salvatore,
    tried your suggestian but no luck, same error.
    I checked the Version. It shows 4.0.1.10.
    Is there a later version available?
    UDS Settings are (apologize any misspellings):
    Collect Requests                              false
    Log Level                                         Info
    Maximum Concurrent Connections    1000
    Pool Size                                         5
    Port                                                 8087
    Runtime Mode                                  Service
    Service Dependencies                       Eventlog
    Service Passowrd                              *******
    Service Startup                                 Manual
    Service User                                     .\LocalSystem
    Shutdown Timeout                            10
    Stack Size                                       0
    Threading Model                               MTA
    Trusted Requesters                         
    Use IOCP                                        true
    Connection String                            Provider=VFPOLEDB.1;Data Source=D:\Daten;Mode=Share Deny None;Extended Properties="";User ID="";Password="";Mask Password=False;Cache Authentication=False;Encrypt Password=False;Collating Sequence=MACHINE;DSN="";DELETED=True;CODEPAGE=1252;MVCOUNT=16384;ENGINEBEHAVIOR=90;TABLEVALIDATE=3;REFRESH=5;VARCHARMAPPING=False;ANSI=True;REPROCESS=5
    Persistent Connectikon                     true
    Show Affected Rows                         Minimal
    Variant Representation                      String
    I have changed MTA to STA and also tried other admin user for service without luck.
    Any other hints?

  • Retrieve data from a stored procedure using powerpivot

    Hi there. I'm new to SQL and would like to import the below stored procedure to PowerPivot. PowerPivot says the statement is valid, but fails to import the stored procedure and returns this error "OLE DB or ODBC error: Changed database context to 'SiriusV1'.;
    01000.An error occurred while processing table 'Query'.The current operation was cancelled because another operation in the transaction failed." Please assist. Thanks in advance
    USE [SiriusV1]
    BEGIN TRY
    DECLARE @RC int
    DECLARE @as_at_date datetime
    DECLARE @all_versions bit
    DECLARE @include_motor bit
    DECLARE @include_reserve bit
    SET NOCOUNT ON;
    -- TODO: Set parameter values here.
    SET @as_at_date =
    GETDATE();
    SET @all_versions =
    0;
    SET @include_motor =
    1;
    SET @include_reserve =
    0;
    SET NOCOUNT OFF;
    EXECUTE @RC = [dbo].[usp_claims_by_reserve] 
       @as_at_date
      ,@all_versions
      ,@include_motor
      ,@include_reserve
    END TRY
    BEGIN CATCH
    SELECT
    ERROR_NUMBER() AS ErrorNumber
    ,ERROR_SEVERITY() AS ErrorSeverity
    ,ERROR_STATE() AS ErrorState
    ,ERROR_PROCEDURE() AS ErrorProcedure
    ,ERROR_LINE() AS ErrorLine
    ,ERROR_MESSAGE() AS ErrorMessage
    END CATCH
    GO

    Hi ,
      1. As you will be selecting the database while establishing the connection itself , there is no need for USE statement to switch the database.
      2. I don't think batch statements with "GO" is supported in power pivot query.
      3. If there is an error in executing the proc the power pivot will throw error by itself and no need for a begin try statement. When there is an error , the result set returned (From Begin catch) will be completely different from the columns returned
    from the procedure and there will be a metadata mismatch and for sure it will run into problem. Remove the try catch block.
    Please  let us know if there is any significant requirement for which  try catch block is used.
    Best Regards Sorna
    Hi Tlotlang,
    Adding to what Sorna has already mentioned, simplifying your SQL statements to the following should work:
    DECLARE @as_at_date datetime,
    @all_versions bit,
    @include_motor bit,
    @include_reserve bit;
    SET NOCOUNT ON;
    SET @as_at_date = GETDATE();
    SET @all_versions = 0;
    SET @include_motor = 1;
    SET @include_reserve = 0;
    EXEC [dbo].[usp_claims_by_reserve]
    @as_at_date
    ,@all_versions
    ,@include_motor
    ,@include_reserve;
    Regards,
    Michael
    Please remember to mark a post that answers your question as an answer...If a post doesn't answer your question but you've found it helpful, please remember to vote it as helpful :)
    Website: nimblelearn.com, Blog:
    nimblelearn.com/blog, Twitter:
    @nimblelearn

Maybe you are looking for