Help with :new and :old keywords

I am trying to write a trigger that calls a cursor with info from the user_tab_columns. Then I use the cursor in a For-loop for accessing a specific column for each row. Ineed the :new value of the specific column to pass it as an argument to a procedure. Here is my code:
For each_r in MyPackage.PrimKey_Cursor (TABLENAME)
Loop
New_val := (:new.| |each_r.Column_Name);
MyPackage.LogIns ('TABLENAME', each_r.Column_Name, New_val);
End loop;
My problem is the New_val variable pass only the string :New.COLUMNNAME instead of the new value of the COLUMNNAME.
How can I do this passing of :new, :old values to a procedure when the column name is variable?
YOur help is greatly appreciated.
Thaks,
Cip

IMPLEMENTS
By using the implement keyword I am 'agreeing' to use
(implement) the methods of that interface. I am still
required to import the correct package for the
compiler to see the interface I have implemented. If
I attempt to use the
actionPerformed() method without implementing the
actionListener interface it will not be recognized
and therefor will result in a compile-time error.You can write an "actionPerformed" method without saying that you are implementing ActionListener. But, even if you have an actionPerformed method with the correct signature (name and parameter types), you won't be able to add your class as an ActionListener to a JButton. The compiler expects an ActionListener for "addActionListener". If you didn't tell the compiler that your class is an ActionListener by writing "implements ActionListener", it would give you an error on the "addActionListener(this)" line.
IMPORT
Allows me to access with out full classpath the
methods and objects of any packages that I have
impoted. The reason I do not have to do this with
System.out.println() is because that is in a package
that the compiler has default access to.
If I were to attemp to use JTextArea without first
importing Javax.swing.*;
I would get a class not found error....You never actually have to explicitly import anything. You could instead write all of the classnames out in full as:
public class KeyEventDemo extends javax.swing.JPanel
             implements java.awt.event.KeyListener, java.awt.event.ActionListener
    javax.swing.JTextArea displayArea;
    javax.swing.JTextField typingArea;
    static final java.lang.String newline = "\n";
}Using import statements makes your code a little easier to write, because the names are shorter.
Actually, your main method has an example of using a class without explicitly importing it:
javax.swing.SwingUtilities.invokeLater(...);
so, am I right or at least near right?Yes. Some right, some near right. :)

