How to assign a seq while creating a table

Hi,
How to assign a sequence such that i dont want to give the sequence while creation. i mean
if employee table is there
sl_no empname salary .....
i dont want to give sequence while inserting the data, i want to give the sequence at creation of table level for sl_no
i tried this
create table seqtest1 (id number primary key default rajseq.nextval);
but it is showing me the error
ERROR at line 1:
ORA-00907: missing right parenthesis
whats the solution
please help me
Thank you
Raj deep.A

Hi Raj,
You can not assign a sequence to a column while creating a table. you have two options for this. (So you can also use one sequence for multiple tables)
1. As Gasparotto said, you can create a before insert statement. OR
2. you can assign new sequence number in the program code. for example.
insert into xxx (user_id,name,surname) values (seq_userid.nextval,'Raj','Deep');
Good Luck.
Onur

Similar Messages

  • How to give network path while creating oracle directory.

    I have created
    CREATE OR REPLACE DIRECTORY TESTDIR AS '\\168.176.33.117\TESTDIR';
    but through this path i m not able to create text file.
    create or replace procedure WriteTest is
    f utl_file.file_type;
    s varchar2(200) := 'this is some info';
    begin
    f := utl_file.fopen('TEST2DIR','sample2.txt','W');
    utl_file.put_line(f,s);
    utl_file.fclose(f);
    end WriteTest;
    Help how to give network path while creating oracle directory.
    --when i give local machine path then it will create at local machine where oracle is installed. but not able to create at other machine.
    Zakir

    Well for starters your directory object is called TESTDIR and in your fopen statement you are referring to TEST2DIR.
    On top of that I'm not sure oracle is happy to refer to network locations. I think you have to map it to a regular drive mapping (shared directory) type path. Can't say I've every tried to do it though.

  • How to add image file while creating addon...pathsetup?

    Hi friends,
    i have a problem while creating addon.
    while creating addon we can add all the files(.vb,xml).but if i add image files(.bmp,.jpg)they are not displayed in runtime.
    --how to add image file while creating addon..?
    we are useing SAP Business One 2005A(6.80.317)SP:01 PL:04

    Somebody knows like I can indicate to him to a button that I have in a form, that accedes to the image in the route where will settle addon? I have this, but it does not work to me
    oButton.Image = IO.Directory.GetParent(Application.StartupPath).ToString & "\CFL.BMP"

  • "How to pass classification characteristics while creating batch" ?

    Hi,
        I am using FM's BAPI_BATCH_CREATE/CHANGE while creating/changing batch I have to maintain classification data aswell.But in FM docu i saw as shown below
    1.Create the classification of a batch in the background (object characteristics only)
    2. If the batch is to be classified, you must specify a class in the BatchControlFields parameter. Only single classification is possible.
      According to above statments I have passed class name in Batch Control Fields but I am unable to find " How to pass classification characteristics while creating batch". Please tell me how to pass classification characteristics in background?
    Edited by: Vijay Babu Dudla on Dec 16, 2008 3:24 AM

    Hi, You can update classification for a batch using the following code.
    But first, you'll need to find out that the batch management is cross-plant or plant dependant.
    If it is cross plant then plant(WERKS) is not part of the key to BAPI_OBJCL_CONCATENATEKEY.
    CLEAR: objectkey, objectkeytable, objectkeytable[],
               allocvaluesnumnew, allocvaluesnumnew[],
               return.
        objectkeytable-key_field = 'MATNR'.
        objectkeytable-value_int = matnr.
        APPEND objectkeytable.
        objectkeytable-key_field = 'CHARG'.
        objectkeytable-value_int = charg.
        APPEND objectkeytable.
    * Only if Batch management is Plant dependant
        objectkeytable-key_field = 'WERKS'.
        objectkeytable-value_int = werks.
        APPEND objectkeytable.
        CALL FUNCTION 'BAPI_OBJCL_CONCATENATEKEY'
          EXPORTING
            objecttable    = objecttable
          IMPORTING
            objectkey_conc = objectkey
          TABLES
            objectkeytable = objectkeytable
            return         = return.
        allocvaluesnumnew-charact = "characteristic name goes here".
        allocvaluesnumnew-value_from ="characteristic value goes here".
        APPEND allocvaluesnumnew.
        allocvaluesnumnew-charact =  "characteristic name goes here".
        allocvaluesnumnew-value_from =  "characteristic value goes here".
        APPEND allocvaluesnumnew.
        CALL FUNCTION 'BAPI_OBJCL_CHANGE'
          EXPORTING
            objectkey                = objectkey
            objecttable              = 'MCHA' " MCH1 in case of cross-plant batch management
            classnum                 = classnum " Classification class number, as used in MSC2N
            classtype                = classtype " Classification class type, as used in MSC2N
    *   STATUS                   = '1'
    *   STANDARDCLASS            = STANDARDCLASS
    *   CHANGENUMBER             = CHANGENUMBER
    *   KEYDATE                  = SY-DATUM
    *   NO_DEFAULT_VALUES        = ' '
    * IMPORTING
    *   CLASSIF_STATUS           = CLASSIF_STATUS
          TABLES
            allocvaluesnumnew        = allocvaluesnumnew
            allocvaluescharnew       = allocvaluescharnew
            allocvaluescurrnew       = allocvaluescurrnew
            return                   = return
    * Do not forget to commit, otherwise changes would not take effect.
    commit work.
    Regards,
    Hashir Ahmed

  • How to control Doublicate Entry while creating GL Master

    HI every one,
    Can any one let me know, how to control Doublicate check while creating GL Master. And also for AR and AP if possible.
    Thank you
    Satish

    Hello Satish,
    You can implement the logic to control duplication of G/L Master records either in
    a) Function Exit EXIT_SAPMF02H_001 available within the SMOD enhancement SAPMF02H
    b) P/S BTE 00002310 (Master Record G/L Account: Save)
    The logic would be to identify if G/L Accounts with same Short/Long Texts already exist in the Company Code.
    Hope this resolves your problem. Please reward points.
    With Regards
    Vijay Gajavalli

  • Getting error while creating a table

    Hi there,
    I have created a user 'ram' and gave "create table" permissions for that user.
    After that, when I tried to create a table using the command
    create table countries as select * from hr.countries;
    where hr is another user and countries is the name of table in that schemagetting error message
    ERROR at line 1:
    ORA-00942: table or view does not existNOTE: The same error occurs even while creating a table in 'ram' schema after granting sysdba rights to 'ram'
    Thanks
    Rajiv

    Hi,
    dose the user ram has SELECT rights on the table hr.countries. Can he do SELECT in that table.
    Thanks

  • I am receiveing error while creating Z table: Entry in table TAORA missing

    Hi Experts,
    I am receiving "Entry in table TAORA missing" while creating Z table.
    Please help
    Edited by: N_niki on Jun 11, 2011 9:22 AM

    Hi
    1) Check for the DB System. The Table name in  "Entry in table TAORA missing", meant to save the "DATA CLASS of the ORACLE application"., OR
    2) check for the Data Class you Selected, on Creation of the Z Table, for which an Entry exists in the TAORA or the Available DATA CLASS in the TAORA Table to fix it.
    Regards
    Gopu

  • Steps to follow while creating Database table in notes or paperwork

    what are the steps to follow while creating Database table in notes or paperwork
    Thank you,
    Regards,
    Jagrut Bharatkumar Shukla

    hi,
    1. Goto Transaction SE11.
    2. Enter the table name to be created. It should start with a Y or Z.
    3. Press Create
    4. Enter the Short description for the table
    5. Enter the Delivery class for the table. It can be 'A', 'C' or other.
    6. In the Fields tab, specify the table fields and the corresponding data elements or the built-in data types.
    7. If the table needs to be made a client-depenedent table, the first field should be MANDT.
    8. Goto Technical settings of the table and sepcify the Data Class and Size for the table. Also, there u can specify if buffering for the table should be allowed or not.
    9. Now, activate the table.
    if helpful reward some points.
    with regards,
    Suresh Aluri.

  • How to assign select-option values to internal table

    hi all,
    how to assign select-option values to internal table
    thanks in advance.

    Hi,
    You just need to loop at your select-option field and take the values from low and high fields.
    for. e.g
    loop at s_werks .
    move:s_werks-low to <your itab>
    if not s_werks-high is initial .
    move: s_werks-high to <youritab>
    endif .
    append <your itab>
    endloop .
    OR use select statement.
    regards,
    Omkar.
    Message was edited by:
            Omkaram Yanamala
    Message was edited by:
            Omkaram Yanamala

  • How many secondary index you can create on table

    hi,
    how many secondary index you can create on table?
    thanks,
    raj

    Hi,
    Maximun number of indexes for a table can be 9.
    check this FAQ
    http://www.sap-img.com/abap/important-abap-faq.htm
    Regards,
    Vinodh

  • Assignment of Project while creating TP

    Hi All,
    We have activated ChaRMLite in our project and all the systems in landscape.
    I have a scenario.
    We want few transports to be created outside chramlite for one system landscape (BI landscape), but we want to restrict users creating TP request without assignment of project. i.e is there any authorization or method by which we can make project filed mandatory while creating transport request from source system?
    I have learnt about the possibilities of it, but not sure how can I proceed. Any help appreciated.
    Best Regards,
    Shyam

    Shyam,
    In a new window plz type
    /n/tmwflow/cmsconf
    Then you will find the list of systems you manage with ChaRM, you can enable the mandatory assignment of projects there.
    In the second scenario where you need to do it for systems outside of ChaRM (i.e. not connected to ChaRM, plz consider the following steps)
    1. transaction SE03 --> Display/Change Request Attributes (last option under Administration Drop down menu). Then Goto Change Mode and then,
    2.Modify the attribute SAP_CTS_PROJECT  using client specific checkbox
    Hope that helps!
    Cheers!

  • How to capture an error while creating a purchase requisition

    Hello All,
    I append 50 line items while creating a PR using BAPI_REQUISITION_CREATE and I get an error in RETURN.
    So can I capture the line item which exactly has that error.
    I mean to say how to figure out the line item with error, if the BAPI gives an error.
    Please suggest.
    Thanks & Regards,
    Tarun Gambhir

    I could not find TEST_RUN option in these bapis
    Roundway will be
    1. Use BAPI_REQUISTION_CREATE with single line item  and create PR then take the requisiton number
    2. Use ME_UPDATE_REQUISITION. and add line by line into same PR (Within loop)
    BAPI_REQUISITION_CHANGE can only be possible to edit existing line and you cannot able to add new lines,
    a®s
    Edited by: a®s on Jul 29, 2009 11:13 AM

  • AIX 5.2 : how to pass password value while creating a user on AIX server

    Hi ,
    Test connection is successful with AIX server , I can successfully create a user on AIX server, with defualt password.
    I am not passing the any password value still some default value is being populated for the user...
    In AIX while creating the user , use get force to set the password...
    But while configuring the schema for AIX adapter ...if password attribute is given then it will give the error
    as invalid attribute...while creating a user if password value pass...
    how to set the password for the user..what attribute need to set for the password .
    thanks ..

    The default password might be the IdM account password of the user you are trying to provision. You don;t need to keep password in the resource schema. Just set password.password and password.confirmPassword and select AIX resource for password reset. Check the workflow-form-views document for more information on password view.

  • How to assign the role for created user  thru dynpro App

    Hi All
    How to assign the role for currently created user from Webdynpro App.
    when i enter into the portal after creating the user
    i am getting the following messgae in the portal
    "No portal roles are assigned for this user.If this problem persists, contact your system administrator."
    how to assign the user defined role for the created user from dynpro App
    Regards
    Dhina  Kar J
    Edited by: Dhinakaran Jeyachandran on Feb 1, 2008 12:19 PM
    Edited by: Dhinakaran Jeyachandran on Feb 1, 2008 12:35 PM

    In the User Administration section of your portal find your newly created user and below select "Assigned Roles" tab then press <Modify> button and look through available roles on portal then just simply add and save. But if you want to do it programmatically see below:
    IUserAcountFactory userFactory = UMFactory.getUserAccountFactory();
    // IUser - read only but with IUserAccount is possible to set up user data
    IUserAccountSearchFilter userFilter = userFactory.getUserAccountSearchFilter();
    userFilter.setLogonUid("superuser", ISearchAttribute.LIKE_OPERATOR, false);
    ISearchResult sr = userFactory.search(userFilter);
    for (final Iterator i = new PrincipalIterator(sr); i.hasNext();) {
      IUserAccount user = (IUserAccount) i.next();
    Execute the same search for IRole (or IGroup if needed) get the unique id of them and use newRole(...) and addUserToRole(...) methods from IRoleFactory.
    Of course you don't need search for this principals if you know uniqueness of them. Use appropriate factories to get'em all by this unique id.
    All the features see in  [javadocs|http://help.sap.com/javadocs/NW04S/current/se/index.html]

  • How to add shipping instructions while creating SO

    Hi All,
    I'm using the BAPI_SALESORDER_CREATEFROMDAT1 to create Sales Order.
    I want to add shipping instructions while creating each orders.
    How do I pass this information to the backend with this BAPI?
    Thanks
    Thruna

    Somebody knows like I can indicate to him to a button that I have in a form, that accedes to the image in the route where will settle addon? I have this, but it does not work to me
    oButton.Image = IO.Directory.GetParent(Application.StartupPath).ToString & "\CFL.BMP"

Maybe you are looking for

  • Regarding - Multiple PDF Attachment and Classical report o/p to PDF

    Hello all, 1.I am having a requirement wherein i have to convert a classical report o/p to PDF and send as an attachment. 2.Again another challenge what i am facing here is, I have already triggered a PDF attachment mail in my code, Now they want me

  • Password protect site for a group

    Is it possible to password protect an iWeb site for a group of people, so each user can create and select a unique username and password to enter the site? I am sure that I would need a 3rd party application to do this, but does anyone have any sugge

  • Still no fix

    Okay so i have b een on here asking for help for the last few weeks and even though you all have been very helpful it's still not solved, now the noise wont drop its high the engineer has been out 3 times and they say the line is fine but the hub say

  • Lightroom 4.1 just crashed and will not restart. what can I do?

    I am using creative cloud on windows 8. and last night in the middle of a project I was working on, Lightroom closed up on its own and now will not restart. what can I do?

  • Error in serializin​g ImaqdxExce​ption

    Hi All, I am trying to clone an ImaqdxException object using binary serialization and deserialization. I find that the serialization part is going fine but however, the deserialization throws up an error. Please find the sample code below ImaqdxExcep