Data retrieve data from array PL/SQL is "???"

Hi,
I follow the sample code shown in getting the data of PL/SQL using Java.
Please see below:
OracleCallableStatement stmt =(OracleCallableStatement)conn.prepareCall
( "begin ? := getEMpArray; end;" );
// The name we use below, EMPARRAY, has to match the name of the
// type defined in the PL/SQL Stored Function
stmt.registerOutParameter( 1, OracleTypes.ARRAY,"EMPARRAY" );
stmt.executeUpdate();
// Get the ARRAY object and print the meta data assosiated with it
ARRAY simpleArray = stmt.getARRAY(1);
System.out.println("Array is of type " + simpleArray.getSQLTypeName());
System.out.println("Array element is of type code "+simpleArray.getBaseType());
System.out.println("Array is of length " + simpleArray.length());
// Print the contents of the array
String[] values = (String[])simpleArray.getArray();
for( int i = 0; i < values.length; i++ )
System.out.println( "row " + i + " = '" + values +"'" );
But when i view the data from java the data that is being fetch is "???". All the array data is like this "???".
But when i debug the PL/SQL the data is OK.
I dont know if this is a binary numbers or what.
I dont know how to solve this. And get the real data.
Please help.
Thanks.
Edited by: user652585 on Oct 22, 2008 9:02 AM

I'm guessing that your database NLS_Language settings don't match your clients.
Go into the project properties->compiler->encoding and choose the right caracter set to match your database's one.

