# coming when I select data from oracle table using Native SQL

Hi Gurus,
I am selecting 'First name' from oracle table directly using native sql. I am fetching 65000 records but 10+ records having '#' at the end of firstname. For eg: John#.
But oracle team couldn't find '#' in their table for those records. What could be problem?
or what could be the character in oracle which comes as '#' in abap?
Pls help...
Saj

Thanks for replies.
My DB NLS_PARAMETER is AL32UTF8. I am able to pullout data with older version of ojdbc jar file. So I think there is no issue regarding NLS setting.
So please guide me with proper solution as soon as possible.

Similar Messages

  • How to select data from a table using a date field in the where condition?

    How to select data from a table using a date field in the where condition?
    For eg:
    data itab like equk occurs 0 with header line.
    select * from equk into table itab where werks = 'C001'
                                                      and bdatu = '31129999'.
    thanks.

    Hi Ramesh,
    Specify the date format as YYYYMMDD in where condition.
    Dates are internally stored in SAP as YYYYMMDD only.
    Change your date format in WHERE condition as follows.
    data itab like equk occurs 0 with header line.
    select * from equk into table itab where werks = 'C001'
    and bdatu = <b>'99991231'.</b>
    I doubt check your data base table EQUK on this date for the existince of data.
    Otherwise, just change the conidition on BDATU like below to see all entries prior to this date.
    data itab like equk occurs 0 with header line.
    select * from equk into table itab where werks = 'C001'
    and <b> bdatu <= '99991231'.</b>
    Thanks,
    Vinay
    Thanks,
    Vinay

  • How to Select Data from different Tables Using Linq

    Hi,
    I have two different tables, I just want to collect data from tables using Linq to SQL Queries.
    The tables looks like This 
    ID Name ImageUrl 
    Other Table is
    ID EmpID CheckInTime CheckOutTime 
    What I want to Collect data from CheckInTime and want to place it in a that is in a list view
    Same thing I want to do it for CheckOutTime And One thing I want to tell is both tables are joined by a FK EmpID with ID.
    What Are the suggestions for me 
    I have Used this code
    var data = from emp in db.Employees
    join chk in db.CheckInCheckOuts on emp.ID equals chk.EmpID
    select new EmployeeCheckInOut
    Name = emp.Name,
    ImageUrl = emp.ImageUrl,
    CheckIn = emp.CheckInCheckOuts,
    CheckOut = emp.CheckInCheckOuts
    Here the CheckInCheckOuts is another table, I don't how do I access fields of the Other table "CheckInCheckOuts"
    Thank you
    Ali

    Mitja,
    Kind of Tables, I don't Know but I can Tell you that these are Two table, first Table Have Data in It, Name, ImageUrl I have filled this table with names and ImageUrls And are string type.Other Table is for the CheckInTime And CheckOutTime of the employee.
    What I need that when I click on the Image button it Should displays The Current Datetime into the label below the Image button.
    So I have Problem accessing my CheckInCheckOut Table because I may not have Idea about.Did you understand what I need to do, if you have more question please ask to me.
    Thanks
    Ali

  • Selecting data from a table using Execute Immediate in 9i

    Hi,
    I was wondering how I would be able to do a SELECT on a table using EXECUTE IMMEDIATE. When I tried it (with the proc below), I got the following below. Can anyone tell me what I am doing wrong?
    Using Scott/Tiger I tried this:
    SQL> ed
    Wrote file afiedt.buf
    1 CREATE OR REPLACE PROCEDURE P2
    2 IS
    3 v_SQL VARCHAR2(100);
    4 BEGIN
    5 v_SQL := 'Select * from Emp';
    6 EXECUTE IMMEDIATE v_SQL;
    7* END;
    SQL> /
    Procedure created.
    SQL> exec p2
    PL/SQL procedure successfully completed.
    SQL> set serveroutput on
    SQL> exec p2
    PL/SQL procedure successfully completed.
    SQL>
    Thanks in advance.
    Sincerely,
    Nikhil Kulkarni

    1 CREATE OR REPLACE PROCEDURE P2
    2 IS
    3 v_SQL VARCHAR2(100);
    erec emp%rowtype;
    4 BEGIN
    5 v_SQL := 'Select * from Emp';
    6 EXECUTE IMMEDIATE v_SQL into erec;
    7* END;
    SQL> /

  • JSON - get data from Oracle table

    Hi all,
    I hope it is correct thread...
    My need is to get data from oracle table using JSON and show output at html table. I'm very new to JSON (got some experience in PL/SQL and basic html knowledge). Could someone direct me to manual or give me simple example?

    JSON is a way to format data, not a way to fetch data. Call it an alternative to XML.
    Are you perhaps talking about doing an ajax request to fetch data?

  • Retrieve specific range data from oracle table

    Hi, Dear friends,
    I want to retrieve all the data from oracle table and then save them to mysql table using JDBC ResultSet. The problem is that some oracle table is too big, if I retrieve all of them to memory at a once time using excuteQuery, the program will become no response out of memory limitation. So my question is if I can retrieve just specific range data once a time. I can¡¯t find this function through JDBC API. Also, I don¡¯t want to use the specific sql sentence, for example ¡°select ¡ from¡ where someid>¡ and someid<¡¡±, because there are many different tables, I want to transfer them automatically. So I can¡¯t construct such sql sentence in advance. Does anyone know if oracle JDBC driver provide such kind of function or does there any other way?
    Any suggestion will be greatly appreciated!
    Sammy

    Dear Justin,
    thank you so much for your prompt reply!
    as your suggestion, I do check the performance while my program is running, after the program become nearly no response, I found the memory usage is nearly 100%, while disk usage and process usage is pretty low. that's the reason why I guess maybe the memory limitation, but the strange thing is that no any error reported by JBuilder, it just nearly no response and don't transfer any data any more. my os is windows xp, the version of JBuilder is 7. my main memory is 768M. just as you said, the total 6,000 records in not very large, just no more than 400K. another strange thing is that why my program works well when there is little data records in the table.
    the big picture of my program is first I retrieve oracle table metadata, according to this information, I construct DDL sql words and then create the corresponding table in mysql database. this part works well. in order to save your time, I will not paste the code here. then there is a method to transfer oracle data to mysql table, whenever creating the mysql table, then I will call this method to transfer datat to it. the following is the code of this method, I am very sorry to take your time. please read it when you are available.
    thank you very much!!
    Sammy
    //transfer data from oracle to mysql!!!
    private static void transferData(Connection oracleConn, Connection mysqlConn, String oracleTableName, String oracleSchemaName) throws SQLException{
    Statement oracleStmt=oracleConn.createStatement();
    Statement mysqlStmt=mysqlConn.createStatement();
    // sending sql to oracle to retrieve data
    String thisTableName=oracleTableName;
    String oracleSQL="SELECT * FROM ".concat(thisTableName);
    ResultSet oracleRS = oracleStmt.executeQuery(oracleSQL);
    String sql="";
    if (oracleRS.next()) {
    ResultSetMetaData rsmd = oracleRS.getMetaData();
    int colCount = rsmd.getColumnCount();
    do {
    String sqlBodyPart="";
    String sqlValuePart="";
    System.out.println("the number of column is "+colCount);
    for (int i = 1; i <= colCount; i++) {
    String columnValue = oracleRS.getString(i);
    boolean b = oracleRS.wasNull();
    String columnName =rsmd.getColumnName(i);
    System.out.println("the value of column " + i + "is " + columnValue);
    //construc the sql body part and value part
    sqlBodyPart=sqlBodyPart.concat(" ").concat(columnName).concat(",");
    if(b){ //if the value of the column i is null
    sqlValuePart=sqlValuePart.concat(" null").concat(",");
    }else{
    sqlValuePart=sqlValuePart.concat(" '").concat(columnValue).concat("',");
    //get rid of the last comma in sqlBodyPart and sqlValuePart
    if(!sqlBodyPart.equalsIgnoreCase("")) sqlBodyPart=sqlBodyPart.substring(0,sqlBodyPart.length()-1);
    if(!sqlValuePart.equalsIgnoreCase("")) sqlValuePart=sqlValuePart.substring(0,sqlValuePart.length()-1);
    //construct the sql sentence!!!
    sql="INSERT INTO ".concat(thisTableName).concat(" (").concat(sqlBodyPart).concat(") ").concat(" VALUES(").concat(sqlValuePart).concat(")");
    System.out.println("the sql words for this column is");
    System.out.println(sql);
    System.out.println(" ");
    if(mysqlStmt!=null){
    int rows = mysqlStmt.executeUpdate(sql);
    } else{
    System.out.println("can't connect with mysql server");
    System.exit(1);
    while (oracleRS.next());
    } else {
    System.out.println("There are no data in the table...");
    }//end of method data transfer!
    //end of method data transfer!

  • Using FDM to load data from oracle table (Integration Import Script)

    Hi,
    I am using Integration Import Script to load data from oracle table to worktables in FDM.
    i am getting following error while running the script.
    Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done
    Attaching the full error report
    ERROR:
    Code............................................. -2147217887
    Description...................................... Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.
    At line: 22
    Procedure........................................ clsImpProcessMgr.fLoadAndProcessFile
    Component........................................ upsWObjectsDM
    Version.......................................... 1112
    Thread........................................... 6260
    IDENTIFICATION:
    User............................................. ******
    Computer Name.................................... *******
    App Name......................................... FDMAPP
    Client App....................................... WebClient
    CONNECTION:
    Provider......................................... ORAOLEDB.ORACLE
    Data Server......................................
    Database Name.................................... DBNAME
    Trusted Connect.................................. False
    Connect Status.. Connection Open
    GLOBALS:
    Location......................................... SCRTEST
    Location ID...................................... 750
    Location Seg..................................... 4
    Category......................................... FDM ACTUAL
    Category ID...................................... 13
    Period........................................... Jun - 2011
    Period ID........................................ 6/30/2011
    POV Local........................................ True
    Language......................................... 1033
    User Level....................................... 1
    All Partitions................................... True
    Is Auditor....................................... False
    I am using the following script
    Function ImpScrTest(strLoc, lngCatKey, dblPerKey, strWorkTableName)
    'Oracle Hyperion FDM Integration Import Script:
    'Created By:     Dhananjay
    'Date Created:     1/17/2012 10:29:53 AM
    'Purpose:A test script to import data from Oracle EBS tables
    Dim cnSS 'ADODB.Connection
    Dim strSQL 'SQL string
    Dim rs 'Recordset
    Dim rsAppend 'tTB table append rs object
    'Initialize objects
    Set cnSS = CreateObject("ADODB.Connection")
    Set rs = CreateObject("ADODB.Recordset")
    Set rsAppend = DW.DataAccess.farsTable(strWorkTableName)
    'Connect to SQL Server database
    cnss.open "Provider=OraOLEDB.Oracle.1;Data Source= +server+;Initial Catalog= +catalog+;User ID= +uid+;Password= +pass+"
    'Create query string
    strSQL = "Select AMOUNT,DESCRIPTION,ACCOUNT,ENTITY FROM +catalog+.TEST_TMP"
    'Get data
    rs.Open strSQL, cnSS
    'Check for data
    If rs.bof And rs.eof Then
    RES.PlngActionType = 2
    RES.PstrActionValue = "No Records to load!"
    Exit Function
    End If
    'Loop through records and append to tTB table in location’s DB
    If Not rs.bof And Not rs.eof Then
    Do While Not rs.eof
    rsAppend.AddNew
    rsAppend.Fields("PartitionKey") = RES.PlngLocKey
    rsAppend.Fields("CatKey") = RES.PlngCatKey
    rsAppend.Fields("PeriodKey") = RES.PdtePerKey
    rsAppend.Fields("DataView") = "YTD"
    rsAppend.Fields("CalcAcctType") = 9
    rsAppend.Fields("Amount") = rs.fields("Amount").Value
    rsAppend.Fields("Desc1") = rs.fields("Description").Value
    rsAppend.Fields("Account") = rs.fields("Account").Value
    rsAppend.Fields("Entity") = rs.fields("Entity").Value
    rsAppend.Update
    rs.movenext
    Loop
    End If
    'Records loaded
    RES.PlngActionType = 6
    RES.PstrActionValue = "Import successful!"
    'Assign Return value
    SQLIntegration = True
    End Function
    Please help me on this
    Thanks,
    Dhananjay
    Edited by: DBS on Feb 9, 2012 10:21 PM

    Hi,
    I found the problem.It was because of the connection string.The format was different for oracle tables.
    PFB the format
    *cnss.open"Provider=OraOLEDB.Oracle.1;Data Source= servername:port/SID;Database= DB;User Id=aaaa;Password=aaaa;"*
    And thanks *SH* for quick response.
    So closing the thread......
    Thanks,
    Dhananjay

  • How to select data from cluster table

    hi experts,
                   I have a report which picks data from bseg (cluster table ) for a month report it is taking around 4 minutes to process.I feel it is not good when take the report after some months.
    how to select data from these table???how to declare itab for these cluster tables????can we include any search condition or any other kind of internal table???
    please advice.
    mani

    Hi Manikandan,
    The following code may be helpful to understand how to select the data from cluster table.
    Types: Begin of ty_kna1,
    Kunnr type kna1-kunnr,
    adrnr type kna1-adrnr,
    end of ty_kna1,
    begin of ty_bseg,
    belnr type bseg-belnr,
    kunnr type bseg-kunnr,
    end of ty_bseg,
    begin of ty_final,
    belnr type bseg-belnr,
    kunnr type kna1-kunnr,
    adrnr type kna1-adrnr,
    end of ty_final.
    Data: it_kna1 type table of ty_kna1,
    wa_kna1 type ty_kna1,
    it_bseg type table of ty_bseg,
    wa_bseg type ty_bseg,
    it_final type table of ty_final,
    wa_final type ty_final.
    Select kunnr adrnr from kna1 into table it_kna1 where....
    if sy-subrc = 0.
    select belnr kunnr into table it_bseg for all entries in it_kna1 where kunnr = it_kna1-kunnr.
    endif.
    sort it_kna1 by kunnr.
    Loop at it_bseg into wa_bseg.
    move wa_bseg-belnr to wa_final-belnr.
    read table it_kna1 into wa_kna1 with kunnr = wa_bseg-kunnr binary search.
    if sy-subrc = 0.
    move: wa_kna1-kunnr to wa_final-kunnr,
    wa_kna1-belnr to wa_final-belnr.
    endif.
    append wa_final to it_final.
    clear wa_final.
    endloop.
    Loop at it_final into wa_final.
    write: / wa_final-belnr, wa_final-kunnr, wa_final-adrnr.
    endloop.
    Reward if useful.
    Thankyou,
    Regards.

  • Selecting Data from CE1* tables

    Hi guys!
    Why is it that when I select data from our CE1* table, it is faster to select
    PERIO = '2007.007'
    than to select
    GJAHR = '2007' and PERDE = '007'?
    Thanks!

    > Hi,
    >
    > Are you executing the query and Se16 in same client?
    > if you are then the reason can be that some of the
    > fields are case sensitive and you are passing data in
    > all Caps.
    >
    > Also you can check by accepting the data through
    > PARAMTERS rather than hard coding the stuff, the
    > reason can be that there are some converison routines
    > that convert the data into a format that is required
    > to fetch the data which may be Se16 does and your
    > hardcoding does not.
    >
    > Regards,
    > Sesh
    I found out now. It is because actual data for PALEDGER is '010' not '10'.
    Thanks anyway!

  • How can i extract data from oracle table  to flat file or excel spread shee

    Hello,
    DB Version is 10.1.0.3.0
    How can i extract data from oracle table to flat file or excel spread sheet by using sub programs?
    Regards,
    D

    Here what I did
    SET NEWPAGE 0
    SET SPACE 0
    SET LINESIZE 80
    SET PAGESIZE 0
    SET ECHO OFF
    SET FEEDBACK OFF
    SET VERIFY OFF
    SET HEADING OFF
    SET MARKUP HTML OFF SPOOL OFF
    Sql> SPOOL bing
    select * from -------;
    SPOOL OFF;
    I do not see file.
    I also tried
    Sql> SPOOL /tmp/bing
    select * from -------;
    SPOOL OFF;
    But still not seeing the fie,

  • Error while selecting date from external table

    Hello all,
    I am getting the follwing error while selecting data from external table. Any idea why?
    SQL> CREATE TABLE SE2_EXT (SE_REF_NO VARCHAR2(255),
      2        SE_CUST_ID NUMBER(38),
      3        SE_TRAN_AMT_LCY FLOAT(126),
      4        SE_REVERSAL_MARKER VARCHAR2(255))
      5  ORGANIZATION EXTERNAL (
      6    TYPE ORACLE_LOADER
      7    DEFAULT DIRECTORY ext_tables
      8    ACCESS PARAMETERS (
      9      RECORDS DELIMITED BY NEWLINE
    10      FIELDS TERMINATED BY ','
    11      MISSING FIELD VALUES ARE NULL
    12      (
    13        country_code      CHAR(5),
    14        country_name      CHAR(50),
    15        country_language  CHAR(50)
    16      )
    17    )
    18    LOCATION ('SE2.csv')
    19  )
    20  PARALLEL 5
    21  REJECT LIMIT UNLIMITED;
    Table created.
    SQL> select * from se2_ext;
    SQL> select count(*) from se2_ext;
    select count(*) from se2_ext
    ERROR at line 1:
    ORA-29913: error in executing ODCIEXTTABLEOPEN callout
    ORA-29400: data cartridge error
    KUP-04043: table column not found in external source: SE_REF_NO
    ORA-06512: at "SYS.ORACLE_LOADER", line 19

    It would appear that you external table definition and the external data file data do not match up. Post a few input records so someone can duplicate the problem and determine the fix.
    HTH -- Mark D Powell --

  • How to select data from a table by passing document number from another tab

    How to select data from a table by passing document number from another table.
    for eg:-
    I want to display name, adres, region from ADRC table
    by using field delivery document number
    Kind Regards,
    Shanbagavalli.S

    Hi Shanbagavalli,
    There are multiple solutions to this questions a few i will try to answer and then you can take the best required for your requirements.
    **Consider that you have a Internal table having document number from other table..
    SELECT NAME ADRES REGION FROM ADRC
           INTO IT_ADRC
           FOR ALL ENTRIES IN IT_DOC
           WHERE DOCUMENT_NO = IT_DOC-DOCUMENT_NO.
    **Consider that you have 1 document number then
    SELECT NAME ADRES REGION FROM ADRC
         INTO IT_ADRC
         WHERE DOCUMENT_NO = W_DOCUMENT_NO.
    Hope this solves your problem.
    Regards,
    Kunjal

  • Select data from two tables...!

    HI Experts...!
    i m a beginner user and i want to select data from two tables proj and prps.....using joins.....and internal tables i have written a code...
    SELECT prps~pspnr
           prps~objnr
           prps~psphi
           proj~ernam
           proj~erdat
           proj~pspnr
    INTO  table itab   -
    itab is internal table
    FROM prps inner join proj
    WHERE pspnr in p_no and prpspsphi = projpspnr.
    but there is error in from clause ..please help me....
    Advance thanx....

    Hi,
    check the sample code bellow above two reply will solve out your problem but one more extra line in your code pointed out bellow.
    TABLES: prps, proj.
    TYPES:  BEGIN OF ty_test,
            pspnr LIKE prps-pspnr,
            objnr LIKE prps-objnr,
            psphi LIKE prps-psphi,
            ernam LIKE proj-ernam,
            erdat LIKE proj-erdat,
            END OF ty_test.
    DATA: itab TYPE STANDARD TABLE OF ty_test WITH HEADER LINE.
    SELECT-OPTIONS: p_no FOR prps-pspnr.
    SELECT  prps~pspnr
            prps~objnr
            prps~psphi
            proj~ernam
            proj~erdat
    *        proj~pspnr " No need for this you have selected this in
    *     the first line because it is commone so you only need to select from any one
            INTO TABLE itab
    FROM prps INNER JOIN proj ON ( prps~pspnr = proj~pspnr  )
    WHERE prps~pspnr IN p_no.
    Best Regards,
    Faisal
    Edited by: Rob Burbank on Dec 24, 2009 12:24 PM

  • Selecting data from two tables

    I am trying to select data from two tables.  The only problem that I am running into, is that i am only seeing results from my 'uploads' table.  there is also a record in documents where user = 1 that should show up.  here is my sql:
    $userIDNum = 1;
    $sql="Select *
    from uploads, documents
    WHERE uploads.user = documents.user AND uploads.user = $userIDNum
    ORDER BY uploads.title ASC, documents.title ASC";

    You'll need to explain a little more about your data and what you are trying to accomplish. Your current sql will select all columns from both the uploads and documents tables but only rows where the user id in both tables match, AND the user id equals 1. Is that not what you are seeing? Where's the code that outputs the results?

  • Retrieve data from oracle table, table name passed in runtime into JSP

    Hello All,
    I am new to JSP, i have a requirement,
    I need to retrieve data from oracle table, here table is passed at random. how to get the data displayed in JSP page.
    can any one help me in that
    thanks

    1) Learn SQL.
    2) Learn Java.
    3) Learn JDBC.
    4) Learn DAO.
    5) Learn HTTP.
    6) Learn HTML.
    7) Learn JSP/Servlet.
    8) Learn JSTL.
    9) Apply learned things and develop.
    Whenever you stucks, please come back and post the specific coding/technical problem here.

Maybe you are looking for