How to add ID autogenerate column to VIEW

Hi all,
Could anybody help me create a View with its own identifier column?
I use to create VIEW following syntax:
CREATE VIEW MY_VIEW AS
t1.f1 FIELD_1, t2.f2 FIELD_2
FROM t1 LEFT JOIN t2 ON t1.f3 = t2.f3
I tried to use sequence like:
CREATE VIEW QUALIFIED_CHAR_REL AS
SEQ.nextval ID,
t1.f1 FIELD_1, t2.f2 FIELD_2
FROM DUAL, t1 LEFT JOIN t2 ON t1.f3 = t2.f3
or
CREATE VIEW QUALIFIED_CHAR_REL AS
SELECT (SEQ.nextval FROM DUAL) ID,
t1.f1 FIELD_1, t2.f2 FIELD_2
FROM t1 LEFT JOIN t2 ON t1.f3 = t2.f3
No result. Is it at all possible? What solutions could match this situation?
Thx in advance for help!
Edited by: 878800 on Aug 11, 2011 3:25 AM

Could anybody help me create a View with its own identifier column?Why would you want to do this? A view is simply "View" of data in other tables. Any ID you would artificially create in your view for this data is not persistent. More over, as a view executes the underlying query each time someone selects from the view, your artificial ID would be constantly changing (if you were to use a Sequence, as you attempted).
Once the data in your underlying table(s) changed to the point where the View's SQL excluded a record you would loose the ID and data from your view. Any table data that is using this view ID would instantly become orphaned and invalid. Creating a view with it's own ID is a bad idea in my opinion and is prone to cause errors in any other table or view that might use this view ID. It would be better to display the Primary Key ID of the primary table used in your view than to create an artifical ID just for your view.
Also, as your question does not pertain to Oracle Forms, it would be best if you had posted your question in the PL/SQL forum.
Craig...
Edited by: CraigB on Aug 11, 2011 9:04 AM