Similar Messages

  • IR webclient: error when uncompressing data retrieved: *Data Error*!

    A small (?) number of IR webclient 931 installations we notice the next error when processing: " error when uncompressing data retrieved: *Data Error*! " It does not seem to be user or permission/provision related.
    Does anyone have an idea how to solve it. Reinstalling the IR webclient does not solve it.

    Hi there, I got to the point where I found the cause, but now I still need to solve it. perhaps anyone can give me a hint.
    931 bqy's are stored on server as zip files. (although they are renamed as *.1) On 832 they were stored as bqy files (although they were renamed to *.1 too).
    The clients which had the error message tried to open their 931 documents with the 832 plugin. Which does not have the capebility to uncompress the .1 file. In that perspective is the error message very obvious.
    We need to run both 832 intelligence plugin and the 931 webclient on the same client.
    How can we force that the corrcet version is used for openeing the docs?

  • IRWebclient: error when uncompressing data retrieved: *Data Error*!

    We experience a sporadic "error when uncompressing data retrieved: *Data Error*!" while processing a query with IR webclient 931. The problem occurs on several webclients but on other desktops it does not. The IHTML processes fine.
    Any one an idea? reinstalling interactive webclient on the same pc does not help.
    Completely reinstall the pc (os and other client software including interactive webclient) does help.

    Hi there, I got to the point where I found the cause, but now I still need to solve it. perhaps anyone can give me a hint.
    931 bqy's are stored on server as zip files. (although they are renamed as *.1) On 832 they were stored as bqy files (although they were renamed to *.1 too).
    The clients which had the error message tried to open their 931 documents with the 832 plugin. Which does not have the capebility to uncompress the .1 file. In that perspective is the error message very obvious.
    We need to run both 832 intelligence plugin and the 931 webclient on the same client.
    How can we force that the corrcet version is used for openeing the docs?

  • Data retrieve from array PL/SQL is "???"

    Hi,
    I follow the sample code shown in getting the data of PL/SQL using Java.
    Please see below:
    OracleCallableStatement stmt =(OracleCallableStatement)conn.prepareCall
    ( "begin ? := getEMpArray; end;" );
    // The name we use below, EMPARRAY, has to match the name of the
    // type defined in the PL/SQL Stored Function
    stmt.registerOutParameter( 1, OracleTypes.ARRAY,"EMPARRAY" );
    stmt.executeUpdate();
    // Get the ARRAY object and print the meta data assosiated with it
    ARRAY simpleArray = stmt.getARRAY(1);
    System.out.println("Array is of type " + simpleArray.getSQLTypeName());
    System.out.println("Array element is of type code "+simpleArray.getBaseType());
    System.out.println("Array is of length " + simpleArray.length());
    // Print the contents of the array
    String[] values = (String[])simpleArray.getArray();
    for( int i = 0; i < values.length; i++ )
    System.out.println( "row " + i + " = '" + values<em> +"'" );
    But when i view the data from java the data that is being fetch is "???". All the array data is like this "???". :(
    But when i debug the PL/SQL the data is OK.
    I dont know if this is a binary numbers or what.
    I dont know how to solve this. And get the real data.
    Please help.
    By the way, i'm using eclipse as the IDE.
    Thanks.</em>

    I'm guessing that your database NLS_Language settings don't match your clients.
    Go into the project properties->compiler->encoding and choose the right caracter set to match your database's one.

  • Data Retrieval speed from DIAdem Database using Data Finder Toolkit in LabVIEW

    I have developed a LabVIEW code using NI Data Finder toolkit for extracting the data from the DIAdem. I have formed queries for extraction the data. But the data retrieval takes more time for extracting the data.
    I have attached my LabVIEW code image along with this post. In that i have circled the VI "Results to Waveform", which is Data Finder toolkit VI which takes more time for extraction. From my Testing, query formation is taking only few millisecond to execute, but "Results to Waveform.vi" takes around 35 seconds. Also i want to execute similar kind of search for 5 times. Altogether it will taken around 1.5 mins to 2 mins for execution.
    Is there any other alternative way of doing this search? Kindly help me in sorting this out.
    Thanks,
    Alagar 
    Solved!
    Go to Solution.
    Attachments:
    Report Gen.JPG ‏91 KB

    Hi Alagar,
    You say that the "Results to Waveform.vi" takes "more" time, but what are you comparing this to?  More than what?  More than loading the contents of the same file with the TDMS VIs or with the Storage VIs?  What file format are you loading data from after querying-- TDMS files, ASCII files, binary files?
    What information do you want to retrieve?  Do you really need ALL the values of ALL the channels in each data file?  Are you interested only in the channel values, or all you interested in scalar properties stored along with the data?  If you want only some of the channels loaded or if you want only scalar properties loaded, there are indeed faster ways of doing this.
    Brad Turpin
    DIAdem Product Support Engineer
    National Instruments

  • Date and time from array of string

    I have managed to read information from an excel spreadsheet I am using and display different parts of it in indicators on my front panel. But the data being displayed for the cells that contain the date and time are showing up incorrectly.
    The date of 15/08/2014 shows in the indicator box as 41866 and the time of 13:55:00 shows as 0.579861111111111
    Is this something I need to change in the excel file or do I need to alter the data in the array before displaying it in the indicator.
    Sorry if this has been explained in the past. I just cant seem to see a previous solution.
    Thanks in advance

    Hi n,
    please search for your problem in the forum. This has been discussed a lot of times before! (keywords: Excel LabVIEW timestamps)
    Excel stores timestamps as number of days (your 41866) and part of days (0.5798d = 13H55M). You need to convert those numbers using some (more or less) simple math to LabVIEW timestamps!
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • SSIS Change data on Import from Excel to SQL Server table

    I'm changing all of excel data to numbers before importing to my sql table with SSIS.
    This is my original table.
    Need to achive this before import to my sql table.
    Is it possible to do it with SSIS?

    What is the logic behind the scene?
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Retrieving Key from array

    Hi
    I need a dynamic way of retrieving all the "keys" from a array.
    Found this which is exactly what I need but doesn't work as expected in my case:
    var myObject:Object = {key1:"value1",key2:"value2"}
    for (var s:String in myObject)
    trace("key:",s,"value:",myObject[s]);
    //key: key2 value: value2
    //key: key1 value: value1
    My case:
    var testArray:Array = new Array()
    testArray = DG1.dataProvider.toArray() // create array from dataprovider
    I've tested this array and it performs "correctly" as an array but when I try the above mentioned method it traces as follows:
    key: 0 value: [object Object] (key not being what I need)
    What I need:
    dgArr.push({partNo:event.target.data['partNo'+i],description:event.target.data['descriptio n'+i],cost:event.target.data['cost'+i]});               
    trace (????) //outputs = partNo, description, cost etc...
    Thanks for any help.

    your dataprovider values are also objects.  use:
    function listF(dp:DataProvider):void{
    for(var i:int=0;i<dp.length;i++){
    for(var s:String in dp.getItemAt(i)){
    trace(s,dp.getItemAt(i)[s]);

  • EPM11.1.1.2:error when uncompressing data retrieved

    After I open a BQY in IR WEB client and click the "table",there is an error happened. The error message is "error when uncompressing data retrieved:*Data Error*". My IE has no google toolbar or any other toolbar. What's wrong?

    Hi there, I got to the point where I found the cause, but now I still need to solve it. perhaps anyone can give me a hint.
    931 bqy's are stored on server as zip files. (although they are renamed as *.1) On 832 they were stored as bqy files (although they were renamed to *.1 too).
    The clients which had the error message tried to open their 931 documents with the 832 plugin. Which does not have the capebility to uncompress the .1 file. In that perspective is the error message very obvious.
    We need to run both 832 intelligence plugin and the 931 webclient on the same client.
    How can we force that the corrcet version is used for openeing the docs?

  • Pb retrieving sorted data from Table in SQL.

    Hi,
    I get problem to retrieve data in the right order from table in database SQL.
    See code attached: code.png
    I want to sort data according to ID number And then to retrieve those data and fill out a ring control in the right order "descending" .
    But i got always ID 2 instead of 1. See attached  picture : control.png
    it seems that the select statement (see under) is not woking properly. But it is working well in a query in Access DataBase .  
    //Select statement
       hstmt = DBActivateSQL (hdbc, ("SELECT * FROM %s ORDER BY ID DESCENDING",szTableName));
       if (hstmt<= DB_SUCCESS) {ShowError(); goto Error;}
    Some idea ??
    Lionel.
    Attachments:
    code.PNG ‏39 KB
    control.png ‏32 KB

    Hello Lionel,
    According to the document Robert linked, the prototype of DBActivateSQL() is:
    int statementHandle = DBActivateSQL (int connectionHandle, char SQLStatement[]);
    For the 2nd parameter(SQLStatement), you're sending:
    ("SELECT * FROM %s ORDER BY ID DESCENDING",szTableName)
    Probably your intention is to substitute %s with szTableName, but that's not what it happens.
    By using comma operator, ("SELECT * FROM %s ORDER BY ID DESCENDING",szTableName) is evaluated to szTableName, so you call is equivalent to:
    hstmt = DBActivateSQL (hdbc, szTableName);
    In order to substitute %s with szTableName you need to first build the string you're passing as the 2nd parameter:
    char query[512];
    sprintf(query, "SELECT * FROM %s ORDER BY ID DESCENDING",szTableName);
    hstmt = DBActivateSQL (hdbc, query);

  • Unable to retrieve data from a Associative Array (?)

    Hi!!!! :)))
    i've a problem!!!
    this is the oracle's code:
    Package GEST_REPORT
    IS
    type rec_url is record(
    TIBCDCON TBISD_30.TIBCDCON%TYPE,
    etc...
    SETDEL VARCHAR2(10)
    type tab2 is table of rec_url index by binary_integer;
    FUNCTION MAIN_SELECT
    ( CPLAS IN VARCHAR2)
    RETURN tab2;
    END;
    ...and a java code:
    String storedProcedure = "{? = call GEST_REPORT.MAIN_SELECT(?)}";
    String result = "";
    try{
    if (connection != null) {
    CallableStatement callableStatement = null;
    callableStatement = preprepareCall(storedProcedure);
    // preparo parametri di input.
    callableStatement.setString(2, "OM");
    callableStatement.registerOutParameter(1, oracle.jdbc.driver.OracleTypes.ARRAY, "tab2");
    and so on...
    In the last line of code throws an 'invalid name pattern'
    or
    "ORA-21700: object does not exist or is marked for delete"
    if registerOutParameter(1, oracle.jdbc.driver.OracleTypes.ARRAY, "ISDSV.GEST_REPORT").
    Where TAB2: IS THE MY ARRAY (OR NESTED TABLE?);
    GEST_REPORT: THE NAME OF PACKAGE;
    ISDSV: THE USER.
    do u have suggestion for retrieve data from TAB2 in JAVA??
    THKS!!!!!!

    Hi
    Use fully qualified type name: schema_name.type_name. For your case that would be "ISDSV.tab2"
    Cherrs :))

  • MS SQL database needs to run mdx query to analysis services to retrieve data from a BPC 10 Netweaver cube(view only)

    We are in the process of migrating from BPC7 SP12 Microsoft sql server to BPC10 netweaver on a sql server with BW7.4 and need to integrate our home grown data warehouse which is on a Microsoft sql server.  The data warehouse currently connects to BPC7 using integration services/analysis services and runs mdx queries to analysis services to retrieve data from the BPC7 cube (view only).  Please provide documentation on how to create this same integration with our data warehouse using BPC10 netweaver on a sql server.

    When you were setting up your ODBC data source for
    the Text driver, did you click on the "Options"
    button? There's a lot of options in there that I
    didn't understand at first glance.Yes I clicked on the options button, but the only thing there is dealing with file extensions. I left it set to the default.
    I have since tried closing my connection after I insert a record, I then try executeQuery, but still no luck. Seems strange that I can write to the file but not read from it. If any thing I'd expect the opposite problem.
    I have also tried using the class "JoltReport" from the sun tutorial instead of my own with the same result.
    Message was edited by:
    Hentay

  • 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

  • Retrieve data from SQL database and put into a table

    Hi all, i encountered this error while trying to create a table in 1 of my panels:
    C:\Documents and Settings\L311c01\Desktop\FYPJ Java2\RFIDLogistics.java:25:{color:#ff0000} cannot find symbol
    symbol : class ResultSetTable
    {color}location: class jdbc_bible.part2.RFIDLogistics
    private static ResultSetTable model = new ResultSetTable();
    ^
    C:\Documents and Settings\L311c01\Desktop\FYPJ Java2\RFIDLogistics.java:25: {color:#ff0000}cannot find symbol
    symbol : class ResultSetTable
    {color}location: class jdbc_bible.part2.RFIDLogistics
    private static ResultSetTable model = new ResultSetTable();
    I understand that " cannot find symbol class ResultSetTable means that i need to import something which has this ResultSetTable. I suppose my imports are sufficient and i think the error is with the package that i included.
    This package was taken from an example in a book named java database programming bible, so i assumed it is reliable and i use it for my insert statement, which had a DataInserter.
    Could someone plz help me with this? Thanks alot in advance.
    Here are the codes:
    {color:#ff0000}package jdbc_bible.part2;{color}
    import java.sql.*;
    import javax.swing.*;
    import java.util.Vector;
    import javax.swing.table.AbstractTableModel;
    import java.awt.*;
    import java.awt.event.ActionListener;
    import java.awt.event.ActionEvent;
    import java.io.*;
    import java.util.*;
    import javax.swing.event.*;
    import java.awt.event.*;
    import javax.swing.border.*;
    import sun.jdbc.odbc.JdbcOdbcDriver;
    public class RFIDLogistics extends JFrame{
    //Components
    // public SimpleClock clock;
    private static JTable jt;
    private static ResultSetTable model = new ResultSetTable();
    some codes
    {color:#ff0000}try
    {{color}
    {color:#ff0000} DataInserter inserter = new DataInserter();
    String SQLCommand = "INSERT INTO " + flstr + " (Item_ID,Location_ID) VALUES ('"+Item_ID1+"','"+Location_ID1+"')";
    String SQLCommand2 = "UPDATE Location SET Item_ID = '"+Item_ID1+"' WHERE Location_ID = '"+Location_ID1+"'";
    inserter.execute(SQLCommand);
    inserter.execute(SQLCommand2);
    {color} JOptionPane.showMessageDialog(null, "Successful!");
    catch(ClassNotFoundException f)
    f.printStackTrace();
    catch(SQLException f)
    f.printStackTrace();
    some codes
    public JPanel rightPanel() {
    JPanel rightPanel = new JPanel();
    rightPanel.setLayout(new BoxLayout(rightPanel, BoxLayout.Y_AXIS));
    //Forklift title Panel
    JPanel panel6 = new JPanel();
    panel6.setBorder(new TitledBorder(""));
    panel6.setPreferredSize(new Dimension(192,33));
    panel6.add(forkliftDetails);
    //Forklift 1 Panel
    {color:#ff0000} JPanel panel7 = new JPanel();
    panel7.setBorder(new TitledBorder("Forklift 1"));
    panel7.setPreferredSize(new Dimension(192,120));{color}
    {color:#ff0000} String query = "SELECT * FROM Forklift1";
    try{
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con = DriverManager.getConnection("jdbc:odbc:RFID Logistics");
    PreparedStatement pstmt = con.prepareStatement(query);
    ResultSet rs= pstmt.executeQuery();
    // display the data in jtable
    jt = new JTable();
    model.setResultSet(rs);
    jt.setModel(model);
    catch(ClassNotFoundException sqle){
    System.out.println(sqle);
    }catch(SQLException sqle){
    System.out.println(sqle);
    panel7.add(itemDetail1);
    itemDetail1TextField.setEditable(false);
    panel7.add(itemDetail1TextField);
    panel7.add(locationDetail1);
    locationDetail1TextField.setEditable(false);
    panel7.add(locationDetail1TextField);
    panel7.add(jt);
    {color}..
    //Main Method
    public static void main(String args[]) {
    RFIDLogistics app = new RFIDLogistics();
    app.setFrame();
    app.setResizable(false);
    app.setDefaultCloseOperation(EXIT_ON_CLOSE);
    app.setSize(1024,676);
    app.setLocation(0,60);
    app.setVisible(true);
    If you would like to try if my table can extract, here are the sample codes, just change ur database name which is highlighted in green, and the table name in blue.
    Codes:
    import java.sql.*;
    import javax.swing.*;
    import java.util.Vector;
    import javax.swing.table.AbstractTableModel;
    import java.awt.*;
    import java.awt.event.ActionListener;
    import java.awt.event.ActionEvent;
    import java.io.*;
    import java.util.*;
    import javax.swing.event.*;
    import java.awt.event.*;
    import javax.swing.border.*;
    import sun.jdbc.odbc.JdbcOdbcDriver;
    public class sample1{
    private static JFrame frm;
    private static JTable jt;
    private static ResultSetTable model = new ResultSetTable();
    public static void main(String args[]){
    String query = "SELECT * FROM {color:#00ccff}Forklift1{color}";
    try
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con = DriverManager.getConnection("jdbc:odbc:{color:#00ff00}RFID Logistics{color}");
    PreparedStatement pstmt = con.prepareStatement(query);
    ResultSet rs= pstmt.executeQuery();
    // display the data in jtable
    jt = new JTable();
    model.setResultSet(rs);
    jt.setModel(model);
    frm = new JFrame("Sample");
    frm.setSize(400,400);
    frm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frm.add(jt);
    frm.setVisible(true);
    }catch(ClassNotFoundException sqle){
    System.out.println(sqle);
    }catch(SQLException sqle){
    System.out.println(sqle);
    Could someone plz help me with this? Thanks alot in advance.

    public JTable populateTable()
      String[] colNames = new String[] {"ID","NAME","SURNAME"};
      return new JTable(getSQLData(), colNames);
    public Object[][] getSQLData()
      stmt = conn.createStatement();
      ResultSet rs = stmt.executeQuery("SELECT [ID], [NAME], [SURNAME] FROM [USERS]");
      Object[][[] out = new Object[rs.getFetchSize()][3];//Not sure on getFetchSize but it should work
      int i = 0;
      while(rs.next())
        out[0] = rs.getInt(1);
    out[i][1] = rs.getString(2);
    out[i++][2] = rs.getString(3);
    return out;
    The above code will create a JTable with the data retrieved from the DB                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Tell me how to format a date retrieved from a MS SQL Server 2000 database?

    Tell me how to format a date retrieved from an MS SQL Server 2000 database for various uses in my JSP page?

    Or if you want to use JSTL instead of a scriptlet see:
    http://forum.java.sun.com/thread.jspa?threadID=676754&tstart=0

Maybe you are looking for