Copy from column  to another column in same table

Hi,
Working on EBS Version : 11.5.10.2
Table Name : ASO_QUOTE_HEADERS_ALL
COLUMNS :
QUOTE_STATUS_ID NUMBER
ATTRIBUTE6 VARCHAR2(240 BYTE);
Need to copy from quote_status_id to attribute6 for that quote_header_id
example if quote_status_id = 10 then it should copy in attribute6 = 10 for quote_header_id = 69312
again if changed to quote_status_id = 10077 then it should replace with attribute6 = 10077
for quote_header_id = 69312
i wrote a procedure posted below:
CREATE OR REPLACE procedure SLC_STATUS_CAPTURE (p_quote_header_id IN number) is
BEGIN
UPDATE aso_quote_headers_all SET attribute6 = quote_status_id
WHERE quote_header_id = p_quote_header_id;
end SLC_STATUS_CAPTURE;
then calling this trigger through table level
BEGIN
SLC_STATUS_CAPTURE(:OLD.QUOTE_HEADER_ID);
END;
it is giving an error.
Please i need some help.
Thanks and Regards
Vijay

John Spencer wrote:
As others have mentioned, you cannot change column values in a statement level trigger. Also, you cannot
update the table that the trigger is firing on. If I understand correctly, you want to copy the value of
quote_status_id into attribute6 whenever a row is inserted or updated. If that is correct, then you only need a simple trigger like:
create trigger trigg
before insert or update of aso_quote_headers_all
for each row
begin
:new.attribute6 = :new.quote_status_id;
end;Thought why anybody would want to do this is beyond me - you already have the info
in your attribute6 column - what's the point in simply copying it to another column in
the same table?
Paul...
John

