Possible to set a default column value to an expression?

Hi,
Is it possible to set a default column name to an expression when creating a table?
For example, I wish to set the default value of a column to read from another table's column and do some arithmetic....is this possible?
Thanks.

Yes, you can, with trigger Before Insert for Each row
But be carefull, you can hit the mutating table problem...

Similar Messages

  • Possible to set the Created_by column value for File Browse?

    I'm using database account authentication and then a user gets to upload a file. Then my stored procedure reads the file. I was investigating a problem, happened to search the apex_workspace_files view and noticed the created_by column is always set to APEX_PUBLIC_USER for the files my users upload. Is there some way I can set that value when they log in, so I can track who actually did the upload?
    Thanks,
    Stew

    Dimitri,
    I was just using the standard File Browse item, so getting the blob from the workspace view. Though I've seen notes here about loading to your own table, what I had seemed to work (and was done) fairly well. There were just these little features I wanted to use...
    Thanks for the suggestion.
    Dave, I'm not sure which stored procedure you're suggesting I add the apex_custom_auth.get_username value to? I hoped that the internal File Browse routine would pick up the get_username value automatically instead of the application definition Public User value.
    Thanks,
    Stew

  • Setting a default initial value to a CHAR type field in a custom table

    Is it possible to set a default initial value to a field in a customer table(Ztable) that is not SPACE?  SAP sets the initial value to " " space for datatype CHAR.
    I am looking at creating a field in a table that would always default to 'X' on creation of a new row.
    Your response is appreciated..

    Hi,
    I believe this cannot be done..
    If you are inserting the row through a program then you can insert the field value to be 'X'.. If the value is not passed ..Then it will be blank..
    If you are using table maintenance then in the PAI ..you can insert values..
    Thanks,
    Naren

  • Set the default field value to transaction code field, when calling from WD

    Hi all,
    Can we pass the value in a input field of a standard transaction calling from WD application. Suppose we are calling a transaction VA03 in an external window, then how will be pass the value in the VBAK_VBELN screen field.
    Is there any way to pass the value to this transaction field. I have also tried out to set the parameter ID 'AUN' for VA03 transaction VBELN field. But it did not work for me.
    Is there any way to set the default field value to transaction code field, when calling from WD?
    Please suggest, if anyone have any idea.
    Thanks
    Sanket

    Hi,
    I am using the below code to open a standard transaction. It will help you to explain my point more easily.
    DATA: url TYPE string,
              host TYPE string,
              port TYPE string.
    *Call below method to get host and port
      cl_http_server=>if_http_server~get_location(
         IMPORTING host = host
                port = port ).
    *create URL
      CONCATENATE 'http'
      '://' host ':' port
      '/sap/bc/gui/sap/its/webgui/?sap-client=&~transaction=' 'VA03'
       INTO url.
    *get the window manager as we are opening t code in external window.
      DATA lo_window_manager TYPE REF TO if_wd_window_manager.
      DATA lo_api_component TYPE REF TO if_wd_component.
      DATA lo_window TYPE REF TO if_wd_window.
      lo_api_component = wd_comp_controller->wd_get_api( ).
      lo_window_manager = lo_api_component->get_window_manager( ).
    call the url which we created above
      lo_window_manager->create_external_window(
      EXPORTING
      url = url
      RECEIVING
      window = lo_window ).
      lo_window->open( ).
    Note*
    One more query I want to add to this thread, that is there any possibility to call a custom transaction as well?

  • Is it possible to set a default mfg_organization_id for a responsibility?

    We have a responsibility that only has access to 1 inventory organization as defined by Organization Access. Our users think it is silly that they should have to do a Change Org when there is only one responsibility to choose from. Is there any way to set a default profile value for the mfg_organization_id at the responsibility level?
    thanks,
    Ken

    We do have a partial work-around for the problem I described. We have added the following parameters to the menu function used to get to the run concurrent requests form.
    REQUEST_GROUP_CODE="<our custom request group code>"REQUEST_GROUP_APPL_SHORT_NAME="<out custom application short name>"USE_ORG="Y"
    This causes the mfg_organization_id to be set. But this is only a partial solution since there are other ways of running a concurrent request. For example, View > Requests > Submit a New Request.

  • Is it possible to set a default music player for the music on my external hard drive while still keeping my iTunes the default player on my Mac ?

    Is it possible to set a default music player for the music on my external while still keeping my iTunes the default player on my Mac ?
    Message was edited by: Pellseidon

    There is no setting in the iPhone to set another default music player. The default is Music. If you are using another application, you are at the mercy of how that application operates as far as what occurs when it stops or errors out. The car is looking for music to play.

  • Is it possible to Lock just one column value in a row?

    Is it possible to Lock just one column value in a row
    A Java Developer has just asked me if it is possible to Lock just one column value in a row in Oracle
    select ename from emp where empno=7369 for update;
    EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
    7369 SMITH      CLERK           7902 17-DEC-80        800                    20
    will lock the entire row with empno=7369.
    But is it possible to lock one column value from this row, like SAL=800 ?
    Edited by: J.Kiechle on Jan 8, 2009 10:45 PM

    J.Kiechle wrote:
    Is it possible to Lock just one column value in a rowNo. Locking granularity is a row.

  • Copy table structure with default column values

    Hi....
    I created a table by copying another table structure by using below query.....
    SQL> CREATE TABLE SAMPLE_TEMP AS SELECT * FROM SAMPLE WHERE 1=2;
    But my problem is " the default column values are not copied to new table"
    Suggest a query like that it should " copy a table structure and default values on columns "
    Thanks in advance

    hi,
    One more option would be "dbms_redefinition' - it would work as per your requirement.
    refer further to documentation : http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_redefi.htm
    - Pavan Kumar N

  • Is it possible to set the default colours in the swatches palette in Illustrator CS4?

    Is it possible to set the default colours in the swatches palette in Illustrator CS4? What I mean is replace the swatches default colour palette with my own, so that each time I create a new document it comes up with my colours rather than Illustrators.

    You might also consider using color groups with Illustrator. Let me know what you think. It may help you out with projects that use the same color preferences.
    Check out the tutorial here:
    http://www.adobe.com/designcenter/illustrator/articles/lrvid4019_ai.html
    Let me know if this helps you.
    Vicente Tulliano

  • Default Column value in case of null

    Hi friends,
    I am new to dimensional query and need help to set the default value for columns. The query is mentioned below. I need to include the default values when the data for the column is null. How to implement this?
    Query:
    SELECT distinct s_id,SName, ENV_TYPE, h_id
              FROM (
              select s_id,s_code,s_value from table
              where s_id = 6070
              MODEL
              IGNORE NAV
              PARTITION BY
              (s_id)
              DIMENSION BY
              (s_code)
              MEASURES
              (s_value,CAST( '' AS VARCHAR2(256) ) AS SName, CAST( '' AS VARCHAR2(256) ) AS ENV_TYPE, 0 AS h_id )
              RULES UPDATE
    SName[ANY] = service_value['SName'],
    ENV_TYPE[ANY] = s_value['ENV_TYPE'],
    h_id[ANY] = s_value['h_id']
    Output:
    S_id SName ENV_TYPE h_id
    6070 null null null

    I made two changes in the query :
    1) Replace service_value to s_value
    2) Added a closing ")" for the update
    And after making the changes when I ran the query it worked with NVL
    create table t_test_data
    s_id number,
    s_code varchar2(30) ,
    s_value varchar2(30)
    create table succeeded.
    insert into t_test_data
    select 6070,null,null from dual union all
    select 6080,null,null from dual;
    2 rows inserted
    SELECT DISTINCT
        s_id,
        nvl(SName,'Some name') as SName,
        nvl(ENV_TYPE,' Some env') as ENV_TYPE,
        nvl(h_id,0) as h_id
    FROM
            SELECT
                s_id,
                s_code,
                s_value
            FROM
                t_test_data
            WHERE
                s_id = 6070
        MODEL IGNORE NAV PARTITION BY (s_id) DIMENSION BY (s_code) MEASURES (
        s_value,CAST( '' AS VARCHAR2(256) ) AS SName, CAST( '' AS VARCHAR2(256) ) AS ENV_TYPE, 0 AS h_id ) RULES
    UPDATE
        ( SName[ANY] = s_value['SName'], ENV_TYPE[ANY] = s_value['ENV_TYPE'],
        h_id[ANY]    = s_value['h_id'] );
    S_ID          SNAME                ENV_TYPE            H_ID                  
    6070          Some name            Some env            0                     

  • Setting a default date value for input controls

    Hi All,
    I have created a webi report that shows  - among other things - the activity between 2 dates. I have created 2 input controls where the user can select the start and end dates from a calendar for this.
    The displayed data is restricted by a date variable which 'unfiltered' contains 1 month of data.
    'out of the box' I can set these input controls and all works fine, but each time I open the report the same values that I set last time are set in the input controls. I want to have these default to being between today and 7 days ago with the user then able to move away from  this action, rather than the 'window of interest' slowly slipping into the past.
    I have looked at the forum posting Re: Default Input Control Values in WebI doc on Open which describes setting a default on the objects in the report filter pane, but this does not appear to be possible as these are 'grayed out' and i need both the input controls to run from a single object.
    Does anyone have any ideas how this might be achieved?
    Thanks in advance
    John

    Hi,
    Sorry, I've obviously not explained myself very well. Please let me try to elaborate...
    The report I am writting is to function as a dashboard (yes, i know - Xcelcius/Dashboard Designer - don't ask!) but asking the user to enter a prompt for the date range is not an option here. My only options for this are effectively the input controls or the report filters. I want to be able to achieve the effect of entering =CurrentDate() in the 'default value box in the same way that I would if writting a Reporting Services report. However the WebI controls do not accept expressions for this.
    So...
    I have one date object with a months worth of dates in it.
    I have two input controls associated with this date object to allow the user to select a narrowed date range from this month of data.
    I need one of these to default to 'today' and the other to default to '7 days ago' (I can do the calculations to get both dates, the bit I cannot get past is applying these dates as defaults)
    can anyone help me with step 3 (in bold) above?
    John

  • PowerShell - Unable to save Default Column Values

    I have created a document library (A) in a Team Site. I have created 2 folders (B and C) inside the document library. I have added a content type to the library. The Content Type contains 2 columns rmName and rmKey (both internal names). I want to set
    a column level default on the column rmKey for folder B only. I tried the following code and this does not set the default:
    $web = Get-SPWeb "http://abc:39325/sites/COSC"
    $list = $web.Lists["A"]
    $defaults = New-Object -TypeName Microsoft.Office.DocumentManagement.MetadataDefaults -ArgumentList $list
    $folder = $web.GetFolder("sites/COSC/A/B")
    $defaults.SetFieldDefault($folder, "rmKey", "Default Value")
    $defaults.Update()
    I tried replacing $folder with $list.RootFolder. This works, but it sets the default on the Library and both Folders instead of only folder B.
    $web = Get-SPWeb "http://abc:39325/sites/COSC"
    $list = $web.Lists["A"]
    $defaults = New-Object -TypeName Microsoft.Office.DocumentManagement.MetadataDefaults -ArgumentList $list
    $defaults.SetFieldDefault($list.RootFolder, "rmKey", "Default Value")
    $defaults.Update()
    What am I doing wrong in the first script? I feel there is something wrong in $folder. I tried using the Guid of "B" as weel as recursion to get folder but was not able to set the default value on "B". 

    I was able to get it to work by changing the way I get $folder
    $defaults = New-Object -TypeName Microsoft.Office.DocumentManagement.MetadataDefaults -ArgumentList $list
    $folder = $list.RootFolder.SubFolders["B"]
    $defaults.SetFieldDefault($folder, "rmKey", "Default Value")
    $defaults.Update()

  • How to set a default integer value in a form

    I have a form defined as follows:
    =================================================
    public static class ProjectForm extends FormData
    private int idx;
    private String name;
    private String projectNumber;
    private String description;
    public void setIdx(int index)
    this.idx = idx;
    public int getIdx(){
    return this.idx;
    public void setName(String name)
    this.name = name;
    public String getName()
    return this.name;
    public void setDescription(String description)
    this.description = description;
    public String getDescription()
    return this.description;
    public void setProjectNumber(String projectNumber)
    this.projectNumber = projectNumber;
    public String getProjectNumber()
    return this.projectNumber;
    ======================================================
    When I add a new entry into the database, I have no issues. However, when I want to modify an entry I run into some issues with the idx entry. For some reason, I cannot set a default value into the netui:label tag. My jsp code is as follows:
    ===================================================
    <tr valign="top">
    <td>
    Index:
    </td>
    <td>
    <netui:label value="{actionForm.idx}"
    defaultValue="{pageFlow.project.idx}"/>
    </td>
    </tr>
    <tr valign="top">
    <td>
    Name:
    </td>
    <td>
    <netui:textBox dataSource="{actionForm.name}"
    defaultValue="{pageFlow.project.name}"/>
    </td>
    </tr>
    <tr valign="top">
    <td>
    ProjectNumber:
    </td>
    <td>
    <netui:textBox dataSource="{actionForm.projectNumber}"
    defaultValue="{pageFlow.project.projNum}"/>
    </td>
    <tr valign="top">
    <td>
    Description:
    </td>
    <td>
    <netui:textBox dataSource="{actionForm.description}"
    defaultValue="{pageFlow.project.description}"/>
    </td>
    </tr>
    ======================================================
    The the project class is passes into the page and has the appropriate values. The name, project number and description fields work as I would expect. However, the idx value is alway '0'. If I print out pageFlow.project.idx it has the correct value.
    How do I fix this? My feeling is that it is related to the form field being an int and not a string. The default parameter indicates that is only works with null values, and ints default to zero. Do I need to use an Integer value instead in the form, or just stay away from non-string form fields.
    Thank for the help!!
    --John                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    In the action which displays the edit page just set the form idx value before displaying the jsp.

  • How to set the default context value for flexfield in OAFramework pages

    Hi,
    I have a page which contains a contexxt value field i.e Flexfields
    To select the context value we have to select the value from drop down
    So Here we want to display the context value immediately when the page is called
    How to set the default valu in this case
    Regards,
    Krishna

    You can set the Attribute category view attribute to the Flexfield context value and call prepareforRendering in the flex bean. Check the dev guide for details.
    Regards
    Sumit

  • BPEL : Setting the default start value for instance ID

    The instance ID for the processes are generated by the system, is it possible to set the starting value for the instance id. for eg: when I deployed a new process on a fresh installation and created an instance through BPEL console, it created a new instance with instance ID #1.
    Is it possible for me to start the value from a different number say "5000"

    Hi ashutosh,
    I think you can achieve this by writing a small java code in this Java Embedding activity.
    For using Java Embed in BPEL, you can refer to the following blog:
    http://technology.amis.nl/blog/?p=2387
    Cheers,
    Abhi...

Maybe you are looking for

  • How to decrease width of the dropdown bookmark panel (FF 11)?

    How to decrease width of the dropdown bookmark panel (FF 11)? This panel is too wide and covers too much space in underlying windows. The book marks text should not be truncated but some way needs to be found to allow the entire text of any line to b

  • Separate transactions in one ADF app?

    Hello All! Is it possible to create two (ore more) separate transactions in one ADF ApplicationModule? I use JDev 10.1.2 and the default stack: ADF BC, Struts and JSP. I would like to do something similar: I've got two tables, orders, and partners. P

  • Alias in Forms

    In Planning you have the option to select Alias or MemberName for the Page\Point of View Dimensions. If you have more than one Alias how can you specify which alias for the forms to use ?

  • Download update to Reader without Chrome?  Windows 7

    I have Windows 7 Ultimate.  The window that authorizes downloading update 11.0.09 to Adobe Reader had a checked box to authorize downloading Chrome.  I do not want Chrome.  I cleared the checked box.  Just as I clicked to authorize the download I not

  • Context-root Problem

    The project I'm working on has just recently changed the context-root of the webapp from / to /grp. As the UI developer for this project, this seemingly small change has had a huge impact on my workload. All of the images, stylesheets and JavaScript