Populate target table with default value

I have a query like this:
SELECT 0 AS ID,
9999999999 AS CODE
FROM DUAL
UNION ALL
SELECT VEH.TP_ID AS ID,
VEH.VEH_ID AS CODE
FROM TB_VEHICLE;
So I have an interface with two data sets, one for each query.
The first data set represents the "select from dual" "constant values" and the second represents the "select * from tb_vehicle".
In the first data set I don´t have a source, then ODI generates a select without a table "select 0 AS ID, 99999 AS CODE FROM".
Any ideas on how can I achieve my objective? I need to populate one row on target table with constant values.
Thanks

Alternatively , try this :
Duplicate the LKM and IKM you are using, create copies , something like LKM xyz (No Source) , IKM xyz (No Source).
Then adust the KM steps accordingly, remove the 'FROM' part and replace with VALUES ( ) , keeping the odiref substitution call in the parenthesis.
So you basically have a knowlede module that accepts no source data, generating :
insert into C$
(col 1, col 2, col 3 etc)
VALUES
(Target mapping 1, target mapping 2, target mapping 3 etc)
I've seen it done, nice and tidy, keeps all the lineage in ODI etc.

Similar Messages

  • How to Add column with default value in compress table.

    Hi ,
    while trying to add column to compressed table with default value i am getting error.
    Even i tried no compress command on table still its giivg error that add/drop not allowed on compressed table.
    Can anyone help me in this .
    Thanks.

    Aman wrote:
    while trying to add column to compressed table with default value i am getting error.This is clearly explain in the Oracle doc :
    "+You cannot add a column with a default value to a compressed table or to a partitioned table containing any compressed partition, unless you first disable compression for the table or partition+"
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_3001.htm#sthref5163
    Nicolas.

  • Table editor problem with default value for column

    Hi there,
    I'm trying to use SQL Developer 1.2.1 on Ubuntu 7.10 (though I don't think the OS is relevant) and I'm running into a snag when trying to update table structures. If you go to edit the table to say modify a column name, and that column has a default value set, SQL Developer is encapsulating the value with brackets and quotes. When trying to save the changes, it complains about the default value being 4 chars too many for the column width. An example of this would be a currency code column of varchar2 (3) set with EUR as the default. SQL Developer changes the value to ('EUR') hence the error.
    Is there anyway to prevent this from happening?
    Cheers,
    Chris

    Could you please be more specific? In 1.2.1.32.40 I
    added the column COL1 VARCHAR2(3) with default value
    'EUR'. The data display field refreshed to show the
    default value, so I edited it in a couple of entries
    and comitted the change without problem. Then I
    renamed the column from the "Edit table" popup menu.
    Finally, I renamed the column from the "Rename
    column" popup menu, no problem either.Ah, you are correct. That does work. What I was trying is select tablename in the object browser, then right click on it and select "Edit" from the contextual menu. You are then presented with edit table dialog box. If you then select a column in that box you will see a column properties box. In that section you can change the name, default value, datatype et cetera. Note that your default column value which should just be EUR (or 'EUR' to denote that it's a string) is now ('EUR'). Once you try changing the name to of the column to something else and then click OK, you should then get an error complaining of "Invalid varchar2 default value" with a more specific message of "Default values size 7 is greater than the allowed 3"
    You have provided a work around, and thanks for that, but it would be nice to edit everything in the Edit table dialog box if you're modifying more than one column name. I'm tasked with cleaning up a bit of a messy database, and there are a good deal of columns to be renamed.
    Cheers,
    Chris

  • In OWB I need to update the target table with same field for match/update

    In OWb I am trying to update the target table with the match and the update on the same field can this be done. I am getting a error match merge error saying you cannot update and match on the same field. But in SQl my select is
    Update table
    set irf = 0
    where irf = 1
    and process_id = 'TEST'
    Hwo do i do this in OWB.

    table name is temp
    fields in the table
    field1 number
    field2 varchar2(10)
    field3 date
    values in the table are example
    0,'TEST',05/29/2009
    9,'TEST',05/29/2009
    0,'TEST1',03/01/2009
    1,'TEST1',03/01/2009
    In the above example I need to update the first row field1 to 1.
    Update temp
    set field1 = 1
    where field1 = 0
    and field2 = 'TEST'
    when I run this I just need one row to be updated and it should look like this below
    1,'TEST',05/29/2009
    9,'TEST',05/29/2009
    0,'TEST1',03/01/2009
    1,'TEST1',03/01/2009
    But when I run my mapping I am getting the rows like below the second row with 9 also is getting updated to 1.
    1,'TEST',05/29/2009
    1,'TEST',05/29/2009
    0,'TEST1',03/01/2009
    1,'TEST1',03/01/2009

  • Portal Forms - How to make a Field with DEFAULT value NON-EDITABLE by Users

    I HAVE A FORM WITH A DATE FIELD ON IT WITH DEFAULT VALUE.
    THIS IS A TABLE-FIELD.
    I WANT THE FIELD TO BE DISPLAYED ON THE FORM BUT NOT TO ALLOW
    USERS TO EDIT/CHANGE IT.
    HOW CAN I DO THIS?
    TKS IN ADVANCE

    Hi,
    see Re: sequencing problem-Forms
    Regards Michael

  • Populate SQL table with data from Oracle DB in ODI

    Hi,
    I am trying to populate a source SQL table with fields from an Oracle db in ODI. I am trying to perform this using a procedure and I am am getting the following error:
    ODI-1226: Step PROC_1_Contract_Sls_Person_Lookup fails after 1 attempt(s).
    ODI-1232: Procedure PROC_1_Contract_Sls_Person_Lookup execution fails.
    ODI-1228: Task PROC_1_Contract_Sls_Person_Lookup (Procedure) fails on the target MICROSOFT_SQL_SERVER connection Phys_HypCMSDatamart.
    Caused By: weblogic.jdbc.sqlserverbase.ddc: [FMWGEN][SQLServer JDBC Driver][SQLServer]Invalid object name 'C2C_APP.CON_V'.
    My question is what is the best method to populate SQL db with data from an Oracle db? Using a procedure? A specific LKM?
    I found threads referring to using an LKM to populate Oracle tables with data from a SQL table....but nothing for the opposite.
    Any information would help.
    thanks,
    Eric

    Hi Eric,
    If using an Interface, I would recommend the LKM SQL to MSSQL (BULK) knowledge module. This will unload the data from Oracle into a file, then bulk load the staging db on the target using a BULK INSERT.
    Regards,
    Michael Rainey

  • How to preset fields in TA BP with default values

    Hi!
    I want to fill few fields in transaction BP with default values.
    This should be if there`s a new business partner to insert.
    If i can do this depending on the selected role it was the best
    First i thought on SPA/GPA-parameters ... but then i can`t do it in depence on the selected role.
    In customizing i can tell only if a field should be displayed or not, for input or not, ... but no values to insert.
    Is here anybody with a good idea for me?
    Thanks a lot in advance.
    Best regards,
    Ingo
    Edited by: Ingo Schmökel on Jul 1, 2008 7:20 PM

    Hi,
    There is one possibility which requires an enhancement of the
    BDT event ISDAT and a call to the function module
    BUP_BUPA_FIELDVALUES_SET. This means that an ISDAT function module needs to be written (transaction BUS7) which calls the function module BUP_BUPA_FIELDVALUES_SET with the needed values that are to be defaulted. You can read the role value using BUS_PARAMETERS_ISSTA_GET (T_RLTYP).The fields which are possible can be found in the DDIC structure BUSDEFAULT. However this is limited only to the fields inside this structure.
    Thanks and warm regards,
    Smita.

  • How to preset fields in a transaction BP with default values

    Hi!
    I want to fill few fields in transaction BP with default values.
    This should be if there`s a new business partner to insert.
    If i can do this depending on the selected role it was the best
    First i thought on SPA/GPA-parameters ... but then i can`t do it in depence on the selected role.
    In customizing i can tell only if a field should be displayed or not, for input or not, ... but no values to insert.
    Is here anybody with a good idea for me?
    I`ve posted my question first in crm-section but i think here it`s better
    Thanks a lot in advance.
    Best regards,
    Ingo

    Hi,
    There is one possibility which requires an enhancement of the
    BDT event ISDAT and a call to the function module
    BUP_BUPA_FIELDVALUES_SET. This means that an ISDAT function module needs to be written (transaction BUS7) which calls the function module BUP_BUPA_FIELDVALUES_SET with the needed values that are to be defaulted. You can read the role value using BUS_PARAMETERS_ISSTA_GET (T_RLTYP).The fields which are possible can be found in the DDIC structure BUSDEFAULT. However this is limited only to the fields inside this structure.
    Thanks and warm regards,
    Smita.

  • Populate word document with default metadata information

    Problem is revers as it is available in internet.  I have created list and
     columns. Which are populated  with default value. I have created word
     template. I can enter  data related to “Document properties”, ect. When I save that document to document library, I can see that filed data, that I type it in newly created word document.
    But because I have several project document library and sites, I would like to create library, 
    and fill all data with required values.  Then when I open new document from pre defied 
    template, I would like to have all fields  that are empty in document, to be filed 
    from  default columns value. Problem is, that when I save document, All fields are empty.
    There is no problem, upending document, and default properties are presented.
    How can I merge  default values from library, to word document ?

    I have word template, that I added-it as a site content type. It has all standard 
    fields  that are mapped to document library filed. If I open 
    new document in  document library, and input 
    required filed,  after  saving document, I can 
    see those fields in SharePoint document library (Item properties).
    Problem that I have is, following :
    When I open that  document “new document” from template, I would like to have all fields filed with default values of that particular library.
    Reason : Because  I will generate  hundred project (
    Each new library is based on new project, build fields are the same, values changes to mimic project)
    ),  I do not wont to create additional template, that would have required fields fill up wit project value, and add it to content type.. .
    I do not won`t to fill those properties manually.
    Option 1 :  After saving document based on template, it will fill out  
    required fields.
    Option 2: Create template, for each project, and save that template as project template, that users open, and save it to project Site/library.
    Option 1, is preferred.  Can that be done, when item is created, and copy project 
    information, from different location ?
    So I have  document library fields :
    Name of the project,  Projec Manager,  Project ref number, Contract, ...
    These filed are mapped to document filed :
    Name of the project,  Projec Manager,  Project ref number, Contract, ...
    I have document library : Project A
    Project A  ,  John dear, 
    REF2014_01_01, C1243332_2014, ...
    I have document library : Project B
    Project B ,  Same Jones ,  REF2014_03_05, AS563332_2014, ...
    I would like,  that when I save  document
     using New document (template),  that have those filed fill up. I do not wont to 
    create  new template for every project.

  • Trying to populate a table with data from WebRowset

    Hi,
    I want to be able to populate my tables with data from WebRowsets that have been saved to files. Everything goes good until I get to acceptChanges(). At which point I get a NullPointerException.
    Here's the code...
    WebRowSet wrs = new WebRowSetImpl();
    FileReader reader = new FileReader(inputFile);
    wrs.readXml(reader);
    wrs.beforeFirst();
    CachedRowSet crs = new CachedRowSetImpl();
    crs.setSyncProvider("com.sun.rowset.providers.RIXMLProvider");
    crs.populate(wrs);
    crs.beforeFirst();
    crs.acceptChanges(con);
    Results in...
    java.lang.NullPointerException
    at com.sun.rowset.CachedRowSetImpl.acceptChanges(CachedRowSetImpl.java:867)
    at com.sun.rowset.CachedRowSetImpl.acceptChanges(CachedRowSetImpl.java:919)
    I'm using Java 1.5_02. I looked at the source code for CachedRowSetImpl, and the only thing I could think of is that maybe "provider.getRowSetWriter()" in the following snippet is returning null....
    public void setSyncProvider(String s)
    throws SQLException
    provider = SyncFactory.getInstance(s);
    rowSetReader = provider.getRowSetReader();
    rowSetWriter = (TransactionalWriter)provider.getRowSetWriter();
    Any ideas?? Thanks!

    I have the same problem after setting com.sun.rowset.providers.RIXMLProvider.
    Looks like a bug to me.
    By the way, why are you creating a new CachedRowSet and populate it with a WebRowset (which extends CachedRowSet)?

  • Report-to-Report Interface problem with default values

    Hi all.
    I have RTR interface where target query has default values, so when I jump to target query it doesn't return whole data because of this default filter.
    Is it possible to remove this default filter in query in case it is executed through Report-To-Report?
    I still need this default filter then I execute target query separately.

    Dear Gediminas,
    Make sure that you have same infoobjects which are having default values present in the 2 queries.
    After createing settings in RRI...select that setting.....click on ASSIGNMENT DETAILS tab...
    Assign Type as how they are in 1st query...
    Assign selection type as how they are in 1st query...
    Assign GENERIC to the rest of the fields..
    Cintinue
    Save.
    Assign points if it is helpful.
    Regards,
    R.

  • Initialize some fields in material master with default values

    Hi,
    I would like to initialize some fields in material master MM01 with default values.
    for exemple in the view MRP1 there is a field MRP type I would like to initialize PD in the field as default value.
    but when I go to the technical information there is no parameter id that I can use in SU3.
    Do you know how I can the initialize the field those don't have parameter ID?
    thank
    Dede

    Dear Glenn,
    This is possible in SAP for this use T code MMD1 and create MRP profile and assign this MRP profile while creating material using MM01 in the organisation level put this created MRP profile. The values you maintained in this profile get copied to the material by default.
    To maintain MRP profile go to MMD1->give your profile name...........> click on  selection screen push button--->give here profile description--->select what MRP  field which u want to make fixed one/default. if make fixed later you can not change--
    >click on data screen 1 push button and maintain your value and save
    sree

  • FormsCentral - design form : Initialize form field with default value

    Hello,
              My customer asks me to initialize text fields with default values. Example , Name , email , phone number etc to be displayed by default till it is overwritten by values entered. Could you please guide me how to achieve this ?
    Many Thanks,
    Sree

    Hi,
    see Re: sequencing problem-Forms
    Regards Michael

  • Initializu00EDng select options field with default values and with NO INTERVALS

    Dear All,
    I have used WDR_SELECT_OPTIONS technology within WD Abap.
    I also have added the fields which have to be taken into consideration.
    lt_range_table =
    wd_this->m_handler->create_range_table(
    i_typename = 'PLANT' ).
    wd_this->m_handler->add_selection_field(
    i_id = 'PLANT'
    it_result = lt_range_table
    i_read_only = read_only ).
    Can I assign two values to this field 'PLANT' whereby the user may take only these values.
    I mean kind of pre initializíng of this select options field with default values.
    Due to this handling it should be prevented that the user can give other values
    except this values.
    Additonally it should be fine whether it is possible to disable the second input field
    of this select options field like NO INTERVALS .
    Regard
    sas
    Regard
    sas

    wd_this->m_handler->add_selection_field(
    i_id = 'PLANT'
    it_result = lt_range_table
    I_NO_INTERVALS = 'X'
    i_read_only = read_only ).
    Pls check 'WDR_TEST_SELECT_OPTIONS' web dynpro component

  • I want to set a variable with default value and can be changed by the user

    hi,
    i want to set a variable with default value and can be changed by the user, so i new a variable with setting : customer exit, single value, optional, ready for input.
    in my customer exit code, i set a default value, eg. 20070530
    when the variable screen popup, it display the default value 20070530, i changed it to 20070529, but it doesn't work , it still display the data in 20070530, how can i solve this problem? 
    your help is appreciated.

    Liu,
       As mentioned by Anil, you need to restrict your customerr Exit code to I_STEP = 1.
    or.
       <u>Open your Variable in change mode, in the Last Page os the Variable Maintenance you can provide default value. Note: you are doing same thing in Customer Exit. In your case no need of Customer Exit.</u>
    Nagesh Ganisetti.
    Assign points if it helps.

Maybe you are looking for

  • How to use the alv function module

    hi all,         can  any one help me out how to use reuse_alv_block_list_append function module, what parameters shall i pass  to it, so that i get top of page and end of page events and report data in two blocks, can any one tell how can i didvide t

  • Home Sync Not Working! Please Help!

    Hi Everyone, So I have a Mac Mini running Snow Leopard Server and two clients three clients all running Lion. Everyone has Portable Home Directories with File Syncing which syncs up documents and the desktop folder This seems to be working fine excep

  • Mini display port - video only?

    Hey, I'm just wondering if the mini display port is video only as I've read in some places, and if so, what is the best way to connect my MacBook to my Samsung 26" TV? Thanks

  • AVCHD Video studders

    I am trying to edit avchd video clips but when I drop it to the timeline, it studders.  The audio plays fine, but the video does not.  I am running CS4 version 4.1.0.  The settings I recorded in was PH 1080/30p on the Panasonic AG-HMC150P camera.  Th

  • Forms Runtime Hangs

    We have recently upgrades some of our client workstations to Forms&Reports 6i and are having a problem on a few of the client workstations since the upgrade. When the user runs our client application the Forms Runtime window pops up and just hangs, t