Appending data with different type

In follow up to an earlier post, regarding appending data from one table to anlther, please could I have some advice on the appropriatness of using certain data types to accommodate data from a non-SQL data type?
The following is displayed as
non-SQL data type > SQL data type
i) Real > FLOAT
ii) Integer > NUMBER
iii) Boolean > VarChar2
iv) Character > CLOB
v) Integer > FLOAT
vi) Date > VarChar2
My feeling is that i), ii), v) are acceptable, and the rest not acceptable. Please let me know if you disagree.
From an earlier post, I gather that "to_char" is better than "VarChar2" when holding numerical data.
Many thanks

803242 wrote:
In follow up to an earlier post, regarding appending data from one table to anlther, please could I have some advice on the appropriatness of using certain data types to accommodate data from a non-SQL data type?If you are copying data from one table to another, only SQL types are relevant because you cannot create tables with columns using non-SQL types.
The following is displayed as
non-SQL data type > SQL data type
i) Real > FLOAT
ii) Integer > NUMBER
iii) Boolean > VarChar2
iv) Character > CLOB
v) Integer > FLOAT
vi) Date > VarChar2
Only boolean that you have listed as non-SQL types, is actually a non-SQL type.
From an earlier post, I gather that "to_char" is better than "VarChar2" when holding numerical data.For holding numerical data you would use number or a variation such as integer or real, you would definitely not use varchar2. to_char is a data type conversion function, not a data type so is irrelevant.

