Problem creating a table with a subquery and a dblink

Hello!!
I have a little problem. When I create a table with a subquery and a dblink, for example:
CREATE TABLE EXAMPLE2 AS SELECT * FROM EXAMPLE1@DBLINK
the table definition is changed. Fields with a type of CHAR or VARCHAR2 are created with a size three times bigger than the original table in the remote database. Field of type DATE and NUMBER are not changed. For example if the original table, in the database 1, has a field of type CHAR(1) it is create in the local database with a type of CHAR(3), and a VARCHAR2(5) field is created with VARCHAR2(15).
Database 1 has a WE8DEC character set.
Database 2 has a AL32UTF8 character set.
Could it be related to the difference in character sets?
What can I do to make Oracle use the same table definition when creating a table in this way?
Thanks!!

That is related to character sets, and probably necessary if you want all the data in the remote table to be able to fit in the new table.
When you declare a column VARCHAR2(5), by default, you're allocating 5 bytes of storage. In a single-byte character set, which I believe WE8DEC is, that also happens to equate to 5 characters. In a multi-byte character set like AL32UTF8, though, 1 character may require up to 3 bytes of storage, so you'd need to allocate 15 bytes to store that data. That's what's going on here.
You could still store all the data if you create the table locally by explicitly requesting 5 characters of storage by declaring the column VARCHAR2(5 CHAR). You could also set the NLS_LENGTH_SEMANTICS parameter to CHAR rather than BYTE before creating the table, but I believe that both of these will only apply when you're explicitly defining columns as part of your CREATE TABLE. I don't believe either will apply to CTAS statements.
Justin