Similar Messages

  • Copy the data from one column to another column using @

    I have two columns here - A and B.
    Column A has a complicated formula that will generate results. I wanted the results in Column A to be reflected in Column B without pasting the A's formula in B. This will save me the trouble of editing formulas in more than 1 column if there is a need.
    I saw somewhere that you can use "@" in column B but I have no idea how to use it.
    Assumingly column A is the first column. I tried to insert '@1' in B's formula and change B's column properties' Data Format as "Treat Text as HTML". It does not work.
    Please advise how I can do that.

    So is there any way to copy the data in Column A into Column B without putting the same formula? something like in Excel where we put "=C1". Its not possible in BI as it comes in excel.....The only way is to create a duplicate column in RPD or Answers screen and incorporate the formula and giving different name to it.
    whats the problem if you duplicate the column with same formula?....Ok still if you dont want to see identical just write some pseudo logic say
    Duplicated column f(x) case when 1=0 then column_name else formula end.....so it appears different to see but it outputs same.
    UPDATED POST
    Dont create in RPD,you can create a dummy column in that report request and change the f(x) to the above case i mentioned by taking the column from columns button in edit formula screen so when ever you edit the actual column formula that would reflect in the dummy column also as it is replicating from original one.Try and see
    hope helps you.
    Cheers,
    KK
    Edited by: Kranthi.K on Jun 2, 2011 1:26 AM

  • How can I Move data from one column to another in my access table?

    I have two columns, one that stores current month’s data and one that stores last month’s data. Every month data from column 2 (this month’s data) needs to be moved to column 1 that holds last month’s data. I then null out column 2 so I can accumulates this month’s data.
    I understand how to drop a column or add a column, how do I transfer data from one column to another.
    Here is my trial code:
    <cfquery name="qQueryChangeColumnName" datasource="#dsn#">
      ALTER TABLE leaderboard
      UPDATE leaderboard SET  points2 = points3
    </cfquery>
    Unfortunately, I get the following error:
    Error Executing Database Query.
    [Macromedia][SequeLink JDBC Driver][ODBC Socket][Microsoft][ODBC Microsoft Access Driver] Syntax error in ALTER TABLE statement.
    How can I transfer my data with the alter table method?

    I looked up the Access SQL reference (which is probably a
    good place to start when having issues with Access SQL), and
    it suggests you probably need a WHERE clause in there.
    I agree the documentation is a good place to start. But you should not need a WHERE clause here.
    Too few parameters. Expected 1.
    If you run the SQL directly in Access, what are the results? At the very least, it should provide a more informative error message..

  • Plotting Time Stamp from Txt file in Column to another column

    I want to know how to plot 2 columns that i am reading from a text file.
    column 1 has a time stamp in HH:MMS,  and column 5 has data in which i want to plot the time verus the data.

    The Scan from String function will do most of those conversions in a single step.  Here are a couple of examples.  You will still need to read the array of strings in and process in a loop.
    Message Edited by DFGray on 03-19-2010 07:46 AM
    This account is no longer active. Contact ShadesOfGray for current posts and information.

  • How to place one column under another column in obiee report?

    Hi all,
    I am new to obiee, so need some help from obiee experts. Can anyone tell me how to place one column data under another column in obiee report?
    i need the report to be as below
    category total_students Course_enrollment Test_attended pass_test
    total N % N % N %
    all students ##### ## ## ## ## ## ##
    Ethnicity
    Asian ###### ## ## ## ## ## ##
    African American ###### ## ## ## ## ## ##
    white ######
    Filipino ######
    Gender
    Male ##### ## ## ## ## ## ##
    Female ##### ## ## ## ## ## ##
    and similarly for other columns
    where ethnicity, gender are columns in the table and Course_enrollment, Test_attended, pass_test are calculated columns.
    Please help me to create a report as above if anyone knows how to do it.
    Edited by: Shailaja on Jul 19, 2010 12:23 AM

    Two ideas I can think of:
    1) Create multiple pivot tables and then display them one under the other
    2) Create multiple measure columns such as "male_amt", "female_amt", "white_amt", "asian_amt", "black_amt", etc. for all the columns you need. Then you could simple stack them in a single pivot table.
    Option #2 might give you the prettiest results - but also requires a lot more maintenance (for instance, if you reclassify ethnic groups, you'd have to go through the reports to add additional metric columns).
    Hope this helps,
    Scott

  • Max of one column in another column

    HI all
    I have a scenario in the WebI report where I need to get the Maximum value from one column and use that maximum value in calculation of another column for each row in that column.
    for ex:
    column A      
    1
    2
    3
    4
    5
    Max of column A [MAX]= 5
    Column B  
    1/ [MAX]
    2/[MAX]
    3/[MAX]
    4/[MAX]
    5/[MAX]
    Column B calculation is some thing like described above.
    but my issue is, in WebI values are caluclated row wise and while generating values for the first row in column B, it picks the value 1 but the MAX value is not yet caluclated and if I use Max variable it is caluculating as 1/1 for first row and 2/2 and 3/3. Instead of 1/5, 2/5, 3/5.
    Any idea please share it.
    Thanks
    Edited by: saathiyaa on Feb 19, 2011 1:23 AM

    No its not working, well actually columb B is nothing but individual value of that row divided by max of that row
    for ex:
    1/5
    2/5
    3/5
    4/5
    5/5
    But if i have formula like  COLA/MAX[A]
    it is cosidering as 1/1, 2/2, 3/3, 4/4.5/5
    becuase webi caluclates row wise, so when it is in first row you will see maximum of that column is not yet calculated so it is taking as 1/1 not 1/5.

  • Compare column to another column with a specific value?

    What i need to do is compare a column that holds the SiteNames of holidays to another column with the DifficultyDescription of holidays.
    I want to show that sites that are not included in boldANY*bold* holiday with an “easy” or “moderate” rating.
    Some of my SiteNames have holidays with different difficulty ratings....
    e.g Yellowstone National Park(SiteName) - H2 - Moderate(DifficultyDescrip)
    Yellowstone National Park(SiteName - H3 - Strenuous(DifficultyDescrip)
    In this example i would want Yellowstone not to be in the results of my query as one of its results is 'moderate'.
    I want to show holidays that are not in boldANY*bold* holiday with 'easy' or 'moderate'
    Here is my attempt so far...
    select it220_holdet.holcode.holcode as holcode
             it220_holdet.diffdetails.diffdescrip as diffdescrip
             it220_sitedetails.sitename as sitename
    from it220_holidaydetails it220_holidaydetails,
    etc....
    where it220_sitedetails.sitename != it220_diffdetails.diffdescrip = 'Easy' <<<< where the sitename is not equal to a difficulty description of 'Easy'
    and     it220_sitedetails.sitename != it220_diffdetails.diffdescrip = 'Moderate' <<<< where the sitename is not equal to a difficulty description of 'Moderate'
    Is the logic of this correct? The error message i am getting is SQL command not properly ended.
    Is this more of a syntax problem than logic. Any help would be great.
    Thanks in advance!
    Edited by: Jay on 19-Nov-2010 02:47
    Edited by: Jay on 19-Nov-2010 02:47

    Hi,
    Ok,
    Problem is in this part of query
    where   "IT220_HOLIDAYDETAILS"."DIFFRATING"="IT220_DIFFDETAILS"."DIFFCODE"
    and      "IT220_HOLIDAYDETAILS"."HOLCODE"="IT220_LOOKUP_SITEHOLIDAY"."HOLCODE"
    and      "IT220_LOOKUP_SITEHOLIDAY"."SITECODE"="IT220_SITEDETAILS"."SITECODE"
    and "IT220_SITEDETAILS"."SITENAME" = "IT220_DIFFDETAILS"."DIFFDESCRIP"
    and "IT220_SITEDETAILS"."SITENAME" =  "IT220_DIFFDETAILS"."DIFFDESCRIP"
    Check are you joining correct columns.
    And remove possibility that tables values are in different cases
    SELECT "IT220_HOLIDAYDETAILS"."HOLCODE" AS "HOLCODE",
      "IT220_HOLIDAYDETAILS"."COUNTRYVIS"   AS "COUNTRYVIS",
      "IT220_DIFFDETAILS"."DIFFDESCRIP"     AS "DIFFDESCRIP",
      "IT220_SITEDETAILS"."SITENAME"        AS "SITENAME"
    FROM "IT220_SITEDETAILS" "IT220_SITEDETAILS",
      "IT220_LOOKUP_SITEHOLIDAY" "IT220_LOOKUP_SITEHOLIDAY",
      "IT220_DIFFDETAILS" "IT220_DIFFDETAILS",
      "IT220_HOLIDAYDETAILS" "IT220_HOLIDAYDETAILS"
    WHERE UPPER("IT220_HOLIDAYDETAILS"."DIFFRATING")  = UPPER("IT220_DIFFDETAILS"."DIFFCODE")
    AND UPPER("IT220_HOLIDAYDETAILS"."HOLCODE")       = UPPER("IT220_LOOKUP_SITEHOLIDAY"."HOLCODE")
    AND UPPER("IT220_LOOKUP_SITEHOLIDAY"."SITECODE")  = UPPER("IT220_SITEDETAILS"."SITECODE")
    AND UPPER("IT220_SITEDETAILS"."SITENAME")         = UPPER("IT220_DIFFDETAILS"."DIFFDESCRIP")
    AND UPPER("IT220_DIFFDETAILS"."DIFFDESCRIP") NOT IN('EASY','MODERATE')Regards,
    Jari

  • Need Help in Next value of column to another column

    Hi,
    I am creating view in oracle 10g in which i have 1 custom column who's value are the next value of the another column.
    E.g.
    C 1 -----C2 ------ custom-C3
    10 -------1 --------------2
    10 ------ 2 ------------- 3
    10 -------3 ------------- 3
    11 -------1 ------------- 2
    Now is there any function in oracle which gives me to generate "custom-c3"
    which gives the data for next value of column 2
    Thanks.

    Hi Frank,
    Thank you so much......its working fine in 10 g.....
    but for the last row of its coming emply or null but i want value of c2 if its last value.
    e.g
    C 1 -----C2 ------ custom-C3
    10 -------1 --------------2
    10 ------ 2 ------------- 3
    10 -------3 ------------- 3
    11 -------1 ------------- 2
    In the above the value of c1 is 10 i.e last one then value of c3 should be value of c2 i.e. 3.
    Can you use IF function?
    Thanks.
    Message was edited by:
    user650690

  • Sql join on two tables where column like another column

    hi all,
    been trying to get the results from a join between two tables where one column is like another one.
    table1 (nameA) examples: black2, green1
    table2 (nameB) example: black2.location.uk.com, green1.location.uk.com
    so for example I want to match all those in table1 with black2 to the column in table2 that begins with black2 and so on if you see what im trying to get at!
    my sql so far:
    select * from  schema.table1 a
    join schema.table2 b
    on a.nameA like concat('%', b.nameB, '%'); but it errors:
    ORA-00909: invalid number of arguments
    00909. 00000 - "invalid number of arguments"
    Any help or advice would be greatly appreciated, thankyou!

    Either of these should do it...
    select * from  schema.table1 a
    join schema.table2 b on a.nameA like '%'||b.nameB||'%';or
    select * from  schema.table1 a
    join schema.table2 b on instr(b.nameB,a.nameA) > 0

  • Printing the totals of 1 column under another column

    Hi all,
    I have an internal table with 3 fields A, B, C .
    I want to print the subtotal of the column 'C' under the column 'A'.
    eg:
    Material_Group    Matnr     Cost
    MG1                   M1         C1
    MG1                   M2         C2
    (C1 + C2) 
    (This should come under the column "Material_Group" instead of the column "Cost" )     
    Hope that the requirement is clear. Please help me out in this ..
    Thanking you in advance,
    Shankara Narayanan T.V

    Hi,
    Please use the 'At New' command to get the new material group. take the sum in a variable and use the write statement as shown below.
    Write:/ sum under 'Material_group'
    Thanks,
    Ajith V

  • Update column based on values of same table

    I have table T1 with 4 columns 'col1','col2','col3','col4', 'col5','col6' as follows
    Col1     Col2     Col3     Col4     Col5     Col6
    1111     City1     C     AA     DDD     A1
    2222     City 1          DD     HHH     A1
    3333     City2     B     EE     OOO     
    4444     City 1     B     JJ     SSS     A1
    5555     City2     C     KK     VVV     
    6666     City2          RR     QQQ     
    7777     City2     B     XX     BBB     
    I have already updated Column 6with value ‘A1’ where Column 2 is ‘City1’.
    Now I want to update col 6 where col2 is ‘S’ with following conditions
    If Col 3 = ‘B’ then Col6 should be = col4
    else it should be = col5

    SET col6=DECODE(col3,'B',col4,col5)
    WHERE col2='S'

  • Help copying from Graphics2D to another Graphics2D

    Hi all!
    I'm trying to copy the information of a Graphics2D to another Graphics2D. Long story short: I want to copy the content of an iText PDFTEMPLATE to a BufferedImage. Both have acces to its own Graphics2D component, so I thought it'll be the easier way to accomplish it... but can't get it working :/
    Thanks in advance :)

    Try this:
    Graphics2D g2d1 = g2d2.clone();

  • How do i transfer funds from one account to another in the same table?

    Say for example i want to transfer funds from UserID 1111101 to UserID  1111103.
    Anyone know the procedure for this. I use php/mysql and dreamweaver.

    Here's a very basic method. Note that this is just pseudocode - you'll need to work out the actual code (I assume you've learned how in your course studies). Keep in mind this is a very simplified workflow - a real bank transaction would be MUCH more complex.
    Create a form that has fields for debit account, credit account, amount
    In your script, assign the values from the form to local variables
    $debit_acct
    $credit_acct
    $amount
    I'll assume you have an account balance table 'acct_bal'. Have a journal table to store those values along with the date and autonumber transaction id.
    Begin Trans
    INSERT into journal (credit_acct, debit_acct, amount, trans_date) VALUES ($credit_acct, $debit_acct, $amount, NOW())
    Get the transaction_id ($trans_id) from the INSERT statement- the method depends on which MySQL interface you are using.
    UPDATE acct_bal SET balance = (balance + $amount) WHERE acct_id = $debit_acct
    UPDATE acct_bal SET balance = (balance - $amount) WHERE acct_id = $credit_acct
    Rollback on any SQL error else Commit Trans.

  • Copy from clipboard and paste in Web Dynpro table

    Hi
    I have a client requirement where the client wants to copy the table from some already existing application and paste the data  directly in web dynpro java table.  It is similiar to copy the data from clipboard and paste it directly in web dynpro table.
    I would like to know is it feasible. If yes, please provide some links or guide me on achieving the same.
    Thanks
    Harsimran

    Hi
    I think one way you can do it,
      1 . try to export the table dato to excel sheet.(copy and paste to excel)
       2. Importing the excel data to WD table.
      for more details about reading excel data, there is many blog on sdn just check it.
    Hope will help you
    Thanks

  • Imp records of One schema into another schema of same table.

    I had done following steps,
    schemas(toy,toys)
    1) i open the session of toy schema
    First i taken backup of table
    create table bck20121103_himan as select * from himan;
    Backup table is created.
    After taking the Backup table
    delete himan;(deleting the records)
    2) i log in to another session(toys)
    exp toys/toys@orcl file=20121103TOYs.DMP TABLES=(HIMAN) /* Particular table is taken*/
    3) i log in to toy schema
    imp toy/toy@orcl file=<dump file name> TABLES=(HIMAN) INDEXES=N IGNORE=Y
    i tried the above statement it taken so much of time..
    Later i tried
    I log in to toy session
    i rename the table with other name.
    later i imported
    imp toy/toy@orcl file=<dump file name> TABLES=(HIMAN) IGNORE=Y FULL=Y
    it's successfully imported..
    kindly correct me if its wrong or any other steps is their ..

    as per your first method.
    you took backup
    you deleted not commited.
    took export from toys and imported into toys without fromuser & touser
    after correction.
    ============
    you mentioned
    you took backup
    you deleted toy.himen (again not commited)
    exported toy.himen
    imported toy.himen
    check you might have got the duplicate records also
    when you delete any records its a dml operation which does not auto commit you need to commit it.
    hope you got the point.
    Regards
    Kaleem.