Similar Messages

  • How to read data with different XML schemas within the single connection?

    I have Oracle 11g database
    I access it through jdbc:oracle:thin, version 11.2.0.3, same as xdb.
    I have several tables, each has one XMLType column, all schema-based.
    There are three different XML schemata registered in the DB
    I may need to read the XML data from several tables.
    If all the XMLTypes have the same XML schema ,there is no problem,
    If the schemata are different, the second read throws BindXMLException.
    If I reset the connection between the reads of the XMLType column with different schemata, it works.
    The question is: how can I configure the driver, or the connection to be able to read the data with different XML schemata without resetting the connection (which is expensive).
    The code to get the XMLType data is textbook implementation:
    1   ResultSet resultSet = statement.executeQuery( sql ) ;
    2   String result = null ;
    3    while(resultSet.next()) {
    4   SQLXML sqlxml = resultSet.getSQLXML(1) ;
    5   result = sqlxml.getString() ;
    6   sqlxml.free();
    7   }
    8   resultSet.close();
    9    return result ;

    It turns out, that I needed to serialize the XML on the server and read it as Blob. Like this:
    1    final Statement statement = connection.createStatement() ;
    2    final String sql = String.format("select xmlserialize(content xml_content_column as blob encoding 'UTF-8') from %s where key='%s'", table, key ) ;
    3   ResultSet resultSet = statement.executeQuery( sql ) ;
    4   String result = null ;
    5    while(resultSet.next()) {
    6   Blob blob = resultSet.getBlob( 1 );
    7   InputStream inputStream = blob.getBinaryStream();
    8   result = new Scanner( inputStream ).useDelimiter( "\\A" ).next();
    9   inputStream.close();
    10   blob.free();
    11   }
    12   resultSet.close();
    13   statement.close();
    14
    15   System.out.println( result );
    16    return result ;
    17
    Then it works. Still, can't get it work with XMLType in resultset.On the client unwrapping XML blows up when trying to switch to different XML schema. JDBC/XDB problem?

  • Mix source data with different granularity into the same fact table?

    I have two transaction tables "Incident (157 columns)" and "Unit (70 Colums)". For every "Incident" that happens there could be one or more records in the "Unit" table.
    As part of my data mart design, I have merged both the tables into a single Fact "Incident Fact (227 Columns)" and inserted the records from both the tables with a join condition between them [incident.IN_NUM = Unit.IN_NUM].
    Is this correct, is my question? or am I mixing source data with different granularity in the same fact table. Appreciate your help.
    Best Regards
    Bees

    Bees,
    Are the measures from 'Incident' , repeated for a given incident where it has more than one record in the Unit table ? If so, then the sum(indicent.measure) will give an incorrect result, no ?
    What requirement is there to physically merge the tables together outside of OBIEE? With OBIEE you could have one logical 'fact' table to present to report users, which sourced from seperate Incidents and Units tables and would stop the incorrect aggregations occuring. A common modelling piece in the same way would be Order Headers and Order Lines, quite common in OBIEE to have a logical 'Orders' fact which contained both Order header measures and Order line measures, this translates to your Incidents -> Units relationship.
    To do what I've mentioned, is relatively straight forward, you need a 'Dim - Incident' with two levels, Incident and Unit, mapp the unique identifiers in as the level keys and then use these levels to set the content levels correctly in your 2 logical tables sources for logical 'Fact' , ie Incidents LTS at incident level, Units LTS as units level.
    Hope this helps, let us know if you get stuck.
    Cheers
    Alastair

  • How to append data from different import files?

    Dear experts,
    The customer is having different applications running that will output imports files BPC needs at a different time of process. Is it possible to append data which already exist in BPC from import?
    eg. BPC already has a record
    Factory1, Actual, 2008.OCT, Movement1, 30
    import file-
    Factory1, Actual, 2008.OCT, Movement1, 100
    and I need to add them up to become 130.
    Looks like regular import will only replace the original record by the new imported value. I'm still trying...
    Thanks a lot,
    Jim Hsu

    I do not think there is a way to use a standard import package to perform this action.  Typically when you are importing, you are saying this is the new value.  Not increment/decrement the value. 
    I have never had to implement a solution for a problem like this.  However, I would write a custom SSIS package that would extract the BPC data for the same dimensionality being imported and append it with the import file, then import the combined file.  Values sharing the same dimensionality in the same import file are aggregated on the actual import.
    SO your input file has 30, the export gets 100, the combined file has both and the actual value imported would be 130.
    That would be the approach I would take, but others might have more experience in different areas.

  • Loading of data with different granularity and its reporting

    Hi gurus,
    Please help me with this problem. We are designing a cube based on some input requirements.
    Say for example, we are trying to build a infocube which will have to be drilled down by customer © & material(M). We have 3 input datasources (Flat files) with 3 different granularities.
    First 2 rows in the below are salescustomer. Next 2 rows are SalesMaterials sold and the last row as salescustomermaterial.
    Customer     Material      Sales
    C1          -          $100
    C2          -          $200
    -          M3          $300
    -          M4          $400
    C1          M3          $500
    What is the reporting result when the query is run for sales drilled down by customer  C1 ?
    Please help !

    Hi Kapardhi,
    Based on your description it seems that you will three updat rules and in the cube you are going to  have three characteristics Customer material and sales.
    Now it depends upon the time characteristics of the cube if you have mapped from all the three data sources same type of time caharacteristic.
    make sure that the time characteristic from all the datasources should be at the same level.
    Suppose if  use 0calday in the cube and update it from the same type of date from all the datasource like "creation date".This will make the data in the cube atthe most grnaular level adn proper aggregation.
    After this you will get the following type of data in the cube for C1
    C1 M3 900.
    So when you drill down bt cuatomer you will get 900.
    Hope it helps
    Thanks

  • Problems working with different types of aggregation in two facts table

    Hello every Body!! Greetings from Brazil..
    At fisrt I'd like to say that I've tried to find some thead with the same problem, but I've foud no answere. That is why I'm typing this new post.
    Here we go ...
    I've a Fact table with one metric and two degenerate dimensions..
    For exemple:
    Invoice_number
    Puschase_Date
    Purchase_Value$
    When I model it at Business Model Mapping, I used the Aggregation's type below:
    Invoice_number - None
    Puschase_Date - None
    Purchase_Value - Sum
    So far it works fine at Answeres area.. Since I use only values from this Fact..
    But... if I try to join values from two different Facts Table (both of them sharing the same Dimensions) and the Second Fact has an aggregated value, it does'nt work... I get 'null' as values (metrics) of the second Fact Table...
    I think that it is caused because I'm working whith different types of aggregation, but I don't know the solution.
    By the wat, the second Fact I've told has only one metric, aggregated whith 'SUM'.
    Is there a solution? Any hint?
    Tks.
    Vettore

    int x = (int)(7 + 3.0 / 4.0 * 2); //the variable will do the math bracket first. then the va type will still be an int because int was never changed.
    Following the standard order of operations, 3.0/4.0 will result in a double, then 2 will be converted to a double before being multiplied to the result, then 7 is converted to a double before being added to the result, and then the (int) cast will force a conversion
    back to an int.
    Console.WriteLine((1 + 1) / 2 * 3); // 1 + 1 will be done first then 1 / 2 then * by 3
    Correct.
    I THINK THATS ALL WRONG ^ =/ like the comments
    Why?

  • Collecting same data with different value into a table

    Hi,
    Can you people help me with this problem.
    I have an internal table with different data e.g :
    A    2
    B    1
    C    3
    A    1
    D    7
    B    5
    Now i want to put the values of A,B,C,D into another internal table with some other calculation done.
    But when i am using READ Table with KEY my second internal table is getting filled with A=2 and the second A=2 as well instead of 1.I guess because it is reading the first record only as its finding A first.
    How will i fix this one.
    Kind Regards,

    >
    Prasenjit Sengupta wrote:
    > Hi,
    >
    > Can you people help me with this problem.
    > I have an internal table with different data e.g :
    > A    2
    > B    1
    > C    3
    > A    1
    > D    7
    > B    5
    > Now i want to put the values of A,B,C,D into another internal table with some other calculation done.
    > But when i am using READ Table with KEY my second internal table is getting filled with A=2 and the second A=2 as well instead of 1.I guess because it is reading the first record only as its finding A first.
    > How will i fix this one.
    >
    > Kind Regards,
    Can you tell me the exact requirement of yours?

  • Multiple channel data with different time stamp logging

    I have peaks and valleys from multiple channels with different time stamp but I am not able to log to a single file. Any idea on how to do this?
    Attachments:
    Single Point Peak Valley Log.vi ‏53 KB

    Hi Dennis,
    Sorry for that I have modified the VI.
    Because the peak and valley of every channel will occur at different time and I want to log the peak/valley with the time stamp.
    How can I log them on the same file.
    Attachments:
    Single Point Peak Valley Log_Mod.vi ‏53 KB

  • Regarding appending data in table type

    Hello Experts,
    Actually, I have one structure and in that I am using one table type .
    e.g. in the main structure, fields are as follows,
      po_number   po_line_item_no  gr_details
    here gr_details is table type having following fields.
      gr_number gr_qty gr_date
    As we all know that one po can have multiple GR,
    I want to append entries in the above structure in such a way that for one po entry , in the same record , multiple Gr entries should come.
    I am doing one program , in it is mendatory.
    can anyone please revert back on the same with High Priority ( Coding in Program to append values as per explained above ).
    Best Regards,
    Rashmi.

    Hi!
    For the same PO entry multiple GRs in same record is not possible. But you can have multiple GR entries in your internal table with same PO details.
    For eg. If you have one PO with 4 GRs then you will have 4 lines in internal table that belong to same PO but different GRs. In this case PO details would be redundant.
    To read these values into internal table
    1. You can read the GR details into corresponding columns of internal table and then update the PO columns for these records.
    2. The other bit diffcult way could be to read all PO details into internal table. Then loop at internal table for each PO find out the no. of GRs. If it has N no of GRs then add (N-1) rows with same PO details and different GR details and update the N the GR detail into the existing row of the internal table. If it has only 1 GR then update the existing line. If PO has no GR then delete the table line.
    Reward points for all the useful answers.

  • Exratcing data of different types from a Vector

    Hello Evryone
    Hope all is well,
    I'm having difficulties in extracting resultsets of different data types, from a vector, the following code is an extract from my remote server implementations; it works fine on the client side providing im only extracting a string.
    Server remote method (Implementaions)
    public Vector selecta(String query)throws SQLException,
    RemoteException
    Vector results=new Vector();
           ResultSet rs = statement.executeQuery(query);
           ResultSetMetaData metaData = rs.getMetaData();
           int columns = metaData.getColumnCount();
            int i=0;
              while( rs.next())
            for (int j=0; j<columns; j++)
             results.add(rs.getString( j+1 ));
             results.add(rs.getByte( j+1 ));
      return results;
    }The client side extract:
    Vector dataVector=new Vector();
       dataVector= data.selecta("SELECT columnname1" +
            "FROM Tablename");
           for (int i = 0; i <dataVector.size() ; i++)
            jcmbo.addItem( dataVector.get(i));
           } the above works only if i want to extract a string, and if the server impl didnt have the getbyte, is it possible pack all the resultset result of diffrent data type from the same table into a vector? and if it is, what mechanism would one use to extract each data type from a vector to put into diffrent components, e.g if one would want to put strings into a combo, like the above, and extract a byte[] with the use of type casting extract from the same vector and put in a lable.
    I've been trying and its resulted only in to extracting one data type, can any one please shed some light on the above scienario,
    thanking you in advance

    you can't do
    List list = new ArrayList(); // Better to use this rather than Vector;
    list.add(resultSet.getByte(1)); // Compile error - cannot add a primitive to a List.
    Instead use
    list.add(new Byte(resultSet.getByte(1)));
    You will of course on the Clientside need to check what type the column value is...
    eg
    if(list.get(3) instanceof Byte) {
    Byte b = (Byte) list.get(3);
    // do stuff here with the Byte instance.
    Hope that helps
    NB: Better would be to consider a structured approach to storing a result row such as a class whose instance represents a particular row in the results.
    Talden

  • File name with different type

    Hi,
    I need to send specific date format with file name to two different receivers. So the file name is same for both the two receivers but file extension is different. So I configured with dynamic configuration in UDF and in the receiver channel i have given .txt and .dat but it is not working. Can we do it in any other way.
    Thanks,
    kum

    Hi Kum,
    If I am not wrong, you must be using conditional receiver determination for determining 2 receivers.
    In this case, you can define 2 separate mappings which you can call in Interface determinations (2 interface determinations).
    In one mapping, you can have UDF for .txt file and in other .dat file.
    -Tanaya.

  • How convert date with different timezone?

    HI,
    My problem is pretty simple. I have one Date and given another time zone (as a string), I want to have another date object with a different time zone. I used jodaTime. The code is as follows:
    DateTimeZone zone = DateTimeZone.forID("US/Eastern");
    DateTime parsedDateTime = DateTimeFormat.forPattern("mm/dd/yyyy").withZone(zone).parseDateTime(dstr);
    System.out.println(parsedDateTime.toString());
    System.out.println(parsedDateTime.toDate().toString());The output is:
    2008-02-14T00:00:00.000-05:00
    Thu Feb 14 11:00:00 GMT+06:00 2008
    This is quite weird. As is obvious from the output, datetime stores date in the correct timezone. but when converted it to date it applies the jvm's timezone. Why is it so? And why is this time conversion mad e so difficult by providing zillions of classes and methods such as Date, Calendar etc.

    amishera2006 wrote:
    HI,
    My problem is pretty simple. I have one Date and given another time zone (as a string), I want to have another date object with a different time zone. I used jodaTime. The code is as follows:
    DateTimeZone zone = DateTimeZone.forID("US/Eastern");
    DateTime parsedDateTime = DateTimeFormat.forPattern("mm/dd/yyyy").withZone(zone).parseDateTime(dstr);
    System.out.println(parsedDateTime.toString());
    System.out.println(parsedDateTime.toDate().toString());The output is:
    2008-02-14T00:00:00.000-05:00
    Thu Feb 14 11:00:00 GMT+06:00 2008
    This is quite weird. As is obvious from the output, datetime stores date in the correct timezone. but when converted it to date it applies the jvm's timezone. Why is it so? And why is this time conversion mad e so difficult by providing zillions of classes and methods such as Date, Calendar etc.for the first question, i can't help you
    but for the second one, i guess it's for historic reasons (no defined standard at the beginning lead to a big mess, the same way as with encoding issues)

  • How to export/import data with different nls_lang???

    hello
    now i try to run my forms by APPLICATION SERVER to view the forms as web forms i success but data appear unreadable that it is arabic and i use the nls WE8ISO8859P1 so i change the nls to arabic like AR8MSWIN1256 but i faild so i create new database with charset UTF8 and nls_lang is AR8MSWIN1256 and try to insert new data when i do query about data ......the new data appear readable but the old unreadable so what can i do???
    i think that if i do export data and import it with new (charset and nls_lang) it will be success....but how can i do it??
    thank u
    regards

    Hi did you already exported data from SQL SERVER? if not using SQL*LOADER you cannot export data. SQL*LOADER is only mean for importing data from flat files(usually text files) into ORACLE tables.
    for importing data into oracle tables using sql*loader use below steps
    1) create a sql*loader control file.
    it looks like as follows
    LOAD DATA
    INFILE 'sample.dat'
    BADFILE 'sample.bad'
    DISCARDFILE 'sample.dsc'
    APPEND
    INTO TABLE emp
    TRAILING NULLCOLS
    or for sample script of control file search google.
    2) at command prompt issue following
    $ sqlldr test/test
    enter control file=<give control file name which you create earlier>
    debug any errors (if occured)

  • Audio issues with different types of sound cards

    For some reason different clips in Final Cut Pro are barely hearable depending on the audio card. The better speaker systems do fine but the basic set up can't play the clip without losing half the sound. This is a school broadcast so please let me know as simple as you can Thanks

    Hi WildcatPubs,
    Welcome to the Support Communities!
    What camera model are you working with?  Does it have 5.1 Surround Sound?
    Can you provide some additional details about the type of audio system you're using to play back that doesn't sound loud enough in Final Cut Pro X?  Are you playing back directly from the Mac's built-in speakers or connecting to a set of headphones or speakers?
    Have you adjusted the volume level and playback device in System Preferences so that other applications have sufficient audio level?
    Here's how:
    Mac Basics: Set your preferences
    http://support.apple.com/kb/HT2490
    Cheers,
    - Judy

  • HT204266 Two users of itunes with different types of apps.

    There are two users of itunes on my computer with completely different styles of music and apps.  My problem is when they sync, everything goes on each others ipod, which creates a big problem.  I can not figure out how to keep the apps separate.  With the music, I check and uncheck everything, since there are hundreds of songs, It is a big pain.  Is there an easier way?

    See:
    What is the best way to manage multiple...: Apple Support Communities
    How to use multiple iPods, iPads, or iPhones with one computer

Maybe you are looking for

  • Using java class and variables declared in java file in jsp

    hi everyone i m trying to seperate business logic form web layer. i don't know i am doing in a right way or not. i wanted to access my own java class and its variables in jsp. for this i created java file like this package ris; import java.sql.*; imp

  • Blue Screen Error on PC

    My C5180 All-in-one has, all of a sudden, stopped working. When trying to print, I get a blue screen-error and the pc reboots. The following is the error description provided by windows after the reboot: Name of Error: BlueScreen OS-version: 6.1.7600

  • Mail not getting new email

    I have had trouble getting Mail to go and get my new email. I believe that it is a problem with Mail, because I was able to check my mail online through my schools webmail address, and I also created an account on Entourage, and it worked there too.

  • Repartition a Boot Camp Windows partition

    I am trying to restore an Acronis 10 image backup on a Boot Camp Win partition. Acronis does not see the Win partition. I tried Partition Manager 8 to repartition inside the Win partition but PM says it cannot see the drive letters, though its small

  • How can I send my post directly to one of these smart guys on here?

    I'm afraid my post will just sit unanswered...this issue has been discussed but the solution noted did not fix the issue for me...I can't do any work with this transposing issue...every song I open has the midi transposed to another note from what I