Similar Messages

  • How to add few more columns in UWL screen

    Hi all
    Currently by default we are able to see the columns in UWL header as "Subject", "From", "Sent Date" , "Due Date" , "Status" .
    now i want to add few more columns  apart from standard columns.
    can you please let me know how to add our own columns in UWL header ??  if it is XML changes then pls let me know which xml file exactly we need to change??
    Thanks
    Sunil

    Hi Harini
    actually Standard XML file is not necessary for changing the column names in the UWL .
    we can use otherway as follows.
    go to system admin->UWL administration->click to configure item types and custom views using a wizard then it will take you to another screen -> select the radio button "Customize the look of the UWL main page" click on next then you can select what ever task item you want to change and click on the button respective button at the right end then it will take you to new screen there i added new columns  what ever required and saved also but the same one is not reflecting in UWL....
    can you please check the same in ur machine and let me know if any other things are required to be done and why this not been done our requirement??
    Regards
    Sunil

  • How to add addtitional pages in design view?

    How do I create additional pages in design view?  I have tried using NEW PAGE AFTER, but that doesnt add another page in design view, like I need. 
    I am creating a report that uses 8 subreports per page to dynamically create labels.  Currently I have a report header, and am using the page header to arrange the subreports so the top of each subreport prints on the top of each label.  The fields in the subreports can grow, and fill in the label from the top down. 
    I need to create a multiple pages using this format, but I dont know how to add more pages in design view.  Essentially I need subreports 1-8 on page 1, 9-16 on page 2, etc.  I would like to preserve the formatting I have created thus far, but I can always change it if I have to.

    In attempting to create the label sheets I needed, I ended up creating 14 separate reports (which report on 6 individual queries), because there are 14 pages worth of labels that need to be created.  What I wish to accomplish is to condense these 14 reports down to 6 reports.  One for each query.  What I absolutely cant find a way to do, is to get Crystal Reports to allow me to customize subreports on consecutive pages.  Again, I have 8 subreports on each page, which have been formatted to fit on 8 labels when printed.  Each subreport is identical in design, but has a different range selected (i.e. my driving value in each subreport has been modified with Select Expert to be between 1 and 5, or 6 and 10, or 11 and 15).  This is how I have been able to return 5 consecutive results on each label, with the next label returning the following 5 results. 
    My ultimate question:  Is it possible to create a multi-page report using this method?

  • How to add a new column (Project Number) in the action items table under NPD Module?

    There are two projects with same name and created by same person in NPD.
    So when it is displayed in "Action Items" table, It looks similar.
    To avoid this, I need one more column (Project Number) to be added in the "Action Items" table and " Strategic briefs and projects" table.
    So, How to add a new column (Project Number) in the "Action Items" table and " Strategic briefs and projects" table under NPD Module?
    Please do the needful.

    There is no out of the box configuration available to add columns to NPD action items.   As always we welcome enhancement requests. 
    Thanks
    Kelly

  • How to add a formula column in a report

    Hi
    I have made a report based on a query.
    There are 3 columns in the query and all the 3 are displayed.
    Now I want to add a new column (fomula column) to the report.
    I want to write a query inside the formula column. To execute the query col1, col2 and col3 values are required in the formula column.
    Could you please tell me how to add a formula column in the report and how to pass database column value to inside the formula column
    regards

    Here is how you would create a formula column:
    Open data model of the report.
    Formula column button is on the left side of the tool palette.
    Click on that button.
    Now click in the query group where you want to place the formula column.
    You would see a new field something like CF_1. That is the formula column.
    Double click on the field CF_1. It will open property inspector.
    You would see, Datatype of the formula column is Number. Change this as per your requirement.
    Double click on PL/SQL Formula property. It would open up a editor. Here you can write the code.
    And now to access the data model column here, you can use : and column name. i.e. :col1 or :col2, etc
    And remember you have to return the value back to the formula column. Like this: RETURN(some value).
    You can also take a help from here:
    http://download.oracle.com/docs/html/B13895_01/orbr_howto.htm#sthref1309
    Hope this helps.

  • How to add an unique column to an existing table?

    How to add an unique column to an existing table?
    I have a large table which has no unique constraint. and I want to add an unique column for it. How to do it?
    Does adding a sequence is a good choice? How to do it?
    Thank you

    Hi,
    alter table tablename
    add constraint contraint_name unique (columnname);but before that you need to check in the table.column there is no duplicate record exist.
    Does adding a sequence is a good choice?
    Your talking about unique constraint then yes.
    Regards,
    Taj

  • How to add the Assignment column on this post outgoing payment in f-53

    Hi all,
    how to add the Assignment column on this post outgoing payment in f-53?
    thanks.
    Joo

    Hi ,
    If you want to see the assignment column in f-53 process open item screen
    1. First in O7V3 check for t.code FBz2 which line layout ( 2 digit code is assigned)
    2. Then in t.code O7z4s check in the line layout and if assignment field is not there then insert the field.
    then check in F-53.
    Hopw it will solve your problem.
    Assign points if useful
    Regards
    Prabhat

  • How to add one date column and charecter column

    hi all,
    i have 3 column start_date(date),end_date( date),duration (varchar2)
    i am trying to add start_time and duration like this
    end_date := to_char(start_time) + duration;
    but its showing value_error
    how to add one date column and charecter column.
    Thanks

    you need something that does:
    end_date (DATE) := start_date (DATE) + <number of
    days> (NUMBER)Not necessarily, because if the duration is just a string representation of a number then it will be implicitly converted to a number and not cause an error
    e.g.
    SQL> ed
    Wrote file afiedt.buf
      1  with t as (select to_date('01/07/2007','DD/MM/YYYY') as start_dt, '3' as duration_days from dual)
      2  -- END OF TEST DATA
      3  select start_dt + duration_days
      4* from t
    SQL> /
    START_DT+
    04-JUL-07

  • How to add a new column to specific position

    Hi,
    How to add a new column to specified position in a existing table.
    I have using the oracle database 10g.
    This below code is not working in oracle 10 g
    example:
    ALTER TABLE EMPLOYEE ADD DEPT NUMBER FIRST:
    ALTER TABLE EMPLOYEE ADD DEPT NUMBER AFTER JOB:
    Please provide the correct syntax.

    Hi,
    When you add a column to the existing table, the column added i.e., for ex updatedon appers in the last. If you want the columns to be
    displayed in Specific order. Just give the column names in the SELECT.. statement.
    For your Information, But it is not good in Table design. Just to give something useful.
    If you want to add a column at a specified position,
    Rename the position column to the new column name
    For Ex: (OLD_COLUMN_NAME-Hiredate)
    ALTER TABLE EMP RENAME COLUMN OLD_COLUMN_NAME TO TEMP_HIREDATE;Add a New Column to Table
    ALTER TABLE EMP ADD LAST_DATE DATE;Then, Alter the Table to rename the new column that is added.
    ALTER TABLE EMP RENAME COLUMN LAST_DATE TO OLD_COLUMN_NAME;And, Rename TEMP_HIREDATE to your actual collumn.
    ALTER TABLE EMP RENAME COLUMN TEMP_HIREDATE TO LAST_DATE;In practise, this won't be a good approach but you can get something useful about renaming the
    column atleast.
    Thanks,
    Shankar

  • Reg:How to add availability check in sales view

    hi all
    How to add availability check in sales view
    regards
    JK

    HI Janardan..
    Check out the help.sap link for Availability check. It has a lot of info.
    http://help.sap.com/saphelp_erp2005/helpdata/en/6b/2785347860ea35e10000009b38f83b/frameset.htm
    If it helps Reward with points..
    Regards Rk

  • How to add a Description Column in the Content Panel (Bridge CS5)

    Hi,
    Is it possible to add a Description Column in the Content Panel. If so, how?
    I'm talking about the Description from the IPTC Core data and I'm using Bridge CS5.
    Thanks in advance,
    Frank

    This is the screenshot of the Metadata Workspace with the Content Panel (not Metadata Panel). As you can see it shows Name, Label, Keywords etc. but it's not possible to show Description in that list as a column.
    I still agree that it would be a big bonus if you could alter this workspace with description field (even with more lines etc) but what Curt shows you might be an alternative. I couldn't help noticing that you have not created your own custom workspaces.
    Try and play with this. You have the option to divide the window in 3 columns max but you can create different panels as a row in 1 column.
    Grabbing a tab and move it to a new location until a single blue line appears (between the borders, a bit tricky). A vertical blue line means as a column and a horizontal line means a row. A surrounding blue line means same panel but adding as a tab. You can rearrange the tabs by dragging to left or right. under the menu window you can select which panels are visible or use right mouse click menu on top of a panel to choose.
    Sadly enough only 3 columns and only one panel of it's kind per workspace, but you can resize the panels also to your own workflow needs.
    In Bridge preferences you can change the colors for background in the general tab and in the metadata tab you can select what info to view in certain sections. Personally I have set my IPTC to view only description, keywords, date created and a few other subjects.
    That is the nice thing about Bridge, creating custom workspaces, save them and being able to recreate them without problems :-)
    I attach some screenshot of my daily workflow (with the luxury of having a 30' screen) but there are plenty of other options possible, don't forget to name and save your workspace.

  • How to add a new column as "Warehouse name" in Goods Receipt PO screen?

    Hi, Experts
    I hope to add a new column or just "display" warehouse name besides Whse column in Goods Receipt PO.  How can I do?
    Thanks

    still not work.
    Maybe I did something wrong in UDF definition. Please help to check.   Thanks
    I named UDF as WhseName, and set it as Alphanumeric and lengh is 20, structure is Regular. And all below check-boxes are not ticked.
    And in Goods Receipt PO screen, I marked the UDF as Visible and Active.
    Then I ALTSHIFF2 in the UDF fields, and FMS screen displayed.
    Then I chose the 3rd one: Search in Existing User-defined value According to Saved Query
    T05
    Auto Refresh when field changes is not ticked.

  • How to add a new column  as T-Code in PFCG

    Hi
    I want to remove some existed Tcodes from role via PFCG. But there are just one column as T-Code description. That's very trouble for finding out T-code. I also try to add  column as T-code. But I cann't find out it.
    Everybody can tell me how to add it?
    Regards
    Henry

    hi,
    go to Tcode PFCG ->menu
      in that you will find Role menu . in that you will be having all your Tcode nodes .
    just right click on the node which you want to delete and select delete node

  • How to add 1 more column in standard portal UWL and map the values.

    Hi
    I have one issue/requirement, please help me out on that also.
    In portal UWL, i want to add one more column TICKET ID COLUMN, and ticket id value I  will be putting as work item ID of abap Workflow, so whenever  approver opens his portal UWL, in first column i want to show ticket ID say 00012345, so how to add this ticket ID column in standard portal UWL and how to put/map  value of work item in that column.
    My idea behind this is, when ever say employee wants to know the status about his ticket ID, he can simply ask his manager regarding the ticket status by referring to that ticket ID which manager can easily find in his portal UWL in that extra TICKET ID COLUMN .
    Do I have to change anything in SAP inbox also ? Do i have to add 1 more colum in sap R/3 inbox also ? and will adding 1 more colum in sap inbox (R/3 inbox), will create automatically one more ticket ID colum in portal UWL also ?
    please let me know , as i do not want to add 1 extra column in R/3 inbox, just i want in portal UWL extra ticket ID column should come and i want to put workitem ID generated at the start of workflow, in that colum in portal UWL
    please help me on this.
    Thanks...
    Edited by: User Satyam on May 29, 2011 6:16 AM

    Hi Satyam,
    These are called custom attributes.  Here is a powerpoint that may be able to assist you with the documentation that the other poster gave you too.
    Always remember too when you make a change on the backend R/3 side, you must reregister your UWL connector.  And yes, the column must be available on the backend R/3 side.  We can't create on the fly columns in the UWL, that have no reference to the backend system in this case.
    Beth Maben
    EP - Senior Support Consultant II
    AGS Primary Support
    Global Support Centre Ireland
    Please see the UWL Wiki @
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/bpx/uwl+faq  ***

  • How to add a new column in 8.1.7

    Can anyone tell me how to add a column to table in 8.1.7
    Is it same like 9i
    Regards

    Here is example;
    SQL> select * from v$version;
                             BANNER
    Oracle8i Enterprise Edition Release 8.1.7.4.0 - Production
    PL/SQL Release 8.1.7.4.0 - Production
    CORE    8.1.7.0.0       Production
    TNS for IBM/AIX RISC System/6000: Version 8.1.7.4.0 - Production
    NLSRTL Version 3.4.1.0.0 - Production
    SQL> create table t1(col1 number);
    Table created.
    SQL> alter table t1 add (col2 date);
    Table altered.
    SQL> desc t1
    Name                                      Null?    Type
    COL1                                               NUMBER
    COL2                                               DATE

Maybe you are looking for