Similar Messages

  • How to create a table with datatype blob and insert a pdf file (ravi)

    how to create a table with datatype blob and insert a pdf file,
    give me the explain asap
    1.create the table?
    2.insert the pdffiles into tables?
    3.how to view the files?
    Thanks & Regards
    ravikumar.k
    Edited by: 895044 on Dec 5, 2011 2:55 AM

    895044 wrote:
    how to create a table with datatype blob and insert a pdf file,
    give me the explain asapPerhaps you should read...
    {message:id=9360002}
    especially point 2.
    We're not just sitting here waiting to answer your question as quickly as possible for you.

  • Problem creating Allocation Table with Reference to a PO

    Dear Folks,
    I am having problems creating an allocation table with reference to a PO in T-code WA01.
    I read the SAP help that some prerequisites need to exist:
    ==> You can only reference order items flagged as being relevant to a stock split (the Allocation table relevant indicator in the additional item data).
    Can anyone advice me where to find this stock split indicator?
    Also, can anyone advice me how to reuse an allocation table? For example, I had previously created an allocation table with many articles and various allocation rules. I already generated follow on documents for this table.
    Say after 2 weeks, I have the similar requirements that I can make use of the same table, only with minor adjustments to the quantity. How do I create a new allocation table using the existing allocation table data?
    Thanks and Regards
    Junwen

    Any idea please?
    thanks

  • Opening file present in treeview by clicking on it within a table? I had created a table with a row and two columns. in one column i had dislayed treeview and want that if i click on the file in treeview it gets opened in other column. Can this happen?

    I also got a code in some website related to my problem but there are errors in this code that i am not able to understand can you correct those errors:
    using System;
    using System.IO;
    using System.Collections;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Web;
    using System.Web.SessionState;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.HtmlControls;
    using Microsoft.Web.UI.WebControls;
    namespace shark.TreeView
    /// <summary>
    /// Summary description for DocTree.
    /// </summary>
    public class DocTree : System.Web.UI.Page
    protected Microsoft.Web.UI.WebControls.TreeView TreeCtrl;
    public DocTree()
    Page.Init += new System.EventHandler(Page_Init);
    private void Page_Load(object sender, System.EventArgs e)
    if ( ! this.IsPostBack )
    // add tree node "type" for folders and files
    string imgurl = "/shark/webctrl_client/1_0/Images/";
    TreeNodeType type;
    type = new TreeNodeType();
    type.Type = "folder";
    type.ImageUrl = imgurl + "folder.gif";
    type.ExpandedImageUrl = imgurl + "folderopen.gif";
    TreeCtrl.TreeNodeTypes.Add( type );
    type = new TreeNodeType();
    type.Type = "file";
    type.ImageUrl = imgurl + "html.gif";
    TreeCtrl.TreeNodeTypes.Add( type );
    // start the recursively load from our application root path
    // (we add the trailing "/" for a little substring trimming below)
    GetFolders( MapPath( "~/./" ), TreeCtrl.Nodes );
    // expand 3 levels of the tree
    TreeCtrl.ExpandLevel = 3;
    private void Page_Init(object sender, EventArgs e)
    InitializeComponent();
    // recursive method to load all folders and files into tree
    private void GetFolders( string path, TreeNodeCollection nodes )
    // add nodes for all directories (folders)
    string[] dirs = Directory.GetDirectories( path );
    foreach( string p in dirs )
    string dp = p.Substring( path.Length );
    if ( dp.StartsWith( "_v" ) )
    continue; // ignore frontpage (Vermeer Technology) folders
    nodes.Add( Node( "", p.Substring( path.Length ), "folder" ) );
    // add nodes for all files in this directory (folder)
    string[] files = Directory.GetFiles( path, "*.aspx" );
    foreach( string p in files )
    nodes.Add( Node( p, p.Substring( path.Length ), "file" ) );
    // add all subdirectories for each directory (recursive)
    for( int i = 0; i < nodes.Count; i++ )
    if ( nodes[ i ].Type == "folder" )
    GetFolders( dirs[ i ] + "\\", nodes[i ].Nodes );
    // create a TreeNode from the specified path, text and type
    private TreeNode Node( string path, string text, string type )
    TreeNode n = new TreeNode();
    n.Type = type;
    n.Text = text;
    if ( type == "file" )
    // strip off the physical application root portion of path
    string nav = "/" + path.Substring( MapPath( "/" ).Length );
    nav.Replace( '\\', '/' );
    n.NavigateUrl = nav;
    // set target if using FRAME/IFRAME
    n.Target="doc";
    return n;
    #region Web Form Designer generated code
    /// <summary>
    /// Required method for Designer support - do not modify
    /// the contents of this method with the code editor.
    /// </summary>
    private void InitializeComponent()
    this.Load += new System.EventHandler(this.Page_Load);
    #endregion
    and the design that i got on website for the code that i displayed just above it is
    <%@ Register TagPrefix="iewc" Namespace="Microsoft.Web.UI.WebControls" Assembly="Microsoft.Web.UI.WebControls" %>
    <%@ Page language="c#" Codebehind="DocTree.aspx.cs" AutoEventWireup="false" Inherits="shark.TreeView.DocTree" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
    <HTML>
    <HEAD>
    <meta content="Microsoft Visual Studio 7.0" name="GENERATOR">
    <meta content="C#" name="CODE_LANGUAGE">
    <meta content="JavaScript (ECMAScript)" name="vs_defaultClientScript">
    <meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
    </HEAD>
    <body>
    <form id="DocTree" method="post" runat="server">
    <table height="100%" cellSpacing="0" cellPadding="8" border="0">
    <tr height="100%">
    <td vAlign="top">
    <iewc:treeview id="TreeCtrl" runat="server" SystemImagesPath="/shark/webctrl_client/1_0/treeimages/">
    </iewc:treeview>
    </td>
    <td vAlign="top" width="100%" height="100%">
    Click on any *.aspx page in the tree and it should load here <iframe id="doc" name="doc" frameBorder="yes" width="100%" scrolling="auto" height="100%">
    </iframe>
    </td>
    </tr>
    </table>
    </form>
    </body>
    </HTML>
    This is my code for viewing treeview but it is not expanding plz help me in this also
    using System;
    using System.Collections.Generic;
    using System.Configuration;
    using System.Data;
    using System.IO;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;
    using System.Media;
    using System.Drawing;
    using System.Drawing.Imaging;
    public partial class _Default : System.Web.UI.Page
    protected void Page_Load(object sender, EventArgs e)
    if (Page.IsPostBack == false)
    System.IO.DirectoryInfo RootDir = new System.IO.DirectoryInfo(Server.MapPath("~/Files"));
    // output the directory into a node
    TreeNode RootNode = OutputDirectory(RootDir, null);
    // add the output to the tree
    MyTree.Nodes.Add(RootNode);
    TreeNode OutputDirectory(System.IO.DirectoryInfo directory, TreeNode parentNode)
    // validate param
    if (directory == null) return null;
    // create a node for this directory
    TreeNode DirNode = new TreeNode(directory.Name);
    // get subdirectories of the current directory
    System.IO.DirectoryInfo[] SubDirectories = directory.GetDirectories();
    // OutputDirectory(SubDirectories[0], "Directories");
    // output each subdirectory
    for (int DirectoryCount = 0; DirectoryCount < SubDirectories.Length; DirectoryCount++)
    OutputDirectory(SubDirectories[DirectoryCount], DirNode);
    // output the current directories file
    System.IO.FileInfo[] Files = directory.GetFiles();
    for (int FileCount = 0; FileCount < Files.Length; FileCount++)
    DirNode.ChildNodes.Add(new TreeNode(Files[FileCount].Name));
    } // if the parent node is null, return this node
    // otherwise add this node to the parent and return the parent
    if (parentNode == null)
    return DirNode;
    else
    parentNode.ChildNodes.Add(DirNode);
    return parentNode;
    This is my design
    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
    <!DOCTYPE html>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
    <title></title>
    <style type="text/css">
    .auto-style2
    width: 412px;
    .auto-style3
    width: 174px;
    .auto-style4
    width: 743px;
    .auto-style5
    width: 506px;
    height: 226px;
    </style>
    </head>
    <body>
    <form id="form1" method="post" runat="server">
    <table align:"center" class="auto-style4" border="1" style="table-layout: fixed; border-spacing: 1px">
    <tr>
    <td class="auto-style3">
    <br />
    <br />
    <br />
    <br />
    </td>
    <td class="auto-style2">
    <br />
    <br />
    <br />
    <br />
    </td>
    </tr>
    <tr>
    <td class="auto-style3" valign="top">
    <asp:TreeView Id="MyTree" PathSeparator = "|" ExpandDepth="0" runat="server" ImageSet="Arrows" AutoGenerateDataBindings="False">
    <SelectedNodeStyle Font-Underline="True" HorizontalPadding="0px" VerticalPadding="0px" ForeColor="#5555DD"></SelectedNodeStyle>
    <NodeStyle VerticalPadding="0px" Font-Names="Tahoma" Font-Size="10pt" HorizontalPadding="5px" ForeColor="#000000" NodeSpacing="0px"></NodeStyle>
    <ParentNodeStyle Font-Bold="False" />
    <HoverNodeStyle Font-Underline="True" ForeColor="#5555DD"></HoverNodeStyle>
    </asp:TreeView>
    </td>
    <td class="auto-style2">
    <base target="_blank" /> <iframe frameborder="0" scrolling="yes" marginheight="0" marginwidth="0"
    src="" class="auto-style5"></iframe>
    </td>
    </tr>
    </table>
    </form>
    </body>
    </html>

    Hi meghage,
    From your code, it is a WebForm project.
    This forum is to discuss problems of Windows Forms. Your question is not related to the topic of this forum.
    You can consider posting it in asp.net forum for supports . Thanks.
    ASP.NET: http://forums.asp.net
    Regards,
    Youjun Tang
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to create a table with these dimensions?

    Still new to Indesign but I need to create a table like the one below.
    Selecting the text tool, I created a text frame and then inserted a table. However, I am lost as to how to edit the top row to be the length of the bottom two columns.
    I looked at the tables panel options but it only allows me to edit the number of rows and columns.
    Any advice is appreciated. Thanks.

    You have to create a table with two rows and two columns.
    Than select first row and clic "merge cells"

  • How to create a table with editable column values.

    Hi everyone,
    I think this is very simple but i'm not able to find how to do this. This is my requirement. I need to create a table with n columns and 1 row initially. user should be able to enter data into this table and click of a button should insert data into the data base table. Also there should be a button at the bottom of the table to add 1 row to the table.
    I know how to do the insert to database, but can anyone please let me know how to create a table that allows user to enter data and how to create a add 1 row button?
    Thanks in Advance!

    Raghu,
    Go through the ToolBox tutorial Create Page & Advanced table section of OAF Guide.
    Step 1 - You require to create EO & a VO based on this EO. This EO will be of DataBase table where you want to insert the data.
    Step 2 - Create a Advanced table region. (Refer this Adavanced table section for more on this)
    Step 3 - Attach this VO in the BC4J component of Adavanced Table region.
    Regards,
    Gyan

  • HT204088 Dear sirs,  Could you please help me on my problem with my apple ID  I create new account with security questions, and when I try to purchase paid application,it ask me for answers the questions but it's not working,  My account have 50$ and stil

    Dear sirs,
    Could you please help me on my problem with my apple ID
    I create new account with security questions, and when I try to purchase paid application,it ask me for answers the questions but it's not working,
    My account have 50$ and still didn't buy anything

    You need to ask Apple to reset your security questions; ways of contacting them include clicking here and picking a method for your country, phoning AppleCare and asking for the Account Security team, and filling out and submitting this form.
    (100546)

  • How to Create a Table with Merge and partitions in HANA

    Hi,
    What is the best way to create a Table with MERGE and PARTITION and UNLOAD PRIORITIES.
    Any body can you please give me some examples.
    Regards,
    Deva

    Ok,
    1) the UNLOAD PRIORITY has nothing to do with the order of data loads in your ETL process
    2) Unloading of columns will happen automatically. Don't specify anything specific for the tables, then SAP HANA will take care about it
    3) Not sure where you get your ideas from, but there is no need to manually "flush" tables or anything like that. SAP HANA will take care of memory housekeeping.
    4) Partitioning and how to specify it for tables has been largely documented. Just read up on it.
    5) Delta Merge will happen automatically, as long as you don't prevent it (e.g. by trying to outsmart the mergedog rules)
    Seriously, I get the impressions that this list of requirements is based on some hear-say and lack of actual information and experience with SAP HANA. There are a couple of extensive discussions on data loading optimization available here in SCN and on SAPHANA.COM. Please read those first.
    All this had been discussed broadly a couple of times.
    - Lars

  • Pros and cons of creating a table with key

    Hi Folks
    I have some tables where there is no key defined in the source system. What is the best way to build such tables. In my case the source system is Teradata.
    I have 25-30 columns in dimension and what is the best way to load this data where there is no.
    What will be the Pros and Cons if I have a table without a key  or if I create a table with 25-30 keys.
    regards
    Poonam

    I recently purchased a Mac Mini and am using it with my TV.  Here's what I found:
    Using the HDMI connection on the Mac Mini, the image on the TV is very harsh.  It's very bright, high contrast and garish colors.  I did a lot of testing and am convinced this is due to the HDMI Display Profile in OS X Yosemite.  I could not find any way to change the display profile in the Mac Mini as long as HDMI was the connection.
    Using the miniDisplayport/Thunderbolt connection on the Mac Mini, with the Apple miniDisplayPort-DVI adapter and a DVI-HDMI cable the picture is perfect.  (Note, however, that this connection only carries video; if you want audio you will have to use a separate cable to connect the Mac Mini audio line out port to your TV's audio line in port.)
    That said, the larger the TV the less quality you will have displaying text.  I suggest using a 21" or smaller TV as a monitor if you will be doing text work.
    My setup is with a 40" Sony Bravia 1080p HDTV and the primary use is for video (concerts, movies, Skype, etc), not office apps.   As I said earlier, the picture is perfect - brightness, contrast, colors, resolution are as nice as I could ask for.

  • How to create a table with table maintanence

    Hi Friends,
    I want to create a table with the following fields.
    1. MANDT
    2. BUDAT
    3. WAERS
    4. KURSF
    And i need to maintain the table (User will maintain the table... like they'll add items to it)
    What are all the steps i should follow ???
    Thanks in advance.
    Cheers
    R.Kripa.

    I have solved the problem ..
    Sailatha thanks anyway
    The problem i faced was;
    I created the table ...... with all the fields as keys ..
    When i executed TCODE SM30 (Maintain Table) it said ... "View/table can be only maintained with  resrictions " and hence then it dint allow  me to maintain ... ;-(
    So then i changed the "Maintanence"  status to "Display/Maintance" allowed.
    thats how my problem of maintaining the table solved!!!
    Thanks
    Cheers
    R.Kripa.

  • Not able to create a table with more than 64 fields in dictionary

    Hi,
    I have created a java dictionary in Netweaver Developer studio. I have to create a table with more than 64 fields in it. I was able to create the table in dictionary, but when i tried to build it, I am getting an error message as "more than 64 fields are not allowed". If i create the table with 64 fields or below 64 fields, i can build the dictionary and deploy it.
    That is, when i create a table with more than 64 fieds, I am not able to compile the dictionary, But if i reduce the fields to 64 or below, i can compile the dictionary.
    Kindly help me to solve the problem.
    Regards,
    Sudheesh

    Hi,
    Sudheesh,as far as I am aware creating of fields in the table actually depends on the total width of table that can be used for various Vendors.
    So I actually tried out creating a table with too many fields,and I am reproducing the errors which I have obtained -
    <i>Error               Dictionary Generation: <b>DB2:checkWidth TMP_1: total width of table (198198 bytes) greater than allowed maximum (32696 bytes)</b>     TMP_1.dtdbtable     TestDictionary/src/packages     
    Error               Dictionary Generation: <b>DB4:Table TMP_1: fixed length: 198366 (32767).</b>     TMP_1.dtdbtable     TestDictionary/src/packages     
    Error               Dictionary Generation: <b>DB6:checkWidth TMP_1: total width of table (297200) including row overhead is greater than the allowed maximum for 16K tablespaces .</b>     TMP_1.dtdbtable     TestDictionary/src/packages     
    Error               Dictionary Generation: <b>MSSQL:checkWidth TMP_1: total width(198215) greater than allowed maximum (8060)</b>     TMP_1.dtdbtable     TestDictionary/src/packages     
    Error               Dictionary Generation: <b>SAPDB:checkWidth TMP_1: total width(198297) greater than allowed maximum (8088)</b>     TMP_1.dtdbtable     TestDictionary/src/packages     
    Error               Dictionary Generation: Table TMP_1 is not generated     TMP_1.dtdbtable     TestDictionary/src/packages     </i>
    I hope you can understand what the errors state.I am trying to create a table whose total width(sum of width all columns) is greater than the maximum allowed for various Vendors,such as DB2,MSSQL,SAPDB etc.
    I hope this answer helps you create your table suitably
    Regards,
    Harish
    (Please award points if this answer has been usefull)

  • Pages won't allow me to create a table with just one row.

    I'm trying to create a one row, two colum table in Pages. I have no problem with the columns. But I cannot create the table with just one row. Two rows apppears to be the minimum. Any ideas??

    In Pages 5.2, click the equal sign at bottom-left of table and reduce the row count to one.

  • How to create a table with events in smartforms?

    How to create a table with events view in smartforms?
    It doesn't like general table with header, main area and footer.
    for example:
    in smartforms: LE_SHP_DELNOTE
    table name is TABLEITEM(Delivery items table)

    Vel wrote:
    I am creating XML file using DBMS_XMLGEN package. This XML file will contain data from two different database tables. So I am creating temporary table in the PL/SQL procedure to have the data from these different tables in a single temporary table.
    Please find the below Dynamic SQL statements that i'm using for create the temp table and inserting the data into it.
    Before insert the V_NAME filed, i will be appending a VARCHAR field to the original data.
    EXECUTE IMMEDIATE 'CREATE TABLE TEMP_TABLE (UNIQUE_KEY NUMBER , FILE_NAME VARCHAR2(1000), LAST_DATE DATE)';
    EXECUTE IMMEDIATE 'INSERT INTO TEMP_TABLE values (SEQUENCE.nextval,:1,:2)' USING V_NAME,vLastDate;What exactly i need is to eliminate the INSERT portion of it,Since i have to insert more 90,000 rows into it. Is there way to have the temp table created with data in it along with the sequence value as well.
    I'm using Oracle 10.2.0.4 version.
    Edited by: 903948 on Dec 22, 2011 10:58 PMWhat you need to do to eliminate the INSERT statement is to -- as already suggested by others - eliminate the temporary table. You don't need it. It is just necessary overhead. Please explain why you (apparently) believe that the suggestion of a view will not meet your requirements.

  • How to create a table with varied number of columns?

    I am trying to create a balance table. The colunms should include years between the start year and end year the user will input at run time. The rows will be the customers with outstanding balance in those years.
    If the user input years 2000 and 2002, the table should have columns 2000, 2001, 2002. But if the user input 2000 and 2001, the table will only have columns 2000 and 2001.
    Can I do it? How? Thanka a lot.

    Why did you create a new thread for this?
    How to create a table with varied number of columns?

  • How to create a table with more tan 20 columns

    I created a A4 landscape document to make a calendar for the next year.
    To add the date information I need to insert a table with 32 columns (name of month + 31 days). It should be possible to create a table with a over all width of 29.7 cm (consisting of 1 column of 4.9 cm and 31 columns with 0.8 cm)?
    Remark: Yet reduced all indention's (? German: Einzug) and other spacers and the size of used font of the table.

    Hello Till,
    unfortunatly Pages connot create a table with more than 20 columns. This is no question of size or place.
    But you can create two tables, set the most right border of the fist table to "no line" and align the second table (with the other 12 columns) at the right side of the first table. Now you have "one" table with 32 columns.
    I have done this with my driving book (Fahrtenbuch, um es korrekt zu schreiben and it works fine.
    Frank.

Maybe you are looking for

  • Hp 7510 Printer Still not able to access eFax!?

    Why it is taking so long for HP to fix the issue regarding the eFax function on this printer? The reason I purchased this printer because of the fax funtion. But now, it keeps on saying "Connect to a Network"? will it is printing wireless from my pho

  • How to pull data from Active Directory in ABAP (non-CUA approach)?

    All, We have a requirement to pull information from AD into a WAS 6.20 system. I know there is the standard CUA/UME LDAP synchronization discussed at length in this forum but this in not what we are looking for. We would like to connect from an ABAP

  • Mapping Issue - Urgent

    Source <source> <Record> <Date>5/15/2008</Date> <DocType>ZL</DocType> <CompCode>1010</CompCode> <GL_Account>21300119</GL_Account> <Amount>14,357.83</Amount> </Record> <Date>5/5/2008</Date> <DocType>ZL</DocType> <CompCode>1020</CompCode> <GL_Account>2

  • Genius Icon in Top Bar

    I just upgraded to iTunes 8.0.1.11 and I noticed that upon starting it, Genius ran again (presumably to get info from new music I've added since I last ran genius) and then after that I noticed what I think is a new genius icon appear in the top info

  • Java Dynpro does not used portal default theme.

    Dear Expert, We have recently upgraded our support pack and everything works fine except the portal theme. We have our customize portal theme and we make it as the default portal theme. Everything looks fine with the portal where the customize theme