How to find which sequence name is used in a table - Redux

(The other thread was locked before I could respond, so I'm posting this here as a non-question.)
Beginning with 12c, there is now a way to associate a sequence with a table.  It's a new feature called an Identity column.
create table t
(some_id number generated as identity --< creates a system generated sequence
,name varchar2(30)
insert into t (name) values ('Smith');
insert into t (name) values ('Jones');
insert into t (name) values ('Anderson');
commit;
select * from t;
        SOME_ID NAME
              1 Smith
              2 Jones
              3 Anderson
select table_name, column_name, data_default from user_tab_columns where table_name = 'T' and column_name = 'SOME_ID';
TABLE_NAME COLUMN_NAME DATA_DEFAULT
T          SOME_ID     "C##SELSE"."ISEQ$$_91955".nextval
select * from user_sequences;
SEQUENCE_NAME
ISEQ$$_91955

There's nothing stopping you from using the generated sequence for something else, however you can NOT override it when doing an insert (as long as you've specified ALWAYS which is the default).
SQL> create table t
  2  (some_id number generated as identity
  3  ,name varchar2(30)
  4  );
Table created.
SQL> select * from user_sequences;
SEQUENCE_NAME
ISEQ$$_91970
SQL> select ISEQ$$_91970.nextval from dual;
             NEXTVAL
                   1
SQL> select ISEQ$$_91970.nextval from dual;
             NEXTVAL
                   2
SQL> insert into t values (99,'smith');
insert into t values (99,'smith')
ERROR at line 1:
ORA-32795: cannot insert into a generated always identity column

Similar Messages

  • How to find which sequence name is used in a table

    Hi..
    I have a table.. it uses some sequence name..
    But how can we find that the table is using so and so sequence...
    From which USER_* table is used for that
    thanks

    user5451445 wrote:
    I know this is an old thread but I was in the position of the original author and I use this, based on responses here I make this query that can be useful when the sequence is attached to the table using triggers (the most common scenario). I would agree that the most common use of a sequence is probably to generate a PK for a table.
    I would agree that, when using a sequence to generate a PK, using a trigger is best practice.
    But those two agreements do NOT add up to validating you assumption that "attaching" a sequence to a table using a trigger is the most common scenario.. Many shops feel that triggers are inherently evil and forbid there use. Even without that, many developers refuse to use the facilities of the database and insist on putting everything in their app code. Thus, even when using a sequence, they embed it in their app, thus allowing the use of the sequence to be bypassed by other code.
    And in the case of someone trying to locate the use of the trigger, they must keep in mind that not all application code is in PL/SQL modules - it may very well exist completely outside of the database and thus be invisible to any query you could run on the database.
    Let's say we have a table tblproceso and a sequence proceso_id_seq, we wrote a trigger that put the next value from the sequence on every INSERT. With this query we can see in what table we use sequences like 'proceso_id_seq':
    select trigger_body, table_name
    from user_triggers
    where triggering_event = 'INSERT'
    and UPPER(dbms_metadata.get_ddl ('TRIGGER', trigger_name)) LIKE '%PROCESO_ID_SEQ%'
    This will show the trigger body and the name of the table where it's used
    Hope this can help other users with this scenario

  • How to find which devices are still using affected domain controller

    Hi Everyone,
    We have a 5 Domain controller's in a Site. And we are going to decommisson one of our affected DC in a site.
    Can you please let me know how to find  the log files to see which devices are still using this domain controller.
    Regards,
    Neel kamal
    Neel kamal

    Neel,
    From strictly an Active Directory perspective, there is nothing special you need to do to decommission a domain controller in a site.  There are many processes that automatically balance out and recreate connections as needed without any user intervention. 
    The DC Locator process will automatically direct clients to active domain controllers, there is nothing you need to do here. 
    What you need to be concerned with are things like the following:
    DNS - Are you running AD integrated DNS and is the DC you are decommissioning hosting that roll - if so, is it the ONLY DC in the
    site that is running DNS?  You'll need at least one in the site.
    DHCP server - Is the DC you are demoting a DHCP server?  You'll need to account for that.
    Global Catalog - Is the DC you are demoting a Global Catalog server?  You'll need at least one in the site.
    File Shares - Is the DC hosting any files shares?  You'll need to move those and make sure you redirect your clients.
    Was this DC a set as a Preferred Bridgehead Server?  You'll need to undo that first.
    Those are the big ones that come to mind.  Decommissioning a DC is easy if you have prepared properly.  The others that have replied have offered some great advice which you should follow.  Do your homework and you should be fine.
    Hope that helps
    Gary
    Gary G. Gray
     MCP, MCTS, MCITP, MCT Alumni
    Please remember to mark the replies as answers if they are helpful.
    This posting is provided AS-IS with no warranties or guarantees and confers no rights.

  • How to find which all workbook is using Database function ( User Defined)

    Hi All,
    Is it possible to find out which all workbook is using Database function( User Defined).
    Thanks,

    Hi,
    If I had to do this detective work, I would probably do the following:
    1. Activate for a period of time the function, eul5_post_save_document. This function when activated is triggered at the time a workbook is saved. If you look at its columns, it save the worksheet's SQL.
    2. Next, I would parse the EUL5_WORKSHEET_SQL.SQL_SEGMENT column which is a varchar2(4000) column. There are many effective Oracle functions which could aid you in this effort (e.g. instring or perhaps a regular expression function).
    I hope this helps.
    Patrick

  • How to find which data elements are used in ABAP program ?

    I wish to find out which data elements are used in some programs .
    Is there any DD table which stores this information ?
    I know we can go to program and look in fields, but do SAP stores this information somewhere ?

    Dear Kaushal,
    Please check the table <b>TRDIR</b>.
    Regards,
    Abir
    Don't forget to award points *

  • How to find which authentication used to site collection and site using powershell

    Hi,
    How to find  how-many web app, sitecollection, site used Windows authentication,claim authentication and classic, secure store authention , adfs authentication using powershell code in sharepoint 2013.
    If sites are used adfs authentication how to find which email id used for that.
    Thanks,

    Authentication is only defined at the Web Application level, and the only valid auth methods are Classic (Windows (Basic/NTLM/Kerberos)), Claims (Windows (Basic/NTLM/Kerberos)), FBA Claims, , SAML Claims (ADFS), and Anonymous.
    You can find out what authentication scheme(s) are enabled via:
    $wa = Get-SPWebApplication http://webApp1$wa.IisSettings["Default"] #replace with the zone name you're interested in
    The output will look similar to this:
    PS C:\Users\trevor> $wa.IisSettings["Default"]
    AuthenticationMode : Forms
    MembershipProvider : i
    RoleManager : c
    AllowAnonymous : False
    EnableClientIntegration : True
    ServerBindings : {Microsoft.SharePoint.Admini
    stration.SPServerBinding}
    SecureBindings : {}
    UseWindowsIntegratedAuthentication : True
    UseBasicAuthentication : False
    DisableKerberos : True
    ServerComment : SharePoint
    Path : C:\inetpub\wwwroot\wss\Virtu
    alDirectories\spwebapp180
    PreferredInstanceId : 42768054
    UseClaimsAuthentication : True
    ClaimsAuthenticationRedirectionUrl :
    UseFormsClaimsAuthenticationProvider : False
    FormsClaimsAuthenticationProvider :
    UseTrustedClaimsAuthenticationProvider : False
    UseWindowsClaimsAuthenticationProvider : True
    OnlyUseWindowsClaimsAuthenticationProvider : True
    WindowsClaimsAuthenticationProvider : Microsoft.SharePoint.Adminis
    tration.SPWindowsAuthenticat
    ionProvider
    ClaimsAuthenticationProviders : {Windows Authentication}
    ClaimsProviders : {}
    ClientObjectModelRequiresUseRemoteAPIsPermission : True
    UpgradedPersistedProperties : {}
    So on this Web Application in the Default Zone you can tell I have Windows Claims enabled, not using Kerberos (so using NTLM), and Trusted (SAML/ADFS) is not enabled, neither is Forms or Anonymous.
    Trevor Seward
    Follow or contact me at...
    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

  • How to find which datasource are using  tables AFRU ,CAUFV and AUFM

    *how to find which datasource are using  tables AFRU ,CAUFV and AUFM*

    Hi,
    You can enter your table names in SE11 transaction and click "Display" and again click "Where -Used-List". Then it will show all the places where these tables are used(Datasources)
    Hope this helps.....
    Regards,
    SUman

  • How to find bex query name of which dashboard built on?

    How to find bex query name of which dashboard built on?

    Hello,
    When you add a "SAP BW Connection" to you dashboard, you find in the output parameters the query technical name and the query description. you can bind it to the embedded spreedsheet and then use it in yoyr dashboard
    Best regards,
    Mohamed AISSA

  • Find which sequences use a piece of media

    How do I find which sequences in a project use a particular audio track?  (Preferably it'll open the sequence too and show me where in the sequence it is used too).
    Is there a way?

    Or, if you prefer, display the Video Usage +/or Audio Usage properties as columns in the Project panel's List View. Then you can see the usage number for each clip at a glance without having to select it. As with the usage display in the Preview Area that Shooter refered to, you can open a pulldown menu showing each instance, and selecting one takes you to the instance.

  • How to find out query name using Elements of the query builder.

    Hi SDNers,
    how to find out query name using Elements of the query .
    thanks,
    satyaa

    Hi,
    For having a look at the relation between BEx tables,check the link below:
    http://wiki.sdn.sap.com/wiki/display/BI/ExploretherelationbetweenBEx+Tables
    -Vikram

  • How to find the File name using the FTP Adapter

    hi all,
    how to find the File name using the FTP Adapter with BPEL.
    Regards

    Found the solution for this.
    First In the mediator's routing rule use assign property $in.property.jca.file.FileName to $out.property.jca.file.FileName
    In the BPEL's receive activity go to the properties tab and get the property to a BPEL variable. That should do it.
    Thanks for the posts

  • How to find which model of iPhone 5 I am using? and is that GSM or CDMA?

    How to find which model of iPhone 5 I am using? A1428 or A1429 ? Is there any short code you can dial in and check the model number ?
    And which is GSM or CDMA out of this model.

    If you purchased the phone in the US with an AT&T contract then you have the locked CDMA A1428 version of the iPhone 5. 
    At the moment and if the contract is a new contact, then you won't be able to get the phone unlocked at the moment and no, you won't be able to use it in your home country.  You will also have LTE 4G compatibility issues too and your phone will only work on 3G and also you need to remember that iPhones are only covered by country specific warranty, so it is only covered in the US, so if you go home and then have a problem with your phone, you will have to come back to the US to get it repaired.
    You need to approach AT&T about whether they will unlock your phone for you as they are the ONLY ones that can do it, but the answer to your question is no and if you had wanted to use your phone at home, then you should not have purchased it in the US.  The best that you can hope for at the moment is to use it on international/roaming.
    If you purchased your phone in the US, then it will be a CDMA phone.  You don't have a GSM phone, but GSM phones are unlocked anyway and these are the ones that are selling in Canada and the UK.
    If you have your phone on an AT&T contract then ultimately, AT&T are the only ones who can help you with any questions regarding unlocking and they are the only ones who can unlock it for you, noone else.

  • How to find the query name using infoset name

    Hi Experts
           Iam new to the sap queries(SQ01,SQ02), some queries already created.
          now i want to do some modification, my problem is i am not able to find the query name.
          I know the infoset name, can you tell me how to find the query name using the infoset name, is ther any table for this.
    i tried in sq01 also, but its confusion, pls advice me on this.
    thanks in advance.
    regards
    rajaram

    Hi
    try like this..
    SQ02 --> go to --> Query Directory..
    from there you can get all the queries belong to a Infoset.

  • How to find which version of JDK is loadjava using

    Hi All,
    How to find which version of JDK is loadjava using?
    I am using Oracle : 9.0.1.5.1 and I need to use class javax.crypto.Cipher which is shipped with JDK 1.4.2, but loadjava is unable to import javax.crypto.*;
    Any inputs would be greatly appreciated.
    Thanks and regards,
    Abba

    Abba,
    From memory only (since I haven't verified it), "loadjava" is a script, so you can have a look at its contents. I believe it actually uses JDK 1.1.8 (which is part of the Oracle installation). In any case, Oracle 9i is compatible with JDK 1.3 only.
    Oracle 10g is compatible with JDK 1.4.
    Good Luck,
    Avi.

  • How to find which datasource is using table JCDS?

    How to find which datasource is using table JCDS?

    Hi,
    Please find the below link and identify whether will it meet your requirement or not ... If it meets your requirement then I can provide you more documents related to the same which we have in our project.   We were using the same for Plant Maintanance project...
    For this report the required information is gathering from the different data sources from the ECC system. This report requires object status functional location attributes, Equipment attributes and some specific information apart from normal transaction data for an order.
    u2022     Main feeding data sources for this report are 2LIS_17_ORDER and 2LIS_18_ORDER.
    u2022     Requires the object status data (system status, number object status and un-number system status) is feeding from different DSO where the status data is staging with different data flow.
    u2022     Requires the Order planned end date which is dependent on the operation  planned completion date. so we are feeding this field from Operationu2019s DSO where the planned date is staging with different data flow.
    u2022     Required characteristic data and attributes of the Functional location  is getting from the master data .The 0FUNCT_LOC is updating by master data data sources
    u2022     Required standard class  of the functional location is updating from other DSO where the  classification  data is staging with the help of different data flow.
    2LIS_17_ORDER and 2LIS_18_ORDER Data flow Details : No enhancement was done for these data sources .
    Status Data Flow Details:
    The status data is staged because ,this dat is required for the reports based on the Orders, Operations , Notifications, Functional Location and Equipment.
    To load suitable data to different DSOs from the Status DSO we maintain the Filters for status profile and status at DTP level.
    Required status change dates  are deriving based on changed on date ,system status while loading from status DSO to Order DSO.
    The system status ,Number object status and un- numberd object status are feeding from status DSO only.The status DSO is updating by u20180TE_OBJ_STATUS_HISTu2019.This Is based on the tables JCDS,JSTO and T000.
    JCDS     MANDT     =     JSTO     MANDT
    JCDS     OBJNR          =     JSTO     OBJNR
    T000     MANDT     =     JCDS     MANDT
    This DS has enhanced for the below  two fields
    1.     Order Number
    2.     Operation/Activity Number
    The Logic to populate the above two fileds is as below.
    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/e4/1522bae6aa46b8802dca454e846d58/frameset.htm
    regards
    BVR

Maybe you are looking for

  • Cannot connect to internet with huawei e220 after plugged in Ipod touch

    Guys, I have serious problem. I have a vodafone (spain) branded huawei E220 usb 3G modem. It used to work fine until i plugged in my Ipod touch. From then on the connecting app (Vodafone Mobile Connect) will hung up using 55% of CPU capacity. This is

  • Disk Full on server after running "Schedule Updates" on OS Image

    Looking for advice after filling up our sccm server hard-drive as a result of running a "Schedule Updates" against an OS image Running SCCM 2012 R2. Site server disk partitioned as 4 drives, with E: drive holding program files, sccm binaries, etc, an

  • CF9 and Scheduled Tasks

    We recently migrated our web site to a new server running CF9 (64-bit, Windows 2003) and I had several scheduled tasks that run on a night basis. So I set up the tasks in the CF Administrator but when try and run them via the administrator I get an e

  • Find problems in understanding a tutorial relating to IDOC

    Please check the link http://idocs.de/www5/books/IDocBook/cook_A5.pdf In page no: 32 (Topic: 8.5 Assigning a processing function )  ,FM is assigned directly to Message type and Idoc type combination. But in the next page, Process code is created for

  • File Size ( Dimensions)

    Hi, Is there anyway to increase the drawing sace size.  I am in need of making wraps and fabric prints of up to 90' in length.  Is there a better way of going about this?  We have been decreasing the file size to 10% lets say and then multiplying the