Similar Messages

  • Using dbms_xmlgen.getxml with new and old tables in triggers

    Is there a way to use getxml against the data stored in the new and old tables in a trigger? Simply doing this:
    Xml_Variable := dbms_xmlgen.getxml('Select * from New');
    Does not work.
    Edited by: user13302591 on Jun 16, 2010 1:16 PM

    user13302591 wrote:
    How would I pass the information from the :new and :old to getxml?What are you trying to do? You could use, for example:
    XMLELEMENT("old",:old.column_name)
    XMLELEMENT("new",:new.column_name)SY.

  • Check battery error with new and old batteries.

    I came back from vacation last month, and the battery on my late 2006 Macbook would not charge. The Apple store said the magsafe connector was bad, and replaced it for $98. The next day I had the same problem, and when I took it back they said that now it was the logic board. None of the "geniuses" had any idea what was the failure was just swap parts until it works. I now have the "Check Battery" condition, and no idea what that means. I am sure that if I take it back to the Apple store they will say buy a new $100 battery, after all this one has three cycles on it! Dose anyone know what Check Battery means, and what conditions set this message, and how to clear it?

    Thanks Carolyn. It appears that battery condition is set during a recalabrate only. It would be nice if Apple would produce a “white paper” on battery management for Li-ion batteries. There are no significant “trade secretes” in the management software that have not been reverse engineered long ago. Information as to what Recalibrating really does when it “Recalibrates”. What it means when Apple says the design life is 300 charge cycles. Information about how battery life is a statistical function, and may fail at 150 cycles, or may go 1000. What information the battery sends to the computer, and what the computer sends back. This would help eliminate the many posts on these forums, and people getting frustrated with the lack of information from Apple.

  • Setting up home network with new and old Macs and 1GBps internet connection

    I have a 1 GBps internet connection and want to take advantage of it. I have three 802.11ac capable Apple products - a Macbook Air, Macbook Pro and  Imac. The signal currently runs from an Aris modem into a  Netgear router that maxes out at 100mbps. My Apple Extreme (not the new one with 802.11ac) is connected to the Netgear , so choked at 100mbps. Everything runs off Wifi. I have run speedtests on all my computers and nothing runs over 50mbps in the current setup. I also run some home security stuff off "DDNS" that does not work with Apple products (thus the Netgear router) so I need to consider that too. I use two  802.11n extenders around the house. I am being told I cannot use the newer 802.11ac Extemes because it would not work with the DDNS Security stuff. What do I do to maximize speeds from Wifi and keep the DDNS stuff?

    What do I do to maximize speeds from Wifi and keep the DDNS stuff?
    For maximum Wi-Fi speeds only, use all 802.11ac devices ... both wireless routers & wireless clients. For full DDNS support, only use routers that support this feature.
    For maximum overall bandwidth Internet-to-network client, use routers that support 1Gbps WAN-to-LAN & LAN-to-WAN interfaces. There are not many on the market currently that supports this. Also these routers should provide Gigabit Ethernet on both the WAN & LAN sides.
    To get an idea of what's available, please check out the SmallNetBuilder's to compare routers.

  • Cannot connect N79 with new and old Nokia suites r...

    I have an N79 which I can successfully connect with Nokia Suite 3.3.x running on Windows XP and sync my data.
    However, I have failed to connect the same phone (and also a N86) with the Nokia suite running on Windows 7. The connection with Windows seems fine (and I can browse the contents of the phone from Explorer). However Nokia Suite 3.3.x does not detect the device, although looking at the Add Phone window it is clearly trying to do something when I physically connect the phone - sometimes a message "Wait while we configure the phone etc."
    I have tried removing all Nokia software, removing registry entries, reloading. But to no effect. I have tried repairing the various Mokia software elements through Control Panel.
    I tried an older version of the suite (OVI 3.0.0.286). Again without success, except that it does see the phone because it lists it on the Add Phone screen. However, when I select it I get a pop-up advising me that the phone is not in PC Suite mode - but it is!!!  This does not happen every time but only after I delete the phone's entry from Devices. If I do not do that, the suite does not list the phone. The same happens on Vista.
    The USB cable is from Nokia (CA 101). So same phone, same cable, same Nokia suite - works on XP but not on Win 7 or Vista.
    Any ideas would be most welcome.

    Hi, tinwhistle. Thanks for sharing with us your concern. Do you have the latest version of the Nokia Suite? Can you also make sure that you have an admin access on your Windows 7 computer, and your firewalls & antivirus programs are disabled. It would also help if your Windows 7 drivers are up-to-date. Keep us posted.

  • I recently upgraded my old powerbook to an iMac.  I've dumped the files of my backup drive into the new iMac. Is there a way to have access to all the files (new and old computers) when logged on as the same user vs. logging in and out to access each?

    I am new to posting to this support community but have often referred to it for answers.  So thank you all who've contributed; you've been a great help!
    I recently upgraded my old powerbook to an iMac.  I've dumped the files of my backup drive into the new iMac. Is there a way to have access to/merge all the files (new and old computers) together so when I'm logged in can access all the files.
    Thanks!
    M

    Sure-glad to help you. You will not lose any data by changing synching to MacBook Pro from imac. You have set up Time Machine, right? that's how you'd do your backup, so I was told, and how I do my backup on my mac.  You should be able to set a password for it. Save it.  Your stuff should be saved there. So if you want to make your MacBook Pro your primary computer,  I suppose,  back up your stuff with Time machine, turn off Time machine on the iMac, turn it on on the new MacBook Pro, select the hard drive in your Time Capsule, enter your password, and do a backup from there. It might work, and it might take a while, but it should go. As for clogging the hard drive, I can't say. Depends how much stuff you have, and the hard drive's capacity.  As for moving syncing from your iMac to your macbook pro, should be the same. Your phone uses iTunes to sync and so that data should be in the cloud. You can move your iTunes Library to your new Macbook pro
    you should be able to sync your phone on your new MacBook Pro. Don't know if you can move the older backups yet-maybe try someone else, anyways,
    This handy article from Apple explains how
    How to move your iTunes library to a new computer - Apple Support''
    don't forget to de-authorize your iMac if you don't want to play purchased stuff there
    and re-authorize your new macBook Pro
    time machine is an application, and should be found in the Applications folder. it is built in to OS X, so there is nothing else to buy. double click on it, get it going, choose the Hard drive in your Time capsule/Airport as your backup Time Machine  and go for it.  You should see a circle with an arrow on the top right hand of your screen (the Desktop), next to the bluetooth icon, and just after the wifi and eject key (looks sorta like a clock face). This will do automatic backups  of your stuff.

  • Help with writing and retrieving data from a table field with type "LCHR"

    Hi Experts,
    I need help with writing and reading data from a database table field which has a type of "LCHR". I have given an example of the original code but don't know what to change it to in order to fix it and still read in the original data that's stored in the LCHR field.
    Basically we have two Function modules, one that saves list data to a database table and one that reads in this data. Both Function modules have an identicle table which has an array of fields from type INT4, CHAR, and type P. The INT4 field is the first one.
    Incidentally this worked in the 4.7 non-unicode system but is now dumping in the new ECC6 Unicode system.
    Thanks in advance,
    C
    SAVING THE LIST DATA TO DB
    DATA: L_WA(800).
    LOOP AT T_TAB into L_WA.
    ZDBTAB-DATALEN = STRLEN( L_WA ).
    MOVE: L_WA to ZDBTAB-RAWDATA.
    ZDBTAB-LINENUM = SY-TABIX.
    INSERT ZDBTAB.
    READING THE DATA FROM DB
    DATA: BEGIN OF T_DATA,
                 SEQNR type ZDBTAB-LINENUM,
                 DATA type ZDBTAB-RAWDATA,
               END OF T_TAB.
    Select the data.
    SELECT linenum rawdata from ZDBTAB into table T_DATA
         WHERE repid = w_repname
         AND rundate = w_rundate
         ORDER BY linenum.
    Populate calling Internal Table.
    LOOP AT T-DATA.
    APPEND T_DATA to T_TAB.
    ENDLOOP.

    Hi Anuj,
    The unicode flag is active.
    When I run our report and then to try and save the list data a dump is happening at the following point
    LOOP AT T_TAB into L_WA.
    As I say, T_TAB consists of different fields and field types whereas L_WA is CHAR 800. The dump mentions UC_OBJECTS_NOT_CONVERTIBLE
    When I try to load a saved list the dump is happening at the following point
    APPEND T_DATA-RAWDATA to T_TAB.
    T_DATA-RAWDATA is type LCHR and T_TAB consists of different fields and field types.
    In both examples the dumps mention UC_OBJECTS_NOT_CONVERTIBLE
    Regards
    C

  • Dynamic build of a table trigger - Issue building :new and :old vars

    (which leads me to my next issue - this one might be a deal killer for me; see "Are Optional Parameters possible in Procedural Units?"
    I'm using a Select statement to dynamically create a table trigger which looks like the following:
    create or replace trigger tr_audit#reporter
    after update on reporter
    for each row
    begin
    ttms_audit_pkg.insert_audit_info( 'reporter', 'ZIP', :new.ZIP, :old.ZIP, 'REPORTER.REPORTER,REPORTER.PROJECT_CD', 'EXFC', :new.reporter, :new.project_cd);
    end;
    The :new. and :old. variables are generated based on which table_name is passed to the script creating this trigger. My problem is that I need all the :new. and :old. parameters to be passed in as Char. regardless of whether they are Number or Date variables.
    So in the example above...if :new.reporter is a number on the table then I need to to_char is like this:
    create or replace trigger tr_audit#reporter
    after update on reporter
    for each row
    begin
    ttms_audit_pkg.insert_audit_info( 'reporter', 'ZIP', :new.ZIP, :old.ZIP,
    'REPORTER.REPORTER,REPORTER.PROJECT_CD', 'EXFC', to_char(:new.reporter), :new.project_cd);
    end;
    However, since this trigger is created dynamically I will not know in advance which :new. and :old. parameters will need to be converted to character. So if to_char(:new.reporter) is used and :new.reporter is already a character on the table then I will get an error.
    So my question then is this. Is there a way to write this dynamic sql in a way to accomidate this problem? I'm thinking something that would act a bit like a decode does with values...pehaps something like this:
    decode(:new.reporter, NUMBER, to_char(:new.reporter), DATE, to_char(:new.reporter,'DD-MON-YYYY HH12:MIPM'), :new.reporter)
    ...if :new.reporter is a number then to_char it; if :new.reporter is a date then to_char it; otherwise let it be.
    By any chance does anyone know if this is possible? I would greatly appreciate any insights.

    Sure, you can selectively version-enable tables using Workspace Manager (you call DBMS_WM.EnableVersioning on each table you want Workspace Manager to track history for).
    What do you mean by "programmatically rollback changes"? Workspace Manager has the ability to call GotoTime and queries against a version-enabled table will return results as if you were querying it at that specific point in time (unless you've purged history of course). You can also use it to create what are essentially long-running transactions where you can work on multiple sets of proposed data changes simultaneously for days or months before finally deciding to commit a one particular set. It's incredibly powerful.
    Justin

  • HT3209 Purchased DVD in US for Cdn viewing. Digital download will not work in Cda or US? please help with new Digital code that will work

    Purchased DVD in US for Cdn viewing. Digital download will not work in Cda or US? please help with new Digital code that will work

    You will need to contact the movie studio that produced the DVD and ask if they can issue you a new code valid for Canada. Apple cannot help you, and everyone here in these forums is just a fellow user.
    Regards.

  • :new and :old into record into record variable

    Hi,
    Can anyone tell me whether it is possible in 11g to copy the :new and :old records straight into record variables without having to explicitly copy every column?
    I would prefer to write this:
      create or replace trigger app1_tab1_biudr
      before insert or update or delete
      on table_1
      as
      declare
        r_tab1_old table_1%rowtype;
        r_tab1_new table_1%rowtype;
      begin
         r_tab1_new := :new;
         r_tab1_old := :old;
      end app1_tab1_biudr;instead of this
      create or replace trigger app1_tab1_biudr
      before insert or update or delete
      on table_1
      as
      declare
        r_tab1_old table_1%rowtype;
        r_tab1_new table_1%rowtype;
      begin
         r_tab1_new.col1 := :new.col1;
         r_tab1_new.col2 := :new.col2;
         r_tab1_new.col3 := :new.col3;
         -- ... etc.
         r_tab1_old.col1 := :old.col1;
         r_tab1_old.col2 := :old.col2;
         r_tab1_old.col3 := :old.col3;
         -- ... etc.
      end app1_tab1_biudr;Why? This is nonsense example, of course, but when we apply this to our table API's, it would make a big difference in the length and maintainability of the code.
    Thanks!
    Remco

    RemcoGoris wrote:
    Hi,
    Can anyone tell me whether it is possible in 11g to copy the :new and :old records straight into record variables without having to explicitly copy every column?I'm not sure with 11g if they've introduced it, but to the best of my knowledge, this has never been something that has been possible as the :new and :old are intrinsicly tied into the internals of the triggers (i.e. I think they, internally, hold more information about the changed rows than just being a simple rowtype structure)

  • Using correlation names :new and :old in ODBC

    Does anyone know how to use correlation names :new and :old through an ODBC connection?
    EG:
    CREATE TRIGGER Print_Cust_changes
    BEFORE INSERT ON CUST_tab
    FOR EACH ROW
    BEGIN
    dbms_output.put('Adding: ' || :new.custid);
    END;
    When I try to do that using ODBC, I get this error:
    Server Msg: 24344, State: HY000, [Oracle][ODBC][Ora]
    Trigger, procedure or function created with PL/SQL compilation error(s).
    And if I try and Insert I get:
    Server Msg: 4098, State: HY000, [Oracle][ODBC][Ora]
    ORA-04098: trigger 'BCL.PRINT_CUST_CHANGES' is invalid and failed re-validation
    The same code works perfectly in SQL*Plus.

    The plot thickens...
    I just tried this code:
    CREATE OR REPLACE TRIGGER Print_Cust_changes
    BEFORE INSERT ON CUST_tab
    FOR EACH ROW
    BEGIN
    INSERT INTO CUST_LOG VALUES('X');
    END;
    And received the same error:
    Server Msg: 24344, State: HY000, [Oracle][ODBC][Ora]
    Trigger, procedure or function created with PL/SQL compilation error(s).
    Again, using the same code (Cut & Paste) in SQL*Plus, it works without any problems.
    The ODBC function being used is: SQLExecuteDirect(), ODBC driver is SQLORA32.dll v9.02.00.00
    CREATE TABLE, VIEW, INDEX etc, all work fine, but not a trigger. If I read the code back from ALL_TRIGGERS after using SQL*Plus or the console application to create the trigger, it is exactly the same code...

  • View all of my topics' reply status, new and old?

    Is there a way to see all the topics I posted to? Currently there is a "Your Content" widget in the homepage that will show recent activity by me, or activity in recent posts of mine, but I don't see a way to view all topics (new and old), and whether or not they have been updated with new content. Is this possible?

    You can edit the Widget:
    And possibly set the number much higher than 5?

  • Diff in new and old gl accounts

    diff in new and old gl accounts

    Dear Pranav,
    ECC 6.0 New GL Functionality
    1.Activate the New General Ledger Accounting by a single click on the clock icon
    2.You will reach to change view "activation of New GL A/cg" detail screen and tick the checkbox and save.
    3. After activation of New General Ledger Accounting, you exit the IMG screen When you re-enter , you find that a new node is added Financial Accounting (New)
    4.After activation of New General Ledger Accounting , a new sub node appears in the IMG structure.
    This sub node is Define Segment
    The menu path is:
    SAP Customizing IMG ---> Enterprise Structure -
    > Definition --> Financial Accounting --> Define Segment
    In this IMG activity, you define your segments.
    If you then define your profit centers, you can enter an associated segment in the master record of a profit center. The segment is then derived from the assigned profit center during posting.
    5.Activation has created a new field in Profit Center Master Record : the SEGMENT
    6.Leading and Non- Leading Ledgers
    In General Ledger Accounting , you can use several Ledgers in parallel. This allows you to produce financial statements according to different accounting principles. A ledger uses several dimensions from the totals table it is based upon. When defining Ledgers , one must be defined as the Leading Ledger . The Leading Ledger is based on the same accounting principles as that of the consolidated financial statements. It is integrated with all subsidiary ledgers and is updated in all company codes. This means that it is automatically assigned to all company codes. In each company code, the Leading Ledger receives exactly the same settings that apply to that company code : the currencies, the fiscal year variant and posting period variant .
    You must designate one of your ledgers as the Leading Ledger. It is not possible to designate more than one ledger as the leading ledger.
    The menu path is :
    SAP Customizing IMG -
    > Financial Accounting ( New ) -
    > Financial Accounting Basic Settings (New) -
    > Ledgers -
    > Ledger -
    > Define Ledgers for General Ledger Accounting
    Clicking on the checkbox identifies one of your ledgers as the Leading Ledger.
    7. Activation of Non Leading Ledgers
    Non Leading Ledgers are parallel ledgers to the Leading Ledger . They can be based on local accounting principle, for example. You have to activate a non- Leading Ledger for individual company codes. Non- Leading Ledgers can have different fiscal year variants and posting period variants per company code to the Leading Ledger of this company code.
    The menu path is :
    SAP Customizing IMG -
    > Financial Accounting ( New ) -
    > Financial Accounting Basic Settings (New) -
    > Ledgers -
    > Ledger -
    > Define and Activate Non --Leading Ledgers
    8.Assign scenarios to ledgers
    A Scenario combines Customizing settings from different business views. Each business view specifies which posting data is transferred from different application components in General Ledger Accounting, such as cost Center update or ProfitCenter update .You assign the desired scenarios to your ledgers. For each ledger, you define which fields are filled with posting data from other application components.
    SAP delivers a number of scenarios in the standard system. It is not possible to create additional scenarios.
    The menu path is:
    SAP Customizing IMG -
    > Financial Accounting ( New ) -
    > Financial Accounting Basic Settings (New) -
    > Ledgers -
    >Fields -
    > Display Scenarios for General Ledger Accounting.
    9. Cost of sales accounting
    Cost of sales accounting is a way to create a profit and loss statement (P&L) for a company by comparing the revenues to the costs or expenses incurred to obtain these revenues.
    The expenses are mainly divided by functional area such as:
    Manufacturing
    Administration
    Sales
    Research and Development
    We can activate Cost of Sales Accounting by the following menu path :
    SAP Customizing IMG -
    > Financial Accounting ( New ) -
    > Financial Accounting Basic Settings (New) -
    > Ledgers ->Ledger---> Activate Cost of Sales Accounting
    Regards,
    Naveen.

  • Can I save messages from both my new and old iphone

    I was unable to set up my new iphone 6 right away due to computer issues where my itunes and phone backup are stored. Now I have messages on both my new and old iphones that I don't want to lose, but I need to restore my new phone with the backup of the old. Is there any way to add the messages from the new iphone to the backup of the old?

    Not really - but at least you are thinking about it in advance which is good
    The restore from backup as you know is a snapshot in time of your phone
    So if you restore from the old - you lose the new messages after that point
    You may be able to use software like TouchCopy to get the messages off your phone - either old or new

  • HT3406 If I choose "restore from iTunes backup" to move everything from old phone.  Will I still be able to use the old phone for music and apps?  Can the old phone be docked up to the computer?  Or will the new and old phone overwrite each other in some

    If I choose "restore from iTunes backup" to move everything from old iphone to a new one, will I still be able to use the old phone for music and apps?  Can the old phone be docked up to that same computer every now and then?  Or will the new and old phone overwrite each other in some way?  In other words, are the two phones treated as different devices when the "restore" option is used to set up the new phone?   Thanks in advance.

    Yes, you can use the old iPhone as an iPod touch.
    Read this:
    http://support.apple.com/kb/HT3406

Maybe you are looking for

  • Copy output to clipboard?

    I was wondering if it were possible to place the output variable onto the Windows clipboard. It seems like it would be possible. I know the user can just highlight and Ctrl+C, but we're using a touch screen and selecting text isn't as easy as it shou

  • App Hangs in 3 consecutive days

    Hi all, 11.2.0.1 Aix 6.1 Our database & app hangs for the first time, 3 consecutive days (Aug 11,12,13)  during run of batch jobs at 12AM. The batch operator said the batch job is deleting a table with only less than 1000 rows but was not able to loc

  • Safari (4.1.3) for some reason won't launch. Help?

    It just spins the wheel everytime. It's not my wi fi -- cause Firefox works, but I'd like to use Safari which has never been a problem before. Any help wd be much appreciated. It's for my PowerBook G4 OS X (10.4.1) Thank you! Michael

  • Unix command needed to search alert log

    Hi. Im trying to search the alert log file to see if there is any thing related to the checkpointing process. Specifically Im looking for anything that includes "Checkpoint not complete". If anyone knows the command for searching the file in UNIX for

  • How to restore an overwritten wav file?

    I was recently working on a project and i accidently unplugged my hard drive from my pc, when i came back to work on my project again my recorded audio was playing in skips, i then soon realized my hard drive was unplugged, but when i went to plug it