Maybe you are looking for

  • Two Spry Issues

    Widget issue one I returned to a company where a site was built. The builder used spry sliders or accordians, which are brand new to me. In evaluating the site, I notice that the Spry objects jog a little, left to right or vice versa. Is this normal

  • How does the DAQmx read.vi work in producer/consumer mode

    Dear all, I have one question: how does the DAQmx read.vi work in producer/consumer mode ?  I mean if i set the acquisition samples quantity is 5000,(see the enclosed picture), how does the DAQmx read.vi acquire the samples ? 5000 samples one time ?

  • Scanned document printing too small

    Hi, I'm using Mac OS X 10.4, Epson 1660 Photo Scanner and Epson TWAIN (via Photoshop). I'm scanning a document for print, yet no matter what dpi I choose, the document prints out very small on my Canon i850 inkjet printer. I've wasted about 10 pages

  • Micro SD card from BlackBerry to Xperia z1

    Hi.  I got an Xperia device and am trying to migrate the data from my old phone (BlackBerry) to my new phone. Could someone tell me what is going to happen if the micro SD card from the blackberry device with data such as as photos are inserted to th

  • Photoshop cc not working with Yosemite

    Is anyone having issues with Photoshop CC working with Yosemite? My screen is pixilating after about an hour and I can't get any work done. Anybody hearing about similar issues?