Requery after insert

Hi,
I'm working on a master-detail form. When a record in the master-block is inserted, automatically two records are inserted into the detail-block, but their not visible until I hit F8. I tried to perform an execute_query in a POST_INSERT trigger (and a few other triggers as well), but he always fails and gives this error: FRM-40737 Illegal restricted procedure NAME_IN in trigger. Does anyone know a resolution to this annoying problem???

Hi,
Post-triggers are do not allow restricted built-in's, so create a form-level trigger KEY-COMMIT like this
KEY-COMMIT(Form Level)
Begin
Commit_Form;
Go_Block('your_detail_block');
Execute_Query;
End;
This will query your detail recrods.
Regards.
null

Similar Messages

  • How-To "Refresh a table of data after inserting or deleting"

    I'd like to say a word on the how-to article "How to refresh a table of data after inserting or deleting a row using ADF".
    (http://www.oracle.com/technology/products/jdev/howtos/1013/updtable/index.html?_template=/ocom/technology/content/print)
    I spent a lot of time on it because I needed help in implementing simple CRUD functionality on a table, using JSF-ADF-TopLink technologies.
    While the the article does provide correct steps, it is in one important place not specific enough, so the reader may easily get stuck. In section "Refresh the data table", point 1: when you double click on the removeEntity() button, in Structure window, then you do not get the required dialog. You get CommandButton Properties dialog.
    You must click on the removeEntity() button in Editor's Design view. But even there you may get the CommandButton Properties dialog, not managed beans dialog.
    You may resolve that by going to JSF configuration file, faces-config.xml, and switch to Overview view. This will show you the managed beans that you have.
    Then, you may already have a backing bean for the page. You can use that and avoid creating a new managed bean.
    I could understand what the operations mean only after very careful reading of "Creating More Complex Pages", section "Overriding Declarative Methods" in JDeveloper Help (or in ADF Developer's Guide PDF document).
    In general: I believe that "ADF bindings" need more conceptual explanation, maybe in form of an article. Grammatical form "bindings" may create a false understanding that "bindings" are just references. But they are not -- ADF bindings are active objects that handle traffic between UI components and Data Controls. It seems that "bindings" even communicate among themselves. Maybe it would be more understandable to differentiate strictly between "binding objects" (or "binders"?), binding object definitions and binding object references.
    It would be very helpful to have a diagram showing grahically what specific binder objects are created in a small apllication (2-3 pages using 1-2 tables), with whom they communicate and what type of data is passed on.
    Priit

    Hi
    Thanks for your infos.
    Yes exactly I use almost the same code you have post here.
    Could You answer to my next questions?
    First - >what do you mean by saying that "it's not good idea using refreshing in IE?" Of course I use refreshing in backing_bean for my button "remove" that removes row, commit changes to database and refresh table, almost the same as You said in your post:
    Code in backing_bean is and comments on difference to Your code is below:
    public commandButton2_action1(){
    BindingContainer bindings = getBindings();
    OperationBinding operationBinding =
    bindings.getOperationBinding("removeEntity");
    Object result = operationBinding.execute();
    if (!operationBinding.getErrors().isEmpty()) {
    return null;
    //above remove entity, but I dont now if it do commit to database? So i do it below
    OperationBinding commit1 = bindings.getOperationBinding("Commit");
    commit1.execute();
    //and at the end I refresh my table, "findAllRezerwacja1 - it is an id of the methodAction, not the iterator -> is it ok? or should I change to Iterator id?
    OperationBinding requery = bindings.getOperationBinding("findAllRezerwacja1");
    requery.execute();
    return null;
    Page Definition code for this:
    <methodAction id="findAllRezerwacja1"
    InstanceName="SessionEJBLocal.dataProvider"
    DataControl="SessionEJBLocal" MethodName="findAllRezerwacja"
    RequiresUpdateModel="true" Action="999"
    ReturnName="SessionEJBLocal.methodResults.SessionEJBLocal_dataProvider_findAllRezerwacja_result"/>
    <table id="findAllRezerwacja2" IterBinding="findAllRezerwacja1Iter">
    <AttrNames>
    <Item Value="dataDo"/>
    <Item Value="dataOd"/>
    <Item Value="idRezerwacja"/>
    <Item Value="liczbaUczestnikow"/>
    <Item Value="prowadzacy"/>
    <Item Value="uwagi"/>
    </AttrNames>
    </table>
    <methodAction id="removeEntity" InstanceName="SessionEJBLocal.dataProvider"
    DataControl="SessionEJBLocal" MethodName="removeEntity"
    RequiresUpdateModel="true" Action="999">
    <NamedData NDName="entity"
    NDValue="${bindings.findAllRezerwacja2.currentRow.dataProvider}"
    NDType="java.lang.Object"/>
    </methodAction>
    <action id="Commit" IterBinding="findAllRezerwacja1Iter"
    InstanceName="SessionEJBLocal.dataProvider"
    DataControl="SessionEJBLocal" RequiresUpdateModel="true"
    Action="2"/>
    </bindings>
    //and rest of code for Iterator etc
    My second question is, why when you use refresh button in IE (I know is not recommended as You said, but sometimes user do it, so I want prevent situations that I will describe here) so when I press refresh button in IE exactly after removing one row by clicking my button, refreshing by pressing IE button is doing the same --> is deleting next row. How to stop deleting row, when for example user would press IE refresh button after pressing remove button for table. If I change selection in table after deleting row, and press refresh button in IE, instead of deleting row, I got error message: JBO-29000: JBO-35007: and
    JBO-35007. So where Im doing wrong. Maybe I should do sth with postback ? Could You help me? Thanks in advance
    Last one question: what is the difference between using delete and removeEntity from operations node? Im now reading carefully ADF Dev Guide, so I hope I can find infos there? But if You know, please answer to this question.
    Thanks

  • JClient: after INSERT and COMMIT does not show the primary textfield value

    1. In my JClient master-detail form: When I insert a new record, enter data, and commit the changes... the master-panel's primarykey textfield is BLANK, when it should show the new auto-incremented number from the MySQL database. I have to close and open the form again to refresh that field again.
    2. In order to properly save new records in the detail-panel, I have to insert and save the above master-panel first. Is this the way JCLient handle master-detail forms?
    Thanks.

    Hi. Thanks for sharing your advice.
    Re my problem,
    if we have to refresh data by requery,i suggest you should use the way below:
    private JUNavigationBar navBar = new JUNavigationBar(true,false,true,false,true);
    navBar.setModel(JUNavigationBar.createPanelBinding(panelBinding, navBar));
    // after insert ,call this method
    navBar.doAction(navBar.BUTTON_EXECUTE);Tried this out but my textfield still won't get refreshed. Here is the code I came up with:
        private JUNavigationBar navBar = new JUNavigationBar() {
                public void doAction(int button) {
                    if (button == JUNavigationBar.BUTTON_INSERT) {
                        super.doAction(button);
                        navBar.doAction(navBar.BUTTON_EXECUTE);
                        return;
                    super.doAction(button);
            };Re your problem,
    I am developing application with JDev + MySQL,encounted another problem,
    how can i get the primary key supported by auto_increment column after insert?
    i constructed a vo whose sql statement is
    select last_insert_id() as last_id to get the value of auto_increment column.
    i found it can't get the right value unless commit the transaction.
    Would u please tell me your way?Based on what I experienced, we dont have to do the SELECT statement above. MySQL does auto-increment the primarykey but the JClient form just cant show it immediately, unless we close and re-open the form.
    What did I do to refresh the primarykey during insert? Please note that I got this solution accidentally coz I'm still a newbie in Java.
    A user want to add a record:
    1. He presses the Insert button.
    2. He enters data into a component (ex. textfield)
    3. The component's action-performed event is fired, and the following code is run:
            DCJboDataControl dc = (DCJboDataControl)panelBinding.getDataControl();
            ApplicationModule am = dc.getApplicationModule();
            Transaction tr = am.getTransaction();
            dc.commitTransaction();
            ViewObject vo = am.findViewObject("TblaccountsView1");
            vo.executeQuery();
            vo.last();It simply commits the transaction, goes to last (new) transaction, and lets the user continue his data encoding.
    Hope it helps and I hope theres an even better way to do this.

  • Corrupted uniquemember attribute after inserting new member with Console

    After inserting a new member in a group with many members (~400 uniqueMembers) with iPlanet Console some old members (~300) in the uniqueMember list disappeared.
    The bug is not reproducable but occured about 3-4 times.
    Is there a known bug in iPlanet Console 5.1 ?
    OS/iDS-Version: Solaris 8/iDS 5.1

    Vitaly,
    When you call insertRow on a view object, the new row is inserted after the current row. By default as well, sorting occurs in the DB, so you must re-query in order to see the rows in sorted order (or click on the column headers to do the sort, which would also ask the DB to do the sorting). You could have a look at section 35.6 in the Fusion Developer's Guide for ADF, which shows how to turn on in-memory sorting and cause the sort to happen without requerying.
    Best,
    John

  • Refresh LOV after inserting data in correspondent table

    Hi all,
    I am using Jdeveloper 11.1.1.2 and ADFBC.
    I have a page with a table (tableA) with some fields. One of them has a LOV associated to another table(tableB). I have a button (button1) that shows a popup(popup1) and opens a new task flow with a fragment to insert data in the tableB.
    After inserting/modifying rows in tableB and after pressing commit (property: end-transaction) or rollback buttons (property: end-transaction and restore save point), LOV does not refresh.
    I have tried to set the property partial triggers of the LOV to button1 or popup1 and it does not work.
    How can I solve it?
    Thank you.
    Andrea

    How about VO for table B ? Did you refresh that ? I didn't use the same VO for table & LOV.
    so in "List data Source" -- VO -- I am using "SQL statement" and statement includes fields from Table B and Table A.
    VO for LDS using "Rows populated by a SQL query with read-only access". I didn't use "Updateable Access through Entity Objects".
    Sample of VO of LDS:
    select A.model_number modelNumber, a.part_number partNumber, b.MODEM_TYPE ModemType
    from table A a,Table B b
    where a.PART_NUMBER_ID = b.PART_NUMBER_ID
    and a.part_number_id =:partID
    Edited by: albertpi on Mar 16, 2010 7:26 AM

  • Using Database Change Notification instead of After Insert Trigger

    Hello guys! I have an after insert trigger that calls a procedure, which in turn is doing an update or insert on another table. Due to mutating table errors I declared the trigger and procedure as autonomously transactional. The problem is, that old values of my main tables are inserted into the subtable since the after insert/update trigger is fired before the commit.
    My question is how can I solve that and how could I use the change notification package to call my procedure? I now that this notification is only started after a DML/DDL action has been commited on a table.
    If you could show me how to carry out the following code with a Database Change Notification I'd be delighted. Furthermore I need to know if it suffices to set up this notification only once or for each client seperately?
    Many thanks for your help and expertise!
    Regards,
    Sebastian
    declare
    cnumber number (6);
    begin
    select count(*) into cnumber from (
    select case when (select date_datum
        from
          (select f.date_datum,
            row_number() over (order by f.objectid desc) rn
          from borki.fangzahlen f
          where lng_falle      = :new.lng_falle
          and int_fallennummer = :new.int_fallennummer
          and lng_schaedling   = :new.lng_schaedling
          and date_datum       > '31.03.2010'
        where rn=1) < (select date_datum
        from
          (select f.date_datum,
            row_number() over (order by f.objectid desc) rn
          from borki.fangzahlen f
          where lng_falle      = :new.lng_falle
          and int_fallennummer = :new.int_fallennummer
          and lng_schaedling   = :new.lng_schaedling
          and date_datum       > '31.03.2010'
        where rn=2) then 1 end as action from borki.fangzahlen
            where lng_falle      = :new.lng_falle
            and int_fallennummer = :new.int_fallennummer
            and lng_schaedling   = :new.lng_schaedling
            and date_datum       > '31.03.2010') where action = 1;
    if cnumber != 0 then
    delete from borki.tbl_test where lng_falle = :new.lng_falle
    and int_fallennummer = :new.int_fallennummer
    and lng_schaedling   = :new.lng_schaedling
    and date_datum       > '31.03.2010';
    commit;     
    pr_fangzahlen_tw_sync_sk(:new.lng_falle, :new.int_fallennummer, :new.lng_schaedling);

    It looks like you have an error in line 37 of your code. Once you fix that the problem should be resolved.

  • How can i  print reports to different printer by use Trigger on table after insert

    Hello,
    Please can any one tell me how can i print (any message) to different printer (network & local printer) by use Trigger on table after insert.
    regards,
    Linda.

    What you want to do cannot be done with PL/SQL, which does have any print utilities. However you could write something using Java Stored Procedures.
    Of course the "different printer" bit will have to be data driven as triggers are not interactive.
    rgds, APC

  • Before or After insert trigger on HR_API_TRANSACTION_VALUES

    I am on the termination page of SSHR and after entering the details when clcked on 'Next' the validations built in before / after insert trigger of HR_API_TRANSACTION_VALUES does not retrieve the data and the error 'No data found' is displayed.
    We do not have AME approval. When clicked on 'Next' it goes to the review page. When I do a select on the HR_API_TRANSACTION_VALUES the data do exists but the validation does not work.
    We have Oracle HRMS 11i with database as 11g.
    Please give a resolution at the earliest.

    you can use
    hr_transaction_api.set_varchar2_value
    or
    hr_transaction_api.set_number_value
    based on what type of value that you want to update

  • How to Display a message after inserting row in table............

    Hi
    I want to display a message after inserting rows in table like *'you have inserted a new row successfully*'.
    i am using the createinsert ADF Button to insert the rows in table.after that i am comitting it.
    after commiting i want to display message for the user.for this what i need to do.
    Please help me.
    Sailaja.

    user10860137
    Can you please explain me the each line in the code briefly.
    +public String saveButton_action(){+
    BindingContainer bindings = getBindings();
    OperationBinding operationBinding = bindings.getOperationBinding("Commit");
    Object result = operationBinding.execute();
    +// note "!" operator has been removed from the default code.+
    +if(operationBinding.getErrors().isEmpty()){+
    FacesContext ctx = FacesContext.getCurrentInstance();
    FacesMessage saveMsg = new FacesMessage("Record Saved Successfully");
    ctx.addMessage(null,saveMsg);
    +}+
    return null;
    +}+
    And i have requirement to show the message on favcet "status bar".not in a popup window.(from the above code the message is showing in popup window. )the Layout i am using is PanelCollection.
    can you tell me what i need to do.
    Thanks
    Sailaja.
    Edited by: sj0609 on Mar 19, 2009 8:03 AM

  • Error in after insert trigger

    Hello all,
    I have a question about after insert trigger. Will be new row inserted and commited if after insert trigger returns error? Thank you.
    regards,
    Miha

    What is the error that u r facing?
    there could multiple reasons for that. Basically, u can't put commit in the trigger (unless it is an autonomous transaction). Share the pseudo-code of u r triiger, so that , problem can be identified.
    Cheers,
    Ram Kanala

  • Error while firing a trigger After Insert

    Dear All
    I have created a Table named Punches in user Punch
    and I have written a trigger after Insert on table Punches
    In that Trigger i am wrting some select Command
    and Insert command
    tables are located in Other User
    while firing the trigger it is showing Error.
    pl help

    Arbar Mehaboob - user553581 wrote:
    Dear All
    I have created a Table named Punches in user Punch
    and I have written a trigger after Insert on table Punches
    In that Trigger i am wrting some select Command
    and Insert command
    tables are located in Other User
    while firing the trigger it is showing Error.
    pl helpplease provide:
    1) your database version
    2) the table DDL's
    3) some sample data
    4) the trigger code
    5) the error message you're getting.
    without these, it is impossible to suggest an answer.

  • AFTER INSERT TIGGER, ora-01403: no data found error

    Hi all,
    I'm trying to create a fairly simple trigger which fires after an insert on a table.
    The trigger is based on a function, defined within a package. The function is as follows...
    FUNCTION check_contract_length (V_playerId IN NUMBER)
    RETURN BOOLEAN
    IS
    months NUMBER;
    months2 NUMBER;
    BEGIN
    SELECT months_between(contract_end, contract_start), contract_length
    INTO months, months2
    FROM player
    WHERE playerId = v_playerId;
    IF months <> months2 THEN
    RETURN (true);
    END IF;
    RETURN (false);
    END check_contract_length;The trigger operates when an insert is made on to the player table, it as defined as follows...
    CREATE OR REPLACE TRIGGER play_ins_con
    AFTER INSERT ON player
    FOR EACH ROW
    DECLARE
    isover BOOLEAN;
    BEGIN
    IF INSERTING THEN
    isover := player_constr_pkg.check_contract_length(:new.playerId);
    IF isover THEN
    RAISE_APPLICATION_ERROR(-30001, 'Contract length incorrect');
    END IF;
    END IF;
    END play_ins_con;My problem is, is that every time I try to insert a row into the player table, the trigger fires and produces a "ora-01403: no data found" error. I was under the impression that as the trigger fires after an insert, this shouldn't be a problem.
    I'm also aware that this constraint can probably be implemented using a CHECK constraint, however it would be a learning curve for me to work it out this way.
    Any help would be much appreciated!!
    Cheers guys.

    I'm also aware that this constraint can probably be implemented using a CHECK constraint,
    however it would be a learning curve for me to work it out this way.Starting out by doing stuff the wrong way only increases the learning curve when it comes to doing things the right way. A check constraint is definitely the best way of doing it. However, if you must do it with a trigger this is the way to go:
    CREATE OR REPLACE TRIGGER play_ins_con BEFORE INSERT ON player
    FOR EACH ROW
    BEGIN
        IF months_between(:NEW.contract_end, :NEW.contract_start) <> :NEW.contract_length
        THEN
            RAISE_APPLICATION_ERROR(-30001, 'Contract length incorrect');
        END IF;
    END play_ins_con;
    /Incidentally, as CONTRACT_LENGTH is wholly derivable from the other columns your table structure is obviously insufficiently normalised.
    Also, note that only errors between -20999 and -20000 are reserved for our use. Any other number may be used by Oracle for its own purposes.
    Cheers, APC

  • "Refresh after" insert fails for DB-View with INSTEAD OF Triggers

    Hi,
    I have a database view with INSTEAD OF triggers defined for INSERT, UPDATE, DELETE.
    For some EO attributes the refresh after insert and update is defined.
    Posting to database fails.
    According to Database 9.2 Manual and a previous thread (BC4J and Updatable Views the RETURNING clause is not allowed for database views with INSTEAD OF triggers.
    Is there a workaround so the refresh after is done, but without the RETURNING feature?
    I only need to refresh some values. The PK i can set in the create method of the EO so refresh via a additional SELECT would be possible.
    If not Feature Request:
    Add the possibility to do the "refresh after ..." with a 2nd SELECT using the PK instead of using the RETURNING clause.
    Of course then it is not possible to set the PK in the database trigger. PK has to be set in the create method of the EO.
    Thanks,
    Markus
    GEMS IT

    Hi Markus,
    Turning on the stack trace (-Djbo.debugout put=Console - in the Project/runner) did help and I should have done it sooner. Turns out that when I constructed my EO based upon a database view - I should have left out the PKs of the base tables.
    In my case, I am using an "Instead Of Trigger" to populate a multi-table arrangement (parent - child - grandChild - greatGrandChild relationship) where all base tables are using dbSequence/dbTriggers.
    Final analysis - I would like to see BC4J handle this situation. I do not want to use View-Links and I should * not * have to resort to stored procedures and BC4J/doDML. If I construct a DB View this is participating in an parent - child - grandChild - greatGrandChild relationship that are using dbSequence/dbTriggers, then BC4J should be smart enough to construct VO knowing that I want to do insert, update, delete, selects - based upon this structure.
    Thanks Markus,
    Bill G...

  • After Insert Trigger Not Working

    Hi All,
    I am not a guru in writing triggers.
    I am inserting new records in a Table FA_BOOKS by application and this inserts records in FA_ADDITIONS_B. This is a vanilla process.
    i have written a trigger on FA_ADDITIONS_B, and i want to update the cost from the fa_books to fa_additions_b column attribute21
    The trigger i have written is After insert on FA_ADDITIONS_B and i try to select cost from the fa_books for the :new.asset_id.
    SELECT COST
    INTO v_cost
    FROM FA_BOOKS
    WHERE ASSET_ID = :NEW.ASSET_ID;
    this is always returning no_data_found exception and i do not understand how to update the attribute21 in FA_ADDITIONS_B
    Here is a sample of my trigger.
    CREATE OR REPLACE TRIGGER update_attribute21_new_asset_1
    after INSERT ON fa_ADDITIONS_B
    FOR EACH ROW
    DECLARE
    V_COST NUMBER;
    BEGIN
    SELECT COST
    INTO v_cost
    FROM FA_BOOKS
    WHERE ASSET_ID = :NEW.ASSET_ID;
    update fa_ADDITIONS_B
    set attribute21 = v_cost
    where ASSET_ID = :NEW.ASSET_ID;
    END;
    Any help on this will be appreciated.
    TX in advance.
    Regards,

    I still haven't understood the reason why you can't transfer the COST information from FA_BOOKS to FA_ADDITIONS_B in the initial trigger on FA_BOOKS that populates FA_ADDITIONS_B. Or how is the population of FA_ADDITIONS_B accomplished? Is it part of the application code?
    Regarding the NO_DATA_FOUND issue:
    Is it ensured that populating the FA_ADDITIONS_B table is done in the same transaction as the FA_BOOKS inserts or that the FA_BOOKS transaction is committed?
    Why do you need that additional trigger?
    My assumption is that you're in a trigger "chain" - if I get your approach correctly - you're basically attempting to query FA_BOOKS in a trigger on FA_ADDITIONS_B that in turn has been triggered by a trigger on FA_BOOKS which gets us back to the "mutating" trigger issue. You can't read a table that is currently in the process of being modified.
    Or even worse: The (potential) trigger on FA_BOOKS that populates FA_ADDITIONS_B uses "autonomous transaction" and therefore the trigger on FA_ADDITIONS_B can't see the changes of the original transaction.
    As already mentioned: Be very careful with "autonomous transactions" in general. There are only a few cases where these are actually useful (e.g. logging purposes), but Tom Kyte has written numerous articles why triggers and in particular autonomous transactions are mostly evil.
    Regards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/

  • Print insert result to a printer in TSQL trigger after insert - Need help.

    Hi,
    I am trying to print a record to a printer whenever a new record is inserted into a table called PrintTickets, using TSQL trigger for insert. 
    Is it possible to print a new inserted record to a printer?
    Here is the trigger tsql statement: 
    ALTER TRIGGER [dbo].[PrintDeal]
    ON [dbo].[PrintTickets]
    AFTER INSERT
    AS
    declare @Id numeric(18,0)
    ,@DealId char(15)
    ,@ValueDatePeriod1Currency1 datetime
    ,@Bank1Name char(56)
    ,@Currency1 char(3)
    ,@Currency2 char(3)
    ,@PaymentInstructionP1C1 char(80)
    ,@DealerId char(6)
    ,@DealVolumeCurrency1 float
    ,@CalVolumeP1C2 float
    ,@ExchangeRatePeriod1 float
    declare @tmp table
    Id numeric(18,0)
    ,DealId char(15)
    ,ValueDatePeriod1Currency1 datetime
    ,Bank1Name char(56)
    ,Currency1 char(3)
    ,Currency2 char(3)
    ,PaymentInstructionP1C1 char(80)
    ,DealerId char(6)
    ,DealVolumeCurrency1 float
    ,CalVolumeP1C2 float
    ,ExchangeRatePeriod1 float
    PRIMARY KEY (Id)
    BEGIN
    -- SET NOCOUNT ON added to prevent extra result sets from
    -- interfering with SELECT statements.
    SET NOCOUNT ON;
    -- Insert statements for trigger here
    insert @tmp
    select
    Id
    , DealId
    , ValueDatePeriod1Currency1
    , Bank1Name
    , Currency1
    , Currency2
    , PaymentInstructionP1C1
    , DealerId
    , DealVolumeCurrency1
    , CalVolumeP1C2
    , ExchangeRatePeriod1
    FROM dbo.PrintTickets
    WHERE ID=@@IDENTITY
    select @Id=Id
    ,@DealId=DealId
    ,@ValueDatePeriod1Currency1=ValueDatePeriod1Currency1
    ,@Bank1Name=Bank1Name
    ,@Currency1=Currency1
    ,@Currency2=Currency2
    ,@PaymentInstructionP1C1=PaymentInstructionP1C1
    ,@DealerId=DealerId
    ,@DealVolumeCurrency1=DealVolumeCurrency1
    ,@CalVolumeP1C2=CalVolumeP1C2
    ,@ExchangeRatePeriod1=ExchangeRatePeriod1
    from @tmp
    -- Code to print to a physical printer if possible
    END
    The table is called PrintTickets and it contains the following columns: 
    Id numeric(18,0)
    ,DealId char(15)
    ,ValueDatePeriod1Currency1 datetime
    ,Bank1Name char(56)
    ,Currency1 char(3)
    ,Currency2 char(3)
    ,PaymentInstructionP1C1 char(80)
    ,DealerId char(6)
    ,DealVolumeCurrency1 float
    ,CalVolumeP1C2 float
    ,ExchangeRatePeriod1 float
    PRIMARY KEY (Id)
    The dummy records that I am inserting for testing the results in csv format:
    Id,DealId,ValueDatePeriod1Currency1,Bank1Name,Currency1,Currency2,PaymentInstructionP1C1,DealerId,DealVolumeCurrency1,CalVolumeP1C2,ExchangeRatePeriod1
    696,XXX#33111 ,2014-03-04 00:00:00.000,HSBC ,USD,EUR,XXXXXXXXXXXXXXXXXXXXXXX ,MAT ,342342,87987,0.3123
    697,XXX#33113 ,2014-03-04 00:00:00.000,USB ,EUR,USD,9999999999999999999999,ZXY,2334243,32213,0.3245
    698,XXX#33114 ,2014-03-03 00:00:00.000,SWISS BANK ,CHF,USD,99999999999999900000,XYZ ,32423424,342,0.83432
    699,XXX#33115 ,2014-03-03 00:00:00.000,UK BANK ,USD,PND,XXXXXXXXXXXXXXXXXXXXXXX ,ABC,9809808,0,0.0349
    700,XXX#33116 ,2014-03-04 00:00:00.000,USCF BANK ,XXX,XXX,XXXXXXXXXXXXXXXXXXXXXXX ,ABC,89798797,756756,0.734
    I appreciate any help.
    Thanks in advance.

    Is it possible to print a new inserted record to a printer?
    From SQL Server?
    The task of SQL Server is to manage large of data effciently. It is not a general programming environment. It could possibly be done with a CLR procedure that that talks to the printer, but it is not the correct solution.
    A possible design could be to post a message on a Service Broker queue, and then the printing server would poll the queue and print the ticket.
    By the way, there are more flaws in your trigger. To find the inserted rows, you need to query the virtual table "inserted" which holds a copy of these rows. Furthermore, since a trigger fires once per statement, the trigger must handle the fact
    that multiple rows are inserted.
    Erland Sommarskog, SQL Server MVP, [email protected]

Maybe you are looking for

  • Customizing List Selection Indication

    Hello Everyone,    I would like to customize the way the List shows a selected item.  The default implementation is to highlight the background.  I would like to change that to a glow filter around the border.  The default implementation for the "Ite

  • 22 - 26 inch tv

    Hello I'm in the market for a 22 - 26 inch LCD HDTV but i'm having trouble deciding on one.  I've seen some good tvs for a decent price but it seems alot of them have issues just a year or so down the road. I will be gaming(PS3) and watching movies o

  • JRun session ID generation mechanism

    For 2 JRun Servers that turn on JDBC session persistence scheme, how the session ID is being assigned? Will it able to cause duplicate session?

  • ARD remote software update download source?

    When we use Apple Remote Desktop to get the client to download software updates, like with this UNIX command softwareupdate -i -r What download source does the remote client use?  does he download via his own gateway direct from Apple,  or does the A

  • Updating ACR to a later version

    I currently have Version 7.1 of ACR installed and am using it with PSE11 on my iMac.  I have tried several times to update it to a later version, but to no avail.  The Help/Update tool tells me I have the current version and I have Photoshop Elements