Chnging tbl name while insrting,updting

Hi,
I have two pl/sql procedures
SP1 which inserts the data into TEMP1
SP2 which inserts the data into TEMP2
The only difference between these two procedures is the table that we insert the data into.
Code is same in SP1 and SP2
Table structures are exactly same except the table names....
Every time i change SP1, i have to change SP2 as well and its getting tough to maintain both...
My question is "Do we have something like a decode while inserting based on a value
eg:
insert into SOMETHING_LIKE_DECODE(Value, '1', temp1,'2', temp2)   (id, date) values('1','01-aug-2011');This table has like more than 30 columns and thats why looking for something simple solution other than writing if-else or dynamic sql when ever i insert and update these tables
thanks in advance

For sake of completeness though, there is a way to insert conditionally into different tables, though I agree with the previous answers, that similar data should be kept in just one table; however, there are occassions when there is a need to split data into different tables, especially when the structure is different.
Example:
(for sake of this example my two tables are the same, but they could easily be different)
SQL> create sequence test_seq;
Sequence created.
SQL> create table table1 (id number, val varchar2(30));
Table created.
SQL> create table table2 (id number, val varchar2(30));
Table created.
SQL> ed
Wrote file afiedt.buf
  1  insert all
  2    when comm is null then
  3      into table1 (id, val) values (test_seq.nextval, ename)
  4    when comm is not null then
  5      into table2 (id, val) values (test_seq.nextval, ename)
  6  select comm, ename
  7* from emp
SQL> /
14 rows created.
SQL> select * from table1;
        ID VAL
         1 SMITH
         4 JONES
         6 BLAKE
         7 CLARK
         8 SCOTT
         9 KING
        11 ADAMS
        12 JAMES
        13 FORD
        14 MILLER
10 rows selected.
SQL> select * from table2;
        ID VAL
         2 ALLEN
         3 WARD
         5 MARTIN
        10 TURNER

Similar Messages

  • HT204053 I have one apple ID for purchases and then my mobile me ID where I use for email.  So I have set my cloud with my mobile me name, while keeping my purchases the original name.  Will my purchases be recognized as purchases when backup is finished.

    I have one apple ID for purchases and then my mobile me ID where I use for email.  So I have set my cloud with my mobile me name, while keeping my purchases the original name.  Will my purchases be recognized as purchases when backup is finished.

    Welcome to the Apple community.
    So long as you are logged into the iTunes Store, using the correct ID and password (settings >store), then you will always have access to your apps, books, music, TV shows etc etc bought via the iTunes Store on that account.

  • The KDC encountered duplicate names while processing a Kerberos authentication request in a Domain controller server

    HI
    we have a sharepoint farm and in domain controller server, this error is in event viewer
    Log Name:      System
    Source:        Microsoft-Windows-Kerberos-Key-Distribution-Center
    Date:          9/15/2014 10:44:15 PM
    Event ID:      11
    Task Category: None
    Level:         Error
    Keywords:      Classic
    User:          N/A
    Computer:      XXXAPP01.xxxportal.com
    Description:
    The KDC encountered duplicate names while processing a Kerberos authentication request. The duplicate name is HTTP/XXXWFE01.xxxportal.com (of type DS_SERVICE_PRINCIPAL_NAME). This may result in authentication failures or downgrades to NTLM. In order to prevent
    this from occuring remove the duplicate entries for HTTP/XXXWFE01.xxxportal.com in Active Directory.
    Event Xml:
    <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
      <System>
        <Provider Name="Microsoft-Windows-Kerberos-Key-Distribution-Center" Guid="{3FD9DA1A-5A54-46C5-9A26-9BD7C0685056}" EventSourceName="KDC" />
        <EventID Qualifiers="49152">11</EventID>
        <Version>0</Version>
        <Level>2</Level>
        <Task>0</Task>
        <Opcode>0</Opcode>
        <Keywords>0x80000000000000</Keywords>
        <TimeCreated SystemTime="2014-09-15T19:44:15.000000000Z" />
        <EventRecordID>131824</EventRecordID>
        <Correlation />
        <Execution ProcessID="0" ThreadID="0" />
        <Channel>System</Channel>
        <Computer>XXXAPP01.xxxportal.com</Computer>
        <Security />
      </System>
      <EventData>
        <Data Name="Name">HTTP/XXXWFE01.xxxportal.com</Data>
        <Data Name="Type">DS_SERVICE_PRINCIPAL_NAME</Data>
        <Binary>
        </Binary>
      </EventData>
    </Event>
    adil

    Hi adil,
    Service principal names (SPNs) are stored as a property of the associated account object in Active Directory
    Domain Services (AD DS). I noticed that you have used setpn –X to identify the duplicate SPN. Please refer to following articles and check if help you to solve this issue.
    Event ID 11 — Service Principal
    Name Configuration
    Event ID 11 in the System log of domain controllers
    Please also refer to following article and check if can help you.
    The problem with duplicate SPNs
    Please Note: Since the web site is not hosted by Microsoft, the link may change without notice. Microsoft
    does not guarantee the accuracy of this information.
    If any update, please feel free to let me know.
    Hope this helps.
    Best regards,
    Justin Gu

  • How to change vendor name while payment

    we want to modify the vendor name while doing the payment, is it possible,
    regards,

    hi,
    You have have to create a new Vendor with the name you want to make the Payment. Then assign the vendor code in Vendor Master in payment Trasactions .
    When you process the payment then the cheque name will be picked-up from the alternate payee assigned. in the vendor master.
    Regards
    Harish

  • How to specify the target name while deploying a code in OSB-- Plz Help

    Hi all,
    Am working in creating a cluster environment. For my testing i created a new managed server(OSB_Server) in 9001 port in the admin console itself and that server started running. The default managed server(Admin_Server) is in 7001 port. So when i deploy a code in 7001 sb console the WSDL gets exposed in 7001 because the default admin server port is 7001. While deploying a code in service bus admin console we are not specifying the target name. So how to specify the target name while deploying the code in service bus admin console. Plz help me.
    Regards
    Prabhu

    Hi Prabhu,
    There are three kind of server architecture possible for OSB -
    1. Single server - Everything gets deployed on Admin server itself
    2. Admin Server + Single Managed Server for OSB -- OSB configuration gets deployed on OSB managed server. OSB resources (proxy service, WSDL, Schema) will remain available on OSB managed server port only and NOT on admin server port
    3. Admin Server + OSB cluster -- OSB configuration gets deployed on OSB cluster. OSB resources (proxy service, WSDL, Schema) will remain available on OSB Cluster port(s) only and NOT on admin server port
    Converting one type of server architecture to any other type, requires a manual tedious process, so it is suggested that you create domain accordingly i.e. if you need clusters then while creating domain itself, create OSB cluster, so that all OSB applications gets deployed to OSB cluster. I will suggest you to create a clustered domain from scratch and import the configuration from your existing domian to this new clustered domain.
    You may refer-
    http://download.oracle.com/docs/cd/E17904_01/doc.1111/e15022/toc.htm
    Regards,
    Anuj

  • How to retain file name while saving file on archive servers

    Hi Experts,
    I am using function modules:
    ARCHIVOBJECT_CREATE_TABLE and ARCHIV_CONNECTION_INSERT for inserting a file to archive server and for linking it with a document.
    Then I am reading the URL using FM: SCMS_AO_URL_READ. When I get this URL and download that file, the file name will be always defaulted to 'pclHTTP.dll'. I debugged these FMs to a certain extent and found that this name comes from CREP_HTTP-HTTP_SCRPT table.
    Is there any way I can retain the file name while saving it so that when I read the URL it has correct file name in it?
    Please help.
    Regards,
    Anand Kolte

    Hi Max,
    In case when downloading one file it is fine. But if I want to download 10 files at once and later if I go to my downloads, every file will be having similar name. Unless we open the file, we cannot know what file it is.
    Regards,
    Anand

  • Changing the table name while drill down at the dashboard query

    I have a DAY fact table that has about 1B rows.
    The purpose of this table is to store on hand quantity for each item per day.
    On the presentation layer I have a dashboard that will display average on hand qty per year and then user can drill down to quarter/month/week and then by day level to see the actual value at evey level.
    Its hard to run aggregation on fly as all my 3 TEMP tablespace 32gb each filled and then I get error can not extent TEMP file.
    So I thought I will do the aggregation at the database level and store the aggregated data in another table. So at first dashborad will read this new aggregated table to display qty at yearly. As soon as user drill down to quarter the dashbord should query the actual DAY fact table by filtering for specific year and quarter.
    IS it possible? Can I change the table name while I drill down to lower level?
    Thanks in advance.

    Hi use,
    Yes. This is possible in OBIEE. You need to use Action Links to have navigation between reports. The main idea is to have 2 analysis. One with your aggregated data by year (using your aggregated table), and another one with the rest of the hierarchy and data (using normal fact table)
    You add an action link on this report, that can navigate to the second report. showing "the details" (in your case would be the rest of the time dimension).
    Please refer to http://www.rittmanmead.com/2010/07/obiee-11gr1-action-framework-and-conditions/ for actions links.
    Another way is to create 2 analysis, then go to the 2nd analysis, and filter the column year as "Is based on results of other analysis" and you select there the first analysis. In this case when you click on the year in the first analysis, this value will be passed to the second analysis so you can filter the rest of the hierarchy based on the year you clicked on the first analysis.
    If helpful, assign points.
    J.

  • Download a file and give the file name as default name while saving

    Hi folks
    I am facing a problem. I have jsp which fetchs the file name and it's location from the database.
    It can fetch many row's. Now i have provided a radio button, against each row, By clicking on it , the user selects the file to download.
    And clicks on download button, which call an action say "Download File".
    It's downloading the file successfully. But displaying the action name as default name while selecting the location to save the file on local machine.
    I want the file name which he opted to download, should get displayed as default name.

    Set it in the content disposition header.
    The downloadFile() snippet here might give some useful insights: http://balusc.xs4all.nl/srv/dev-jep-pdf.html

  • How to Change Journal Header name to Custom Header Name while GL Importing?

    Hello Experts,
    I am in situation where customer wanted to keep their own journal header naming conventions to imported journals in Oracle GL for custom Journal sources.
    As I know while importing journals, Oracle Creates the Journal Name based on the below mentioned logic.
    "Journal Import creates a default journal entry name using the following format:
    (Optional User-Entered REFERENCE4)(Category Name)(Currency)
    (Currency Conversion Type, if applicable)
    (Currency Conversion Rate, if applicable)
    (Currency Conversion Date, if applicable) (Encumbrance Type ID, if applicable)
    (Budget VersionID, if applicable). If you enter a journal entry name,
    Journal Import prepends the first 25 characters of your journal entry name to
    the above format"
    But then How it is possible to only allow journal header Name to be used present in REFERENCE4 excluding all other string provided by Oracle? Instead of using omitted string custmoer wanted to keep their own parameters. Example - REFERENCE4.A.B.C etc.
    Is it possible to solve this using seeded setup or modifying some hook packages or anything else?
    As far as I know there can be one workaround to be use of updating journal header name after journal import being completed successfully for custom journal source. But only fear is Oracle doesnt allow updating the base table without API. Am I rght?
    So it would be really great if anyone of you can suggest the best solution or best possible workaround.
    Thanks

    Duplicate - How to Change Journal Header name to Custom Header Name while GL Importing?

  • Error Event ID 11 The KDC encountered duplicate names while processing a Kerberos authentication request.

    I've been noticing The Error with event ID 11 popping up a lot on our domain controllers:
    The KDC encountered duplicate names while processing a Kerberos authentication request.
    When running setspn -X it says that it found 111 groups of duplicate SPNs. However, when going through the list, it references domain service accounts that are used to run our SQL Server services. We have about 50 remote locations and each of them has 3
    machines participating in a SQL mirror (principal, mirror, witness) and they all run the SQL Server service on the same account (1 account per location).
    We haven't experienced any issues at all but I was wondering if this could cause problems or if we are straying from best practice. Any advice is welcome. Thanks!

    I believe what you should do to follow best practice is to provide unique SPNs for each SQL server, which will also provide increased security, and to do that you must create individual service account for each SQL server so it can associate that
    account with that server's SPN.
    Here's more on it to help guide you. Read Paul's comments, as well as other suggestions in the following thread:
    event ID 11 There are multiple accounts with name MSSQLSvc/xxxxxx
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/8df35316-23ba-48ba-aa3e-2249fcbfecbc/event-id-11-there-are-multiple-accounts-with-name-mssqlsvcxxxxxx?forum=winserverDS
    Ace Fekay
    MVP, MCT, MCSE 2012, MCITP EA & MCTS Windows 2008/R2, Exchange 2013, 2010 EA & 2007, MCSE & MCSA 2003/2000, MCSA Messaging 2003
    Microsoft Certified Trainer
    Microsoft MVP - Directory Services
    Complete List of Technical Blogs: http://www.delawarecountycomputerconsulting.com/technicalblogs.php
    This posting is provided AS-IS with no warranties or guarantees and confers no rights.

  • Get Managed bean name while running tests.

    hi,
    while running web application,i can able get managed name.
    but how to get managed bean name while running unit tests.
    thanks
    siva

    public String getManagedBeanName() {
        String managedBeanName = null;
        HttpServletRequest request =
            (HttpServletRequest) FacesContext
                .getCurrentInstance()
                    .getExternalContext()
                        .getRequest();
        // lookup bean in request scope
        Enumeration requestAttributeNames = request.getAttributeNames();
        while (requestAttributeNames.hasMoreElements()) {
            String requestAttribute = (String) requestAttributeNames.nextElement();
            Object object = request.getAttribute(requestAttribute);
            if (object instanceof MyBean) {
                managedBeanName = requestAttribute;
                break;
        if (managedBeanName == null) {
            // lookup bean in session scope
            Enumeration sessionAttributeNames = request.getSession().getAttributeNames();
            while (sessionAttributeNames.hasMoreElements()) {
                String sessionAttribute = (String) sessionAttributeNames.nextElement();
                Object object = request.getSession().getAttribute(sessionAttribute);
                if (object instanceof MyBean) {
                    managedBeanName = sessionAttribute;
                    break;
        return managedBeanName;
    }Sorry, don't know other ways.

  • KDC encountered duplicate names while processing a Kerberos authentication request

    The KDC encountered duplicate names while processing a Kerberos authentication request. The duplicate name is RPCSS/HKHVS01 (of type DS_SERVICE_PRINCIPAL_NAME). This may result in authentication failures or downgrades to NTLM. In order to prevent
    this from occuring remove the duplicate entries for RPCSS/HKHCS01 in Active Directory.
    - What the error means ??
    - Why happen ??
    - How to fix it ??
    Thanks

    This is an SPN problem. Having duplicate SPNs will result in Kerberos failures and a downgrade to NTLM authentication. Please run
    setspn -x to get the list of duplicated SPNs. Once identified, you need to remove the duplicated ones. 
    You can also see that:
    http://blogs.technet.com/b/askds/archive/2008/06/09/kerberos-authentication-problems-service-principal-name-spn-issues-part-1.aspx
    http://blogs.technet.com/b/askds/archive/2008/06/09/kerberos-authentication-problems-service-principal-name-spn-issues-part-2.aspx
    http://blogs.technet.com/b/askds/archive/2008/06/09/kerberos-authentication-problems-service-principal-name-spn-issues-part-3.aspx
    This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.
    Get Active Directory User Last Logon
    Create an Active Directory test domain similar to the production one
    Management of test accounts in an Active Directory production domain - Part I
    Management of test accounts in an Active Directory production domain - Part II
    Management of test accounts in an Active Directory production domain - Part III
    Reset Active Directory user password

  • Task name while modifying the packages

    Dear experts ,
    From where can I find all the task name , that I can enter into the "Task Name" while modifying the package.
    Is there any such givin task list or how do we come to know that which task has to be used in proper place.
    Thanks in advance
    Sanjay

    Thanks Badrish for your reply,
    Actually... I am not looking for any package. I want to modify the given package or create a new one. So for that... when we modify the package... then we can give either info, prompt or task. On the left side... only prompt and info are given. For task there is option for task only ... but what should be the value inside that task .i.e "task name" and its use.
    My doubt is about the task. I dont know which all task I can give and what is the use of those task.
    Hope that I have made my question clear this time.
    Sanjay

  • Have timecode in clip name while capturing

    I'd like to see the timecode information in the clip name while capturing. Is this possible?

    Or for DV try DVMP Pro. The capture files can be named with the inclusion of:
    - timecode (of file's first frame)
    - date and time
    - user bits value
    - sequential number
    Or you can run it retrospectively on existing capture files and it will add the date and time to the filename or change the file's Date Modified property - this can be done for DV, HDV, MOD and AVCHD files.

  • Lost names while texting. Numbers still there though. Not all names just some

    I  just lost some of my contact names while texting. Some are still there while others show just their numbers now and not their names anymore. What's up with that? I did a hard reset And it still didn't fix the problem. It's been updated and also sync.

    You can just rely on your locally created backup and try using the iPhone Backup Extractor tool to extract your contact data. You can easily import it back to your iPhone. Just a short question: is your iPhone jailbroken?

Maybe you are looking for

  • Posting is not possible for the specified company code.

    Hi SRM Gurus,   We have a four company codes in our org.structure and if we try to post manual invoice for a particular company code with its currency, we are getting this error : "Posting is not possible for the specified company code " We have all

  • Problem with HP LaserJet 4L and Leopard

    4L will not print with Leopard except under following circumstances: If I unplug the 4L, then replug and reset via Print & Fax preference, then, it will print 1 page and stop. Will not print any more until I go through the unplug,replug,reset procedu

  • Did my hard drive disappear?

    so my powerbook decided to freeze, i restarted it and it showed a grey screen with a little folder with the mac icon/face thing and a question mark blinking over it, it also shows a blinking globe before that. i tried starting it up with my osx disk

  • Viewing Messages in Solman

    Hi I have just finished implementating the service desk for a large company. This company has 5 operating divisions and each division has their own support personal. I have also implemented workcenters. I am now trying to setup the service desk in su

  • Type field

    Hello, I need to know the type of each fields in a form. I have to look over a form, then I need to identify all the fields, and extract the name of the field and the type of this field (Text Field, Numeric Field, Drop-Down list, etc...) Thanks, Juan