Eliminating comma at end of output

My current output of dynamic names in my variable (called
dynNames) has a comma at the end.
I need to eliminate the last comma:
Jones, Smith, Baker, Johnson,
to look like this:
Jones, Smith, Baker, Johnson
My attempt to eliminate the last comma doesnt work because it
eliminates all the commas:
<cfset myNames = REReplace(dynNames, ",$" "", "All")>
<cfoutput>#myNames</cfoutput>
Output from my bad attempt:
Jones Smith Baker Johnson
Please advise.

Have you tried something like this:
<cfoutput query="otherquery" group="id">
#id#<br>
<cfoutput>
#names#
<cfif otherquery.currentrow lt otherquery.recordcount>
</cfif>
</cfoutput>
</cfoutput>
Bryan Ashcraft (remove brain to reply)
Web Application Developer
Wright Medical Technologies, Inc.
Macromedia Certified Dreamweaver Developer
Adobe Community Expert (DW) ::
http://www.adobe.com/communities/experts/
"Florida" <[email protected]> wrote in
message
news:e7ecq2$49o$[email protected]..
> The
id and
names are from different tables where the query
> fetches an
id that someone enters in a form and fetches the
>
id
> and
names. I have to group the otherquery by id so I can fetch
all
>
id listings and get the
names for each
id.
>
>
> Here is how I currently have it and it works great but
the comma at the
> end is
> the only problem:
>
> <cfoutput query="otherquery" group="id">
> #id#<br>
> <cfoutput>
> #names#,
> </cfoutput>
> </cfoutput>
>
>
> Output:
> Thompson, Jones, Williams,
>

Similar Messages

  • Comma as end separator

    Hi,
    I have two requirments.
    I need comma as end separator and the file name must be emp_<mmyyyy>.
    Please let me know how to achieve it.

    Hi,
    Put endSeparator = ','
    and for file name use variable substitution and you can create a field in target structure which will contain the file format, for that use Date Function->DateTrans(source as it is and target ddMMyyyy)->Substring function(2,6)--->target field.
    If you want to remove this field finally use this thread
    Re: Variable Substitution field shouldnot be written to the file
    Hope it helps.
    Thanks!

  • Enable comma separated values (CSV) output

    I am trying to figure out how to (Enable comma separated values (CSV) output ) for a report. Do you have an example or info on how to do that?

    Can you provide an example on how you completed the setup? I am in the same boat but can't find an example to this subject

  • Single Frame jumping towards end of output .mov

    I have two sequences output from motion. One 10 seconds and the other 17. At the end of each clip there is a single frame that "jumps" up about 1/8 of the screen.
    Any ideas as to why?

    Are these the same clips you're writing about in Color? If so, it's most likely a media issue since it is unlikely that rendered or exported footage will exhibit a physical artifact from multiple applications unless the media itself is at fault. Is it the last frame or just a frame toward the end? What have you tried to isolate the issue? If you make the sequence longer does thhe jump still occur at the last frame?
    There are only three possible answers: the media is damaged, you've somehow programmed a move, or an inexplicable glitch. The last is highly unlikely and it will move each time you render. If the jumps happen at exactly the same frame each time, it's most likely the source media.
    Would also help tremendously to know what codec you're using and what your source codec is.
    bogiesan

  • 9iJSP Report output to a comma seperated file

    Hi,
    Is it possible to create a comma seperated file with output data from a 9iJSP report. If yes, can anyone tell me how ??
    thanks in advance
    Unmesh

    Hello Unmesh,
    If your JSP report has a paper layout, then you can use Reports Builder or the client/servlet/runtime executables to generate the paper layout to CSV formatted output with the DESFORMAT=DELIMITEDDATA and DELIMITER=, command-line options. If you have only a web layout , it will generate its output only in HTML format.
    You can add a paper/web layout to your JSP report, if it already doesn't have one, by opening it in Reports Builder, and inserting a report block in the paper layout view/web source view. This JSP report can then be used both to generate to CSV format using rwservlet, and to the web when deployed as a JSP.
    Thanks,
    The Oracle Reports Team.

  • How do I output a large Ai file as multiple PDFs (via views, pages, whatever)

    I am working in FreeHand 10 and Illustrator CS3 on a large street map. The client wants to do his own edits to the map in Illustrator (version unknown) then output it so he can show a section per page, in an atlas he plans to publish. And maintain the map himself in the future. The base map is 30 inches square, and the section excerpted on each page of his atlas will be 7 x 9 inches.
    The client currently outputs (text-only) directories in MS Word, and I'm wondering if I need to tell him "Hey, you need to buy and learn InDesign (as well as Illustrator) to output your atlas" or whether there's an easy way to output a large map in multiple PDFs, a page at a time that he could use as images in Word. I am trying to keep it sensible for everyone plus affordable.
    What I know about Word is you can make a picture box, and crop images placed in the picture box, but I could only get it to crop an inch or two at most. Not the comparative "limitless" picture box found in Quark (and I assume InDesign).
    (In FreeHand I had a similar atlas project where I created the master map on page 1, then made a couple dozen small pages, each with a rectangle (a frame) on a top layer. I gave each frame a "lens fill" set to a magnification of 1X, and put the centerpoint over the desired part of the master map. The section of the map appeared in the frame. This worked great for the first five or ten pages -- I could make multi-page PDFs -- a sort of PDF atlas. Eventually all the processing of lines, type, and fills bogged down my Mac's (or FreeHand's) memory so the PDF export would abort mid-stream -- I ended up outputting only individual map pages or 10-12 pages per PDF).
    IS THERE A WAY to do a similar, multi-page output, or a series of little PDFs, in CS3? (Or in CS4, which is in the mail)? I know the "professional" way is to place the full EPS or PDF of the map in a page layout program and crop the picture box to the desired area. That's making more and more sense.
    I get the sense from what I don't find in the CS3 User Manual that the only way to output a drawing is a page at a time (and naturally only one page per file). I would feel a little nervous in CS4 making an array of multiple pages butted against each other and laying the map on top of them all (but maybe that would work). CS4 has "views" but I don't know if they correspond to output files.
    There are enough pages in the finished atlas that it's not economical to make the master map into a big PDF, save multiple copies, then crop each PDF on a different section of the map (such as using Apple Preview). Enough hand-work that labor would equal the cost of the software we're tentatively too frugal to buy. (A clue as to how to proceed).
    The client is on a PC (not necessarily a powerful one); has a friend with Illustrator. Is open to upgrading his equipment. I'm on a Mac G4, running Illustrator CS3 and soon CS4.
    At a certain point it may be the least troublesome approach is to lay the learning curve and burden of [computer and] software acquisiiton on the client and let each piece of software do what it does best. Or say, "sorry, editable files aren't practical, but here's a good set of prints for you to mark up, and I'll do the edits and make you a set of PDFs" which is more how I usually work.
    I acknowledge this was a rather long, multi-stranded question; thanks to anyone who waded through it, and I apprciate any wisdom anyone can offer. Thanks!

    ...continued
    If this is a valued and expectedly ongoing relationship, regardless of whether the files working files are going to be in FH or AI, I would make sure that both your and his working files are both on the same application (and I would say even the same platform).
    > The client currently outputs (text-only) directories in MS Word, and I'm wondering if I need to tell him "Hey, you need to buy and learn InDesign (as well as Illustrator) to output your atlas".
    I would politely and briefly commend the client for considering doing his own routine edit maintenance, but caution him that such edits need to be done in the native map files, not in the "container" file of whatever program he imports the artwork into. Doing so will likely involve a not-impractical, but still-significant learning curve for him or his staff--editing the maps requires at least working familiarity with a vector drawing program--and offer your services to help him along the way as he learns. If the client is going to commit to doing his own edits, he needs to commit up-front to doing them
    correctly in the native illustration files' format. Otherwise, he will be asking for trouble down the road that will eventually cost him more than the benefits of bringing the edits in-house.
    >...or whether there's an easy way to output a large map in multiple PDFs, a page at a time that he could use as images in Word.
    PDF exported from FH will not provide the client the editability you have suggested he needs. PDF exported from Illustrator (with AI editability included) will have the same file-size problem you've already encountered: Content of the map beyond the page is merely masked, not actually removed.
    > I am trying to keep it sensible for everyone plus affordable.
    I commend
    you for that stance. Freelance illustrators often shoot themselves in the foot by being overly protective of
    practial illustration / design work that a client rightly
    needs to be able to edit. Helping the client achieve self-sufficency can be just as profitable (or more so) than requiring the client to come back to you for every little edit.
    > What I know about Word...
    Include in your explanation with your client: Common office- or personal-productivity software, by their nature, lack technical capability necessary and proper for commercial reproduction. It's not that they are "bad" or "amateurish" programs; they're just not designed for the purpose.
    Leave open the option of re-importing the map illustrations into Word, if the client still wants to. But re-emphasize that any routine
    editing of the working map files needs to be done in their native illustration program.
    > (In FreeHand I had a similar atlas project where I [used Lens objects]. This worked great for the first five or ten pages...[but eventually]...bogged down....
    Illustrator provides nothing like FreeHand's excellent Lens Fill feature. You can use Clipping Masks and Symobls as a cumbersome workaround, but you'll have the same file-size issues, because you are merely masking artwork, not actually removing it.
    I must admit I can't remember if FH's Lens objects actually trim to their content after being Ungrouped, (and don't presently have FH on this laptop to check), but I don't think so. If they did, then Lens objects would be an alternative to the other cutting method described below.
    > IS THERE A WAY to do a similar, multi-page output, or a series of little PDFs, in CS3? (Or in CS4, which is in the mail)?
    I strongly suspect that artwork that
    spans adjacent pages in AI CS4 will be treated the same as artworking which
    extends beyond the artboard in current AI: it will be merely masked with a clipping path when exported to PDF, not trimmed. The same sloppy and data-heavy content problems will persist.
    > I get the sense from what I don't find in the CS3 User Manual that the only way to output a drawing is a page at a time (and naturally only one page per file).
    No. In CS3 you could:
    1. Open the 30 x 30 map in AI on a 30 x 30 Artboard.
    2. In the Print dialog, set up 7 x 9 page tiling, and in the Output pane, select Tile Full Pages.
    3. Export a multi-page PDF.
    But again, the content of the PDF pages would merely mask the artwork that extends beyond each page tile. Your PDF file(s) will still likely be much larger than necessary.
    Understand, that may still be a workable option if the client places in his page layouts some
    other format that actually crops the artwork. In other words, you could:
    1. Get the FH native artwork into AI and perform all the cleanup necessary for the AI file to become from now on your permanent working file.
    2. Use a single Artboard, and use PageTiling as described above to export the multi-page PDF.
    3. Use Acrobat Professional to export the PDF pages to raster images.
    4. Place the raster images in whatever program is to be used for the whole document page layouts.
    > The client is on a PC (not necessarily a powerful one); has a friend with Illustrator. Is open to upgrading his equipment. I'm on a Mac G4, running Illustrator CS3 and soon CS4.
    The above workflow should work fine. To be self-sufficient, it would require as a minimum:
    * The client contracting with you to build a proper and clean AI version of the FH map. Depending on the actual content, that may be a straightforward file translation, or it may require alot of tedious and time-consuming cleanup after importing the FH artwork.
    * The client (and/or friend) would need Illustrator and Acrobat Pro, plus whatever program he choses for the page assembly work. If he/they use AI CS4, that
    may suffice for the page-assembly portion of the work, too. That's yet to be seen. One limitation that comes immediately to mind is that AICS4's long overdue multiple page capability is (unlike FH's) limited to 100 pages.
    > Or say, "sorry, editable files aren't practical, but here's a good set of prints for you to mark up, and I'll do the edits and make you a set of PDFs" which is more how I usually work.
    That is, of course, for you to work out with the client. It sounds like your head is screwed on straight. You are looking for the most practical and expedient solution to server your customer, not being denfensive and desirous of requiring the client to come to you for every little edit.
    The decisions is going to boil down to how much actual illustration editing know-how he wants to take on. It can be a great hands-on training opportunity for you as his "on call" trainer. That arrangement would provide your client the practical autonomy he wants, with the comfort and confidence that things won't get out of whack with you as his outsource guru.
    Or, the client may find that the editing tasks require more hands-on skill than he wants to take on. Consider doing a walk-through exercise to show him (and/or his staff) the skills involved in the kinds of edits they will need to make routinely.
    Regardless, though, I would firmly insist that the editing needs to be always done "according to Hoyle" in the native illustration program--and
    never (stress this) by means of cheezy workaounds in the page-layout program, or some intermediate program. That is
    not in your client's best interest, even if it seems initially the "easy way out." It will quickly lead to the map artwork becomming an unmanageable mess.
    continues...
    JET

  • Need to output data to TXT with static header and footer but multiple rows

    Using APEX 4.0 and 11g - The only way I could find to get data out of APEX in TXT format was to use htp.prn. I load a cursor with the data and this works fine, the problem is that I need to have the file start with a string (*:P9_HEADER_STRING*) but it can only appear once in the output.
    Is there a way to add the *:P9_HEADER_STRING* to the output in a single TXT file? or is there another way I should be doing this?
    This is what I have now: The *:P9_HEADER_STRING* is in the loop which I know it can't be, but I can't figure out how to concatenate this string to the output from the loop. The rank() is being used because I can only send the selected number of records, ranked from highest. (I will have to do the same thing with a footer too, but that variable isn't in here yet)
    begin
    -- Set the MIME type
    owa_util.mime_header( 'application/octet', FALSE );
    -- Set the name of the file
    htp.p('Content-Disposition: attachment; filename="cra_outgoing.txt"');
    -- Close the HTTP Header
    owa_util.http_header_close;
    -- Loop through all rows in CLIENT_TABLE
    for x in (select * from (select XREF_NBR
    , TOT_AMT
    , '' SPOUSE_INFO
    , '' PHONES
    , NAME
    , SURNAME
    , '' MARITAL_STATUS
    , '' EMPLOYER_INFO
    , GENDER
    , '' CO_ADDRESS
    , '' PREV_ADDRESS
    , POSTAL_CODE
    , ADDRESS1
    , '' FILLER
    , rank() over (order by tot_amt desc, rownum asc) rn
    from client_table c where c.File_Seq_Nbr is NULL and c.xref_nbr in (select xref_nbr from ticket_table where to_char(ticket_issue_date, 'YYYY-MM-DD') between :P7_START_DATE and :P7_END_DATE))
    where rn <= :P7_NUMBER_RECORDS)
    loop
    -- Print out a portion of a row,
    -- separated by commas and ended by a CR
    htp.prn( *:P9_HEADER_STRING* || '03' || lpad(X.XREF_NBR, 12) || lpad(x.TOT_FINE_AMT, 11, '0') || '0201'|| lpad(x.NAME, 30) || lpad(x.SPOUSE_INFO, 60) || '00000000000000000000'|| x.DATE_OF_BIRTH || '0000000000000000' || x.GENDER || x.MARITAL_STATUS || lpad(x.EMPLOYER_INFO, 60) || lpad(x.CO_ADDRESS, 102) || lpad(x.ADDRESS1, 30) || lpad(x.POSTAL_CODE, 9) || lpad(x.FILLER, 21) );
    end loop;
    -- Send an error code so that the
    -- rest of the HTML does not render
    htmldb_application.g_unrecoverable_error := true;
    end;

    Yes, I've already done that, hence this part of the code I pasted above:
    begin
    -- Set the MIME type
    owa_util.mime_header( 'application/octet', FALSE );
    -- Set the name of the file
    htp.p('Content-Disposition: attachment; filename="cra_outgoing.txt"');
    -- Close the HTTP Header
    owa_util.http_header_close;
    -- Loop through all rows in CLIENT_TABLE
    -- Send an error code so that the
    -- rest of the HTML does not render
    htmldb_application.g_unrecoverable_error := true;
    end;
    I've solved my problem by loading the cursor data into a variable (inside the loop) and concatenating the header info to it (outside the loop). This works when there are only a few records but as soon as I get to 32767 bytes it's throwing an error because of the size. So that's a different issue altogether.

  • Output Mutiple Files Using htp.p

    Hello,
    I wish to output 3 CSV files from APEX I have the following code
    Declare
    S_FileName VarChar(20);
    S_Counter Number;
    begin
    -- Set the File NAme
    S_FileName :=To_char(sysdate,'yyyymmdd')||'Letters.CSV';
    For S_Counter IN 1..4 LOOP
    -- Set the MIME type
    owa_util.mime_header( 'application/octet', FALSE );
    -- Set the name of the file
    htp.p('Content-Disposition: attachment; filename="'||S_FILENAME||S_Counter|| '"');
    -- Close the HTTP Header
    owa_util.http_header_close;
    -- Loop through all rows in EMP
    for x in (select MPAN_CORE,ACCOUNT_NO
    from Categoriser.LTNA_LETTER_ONE_OUTPUT@link_to_dqmDevdb )
    loop
    -- Print out a portion of a row,
    -- separated by commas and ended by a CR
    htp.prn(x.MPAN_CORE ||','|| x.ACCOUNT_NO ||','||
    x.MPAN_CORE || chr(13));
    END LOOP;
    END LOOP;
    -- Send an error code so that the-- rest of the HTML does not render
    htmldb_application.g_unrecoverable_error := true;
    end;
    At this stage i only want to output 3 files the content is not a issue
    I it possible to do this with APEX?
    Any help on this is greatly appreciated.
    David

    I take it from the lack of response that this is not somthing that APEX can do?No, it's something that HTTP cannot do. Think about it: if it was possible for a server to send multiple files in response to an HTTP request, then it would be possible to break your computer very easily indeed.
    aww well looks like i will need to find another way..You'd need something in the browser client-side, Java applet, Flash control etc...

  • Output in table format

    i created a procedure as
    create or replace procedure emp_output (v_empno in number)
    as
    cursor c1 is select ename,job,mgr,hiredate,sal,comm,deptno from emp where empno = v_empno;
    ENAME scott.emp.ename%type;
    JOB scott.emp.job%type;
    MGR scott.emp.mgr%type;
    HIREDATE scott.emp.hiredate%type;
    SAL scott.emp.sal%type;
    COMM scott.emp.comm%type;          
    DEPTNO scott.emp.deptno%type;
    begin
    open c1;
    loop
    fetch c1 into ename,job,mgr,hiredate,sal,comm,deptno;
    exit when c1%notfound;
    dbms_output.put_line(v_empno||','||ename||','||job||','||mgr);
    end loop;
    close c1;
    end;
    Its output will look like this
    7521,WARD,SALESMAN,7698
    i want my procedure to retur me the output similar the way it looks when we do select * from emp where empno = 7521
    table format

    Hi,
    Example:
    Connected to Oracle Database 10g Express Edition Release 10.2.0.1.0
    Connected as hr
    SQL> SELECT employee_id, first_name, last_name FROM employees where rownum < 2;
    EMPLOYEE_ID FIRST_NAME           LAST_NAME
            100 Steven               King
    SQL>
    SQL> SET SERVEROUTPUT ON
    SQL> BEGIN
      2     DBMS_OUTPUT.put_line('EMPLOYEE_ID FIRST_NAME           LAST_NAME');
      3     DBMS_OUTPUT.put_line('----------- -------------------- -------------------------');
      4     FOR reg IN (SELECT employee_id,
      5                        first_name,
      6                        last_name
      7                   FROM employees
      8                  WHERE rownum < 2) LOOP
      9        dbms_output.put_line(LPAD(reg.employee_id,
    10                                  11) || ' ' || RPAD(reg.first_name,
    11                                                     20) || ' ' ||
    12                             RPAD(reg.last_name,
    13                                  20));
    14     END LOOP;
    15  END;
    16  /
    EMPLOYEE_ID FIRST_NAME           LAST_NAME
            100 Steven               King               
    PL/SQL procedure successfully completed
    SQL> Regards,

  • How to ignore the last recrod end separator

    Hi Team,
    I am creating a file like below
    1,100,200&2,200,300&3,300,400&
    In this file
    First Record is--1,100,200
    Second Record is--2,200,300
    Third Record is--3,300,400
    I am using the field separator is ,(comma) and end separator is &.
    My requirement is last record does not contain the end separator(&).
    My output file should be like this
    1,100,200&2,200,300&3,300,400
    Regards
    Swathi

    Hi Swathi,
    U can use another mapping in ur scenario.
    Just take input as field with string and read whole data and create output as a field with string den do the below mapping
    field1
                   endswith-->                                          if with out else>    replace string--
    >target Field
    &                                                                                space
                                    field1
                                                   concat
    first check  source field is endswith & or not if it endswith & then concat & to field1 then replace && to space and map to target u will get ur scenario correctly.
    Thanks,
    Enivass
    Edited by: enivas on Jan 12, 2012 10:57 AM

  • On commit fast refreshable materialized view does not update

    ... but instead it deletes and inserts. And I would like it to perform an update, so we can add a database trigger to call a webservice. But it's crucial that we call the "update webservice" when it updates.
    This is an Oracle 10.2.0.4 database.
    Output of my problem-reproducing-case:
    First creation of a small instrumentation setup:
    SQL> create table logtable
      2  ( id   number
      3  , time timestamp
      4  , text varchar2(100)
      5  )
      6  /
    Tabel is aangemaakt.
    SQL> create sequence log_seq cache 100
      2  /
    Reeks is aangemaakt.
    SQL> create procedure add_log_message (p_text in varchar2)
      2  is
      3    pragma autonomous_transaction;
      4  begin
      5    insert into logtable
      6    values (log_seq.nextval,systimestamp,p_text);
      7    commit;
      8  end;
      9  /
    Procedure is aangemaakt.Two tables with full blown materialized view logs defined on them:
    SQL> create table t1 (id,ean)
      2  as
      3   select level
      4        , to_char(trunc(dbms_random.value(0,999999999999999999)))
      5     from dual
      6  connect by level <= 10
      7  /
    Tabel is aangemaakt.
    SQL> alter table t1 add primary key (id)
      2  /
    Tabel is gewijzigd.
    SQL> create materialized view log on t1 with sequence, rowid (id,ean) including new values
      2  /
    Gematerialiseerde viewlog is aangemaakt.
    SQL> create table t2 (id,t1_id,value)
      2  as
      3   select level
      4        , level * 2
      5        , trunc(dbms_random.value(1,100))
      6     from dual
      7  connect by level <= 5
      8  /
    Tabel is aangemaakt.
    SQL> alter table t2 add primary key (id)
      2  /
    Tabel is gewijzigd.
    SQL> alter table t2 add foreign key (t1_id) references t1(id)
      2  /
    Tabel is gewijzigd.
    SQL> create materialized view log on t2 with sequence, rowid (id,t1_id,value) including new values
      2  /
    Gematerialiseerde viewlog is aangemaakt.And the materialized view itself, containing an outer join. And on that materialized view there is a trigger that logs the action performed (I, U or D):
    SQL> create materialized view mv refresh fast on commit
      2  as
      3  select t1.rowid t1_rowid
      4       , t2.rowid t2_rowid
      5       , t1.id    t1_id
      6       , t1.ean   ean
      7       , t2.id    t2_id
      8       , t2.value value
      9    from t1
    10       , t2
    11   where t1.id = t2.t1_id (+)
    12     and t1.ean is not null
    13  /
    Gematerialiseerde view is aangemaakt.
    SQL> create trigger mv_trg_ariud
      2  after insert or update or delete on mv
      3  for each row
      4  begin
      5    add_log_message
      6    ( case
      7        when inserting then 'I'
      8        when updating then 'U'
      9        when deleting then 'D'
    10      end
    11    );
    12  end;
    13  /
    Trigger is aangemaakt.
    SQL> select * from mv
      2  /
    T1_ROWID           T2_ROWID                T1_ID EAN                                           T2_ID      VALUE
    AAFwMeAChAABamIAAA                             1 360432237186591962
    AAFwMeAChAABamIAAB AAFwMhAChAABamaAAA          2 706465424496730795                                1         77
    AAFwMeAChAABamIAAC                             3 678961199378791568
    AAFwMeAChAABamIAAD AAFwMhAChAABamaAAB          4 351418443524585979                                2         35
    AAFwMeAChAABamIAAE                             5 610374519804201714
    AAFwMeAChAABamIAAF AAFwMhAChAABamaAAC          6 798782716740397566                                3         33
    AAFwMeAChAABamIAAG                             7 909989471290455410
    AAFwMeAChAABamIAAH AAFwMhAChAABamaAAD          8 670698835550268126                                4         69
    AAFwMeAChAABamIAAI                             9 746290195605805530
    AAFwMeAChAABamIAAJ AAFwMhAChAABamaAAE         10 157491298211132413                                5         82
    10 rijen zijn geselecteerd.Now we add a new t1 row, which leads to an extra row in the mv on commit time:
    SQL> insert into t1 values (11, '999999999999999999')
      2  /
    1 rij is aangemaakt.
    SQL> commit
      2  /
    Commit is voltooid.
    SQL> select rpad(text,10) || to_char(time,'hh24:mi:ss.ff6') log
      2    from logtable
      3   order by id
      4  /
    LOG
    I         11:39:47.817225
    1 rij is geselecteerd.
    SQL> select * from mv where ean = '999999999999999999'
      2  /
    T1_ROWID           T2_ROWID                T1_ID EAN                                           T2_ID      VALUE
    AAFwMeAChAABamJAAA                            11 999999999999999999
    1 rij is geselecteerd.As expected. Now insert a record in t2, which should lead to an update of the materialized view:
    SQL> insert into t2 values (11,11,1)
      2  /
    1 rij is aangemaakt.
    SQL> commit
      2  /
    Commit is voltooid.
    SQL> select * from mv where ean = '999999999999999999'
      2  /
    T1_ROWID           T2_ROWID                T1_ID EAN                                           T2_ID      VALUE
    AAFwMeAChAABamJAAA AAFwMhAChAABambAAA         11 999999999999999999                               11          1
    1 rij is geselecteerd.
    SQL> select rpad(text,10) || to_char(time,'hh24:mi:ss.ff6') log
      2    from logtable
      3   order by id
      4  /
    LOG
    I         11:39:47.817225
    D         11:39:47.992824
    I         11:39:48.015072
    3 rijen zijn geselecteerd.But it doesn't: apparently it has inserted a row and deleted a row. Let's do a normal update:
    SQL> update t2 set value = 2 where id = 11
      2  /
    1 rij is bijgewerkt.
    SQL> commit
      2  /
    Commit is voltooid.
    SQL> select * from mv where ean = '999999999999999999'
      2  /
    T1_ROWID           T2_ROWID                T1_ID EAN                                           T2_ID      VALUE
    AAFwMeAChAABamJAAA AAFwMhAChAABambAAA         11 999999999999999999                               11          2
    1 rij is geselecteerd.
    SQL> select rpad(text,10) || to_char(time,'hh24:mi:ss.ff6') log
      2    from logtable
      3   order by id
      4  /
    LOG
    I         11:39:47.817225
    D         11:39:47.992824
    I         11:39:48.015072
    D         11:39:48.142621
    I         11:39:48.168553
    5 rijen zijn geselecteerd.And again: a delete and an insert.
    Does anybody know if I can change this behaviour and let the mv perform an update?
    In another materialized view (not shown here) containing aggregates, I've seen that it performs an update. But using this "join" mv, it does not.
    Here is the script, if you want to try it on your own database:
    create table logtable
    ( id   number
    , time timestamp
    , text varchar2(100)
    create sequence log_seq cache 100
    create procedure add_log_message (p_text in varchar2)
    is
      pragma autonomous_transaction;
    begin
      insert into logtable
      values (log_seq.nextval,systimestamp,p_text);
      commit;
    end;
    create table t1 (id,ean)
    as
    select level
          , to_char(trunc(dbms_random.value(0,999999999999999999)))
       from dual
    connect by level <= 10
    alter table t1 add primary key (id)
    create materialized view log on t1 with sequence, rowid (id,ean) including new values
    create table t2 (id,t1_id,value)
    as
    select level
          , level * 2
          , trunc(dbms_random.value(1,100))
       from dual
    connect by level <= 5
    alter table t2 add primary key (id)
    alter table t2 add foreign key (t1_id) references t1(id)
    create materialized view log on t2 with sequence, rowid (id,t1_id,value) including new values
    create materialized view mv refresh fast on commit
    as
    select t1.rowid t1_rowid
         , t2.rowid t2_rowid
         , t1.id    t1_id
         , t1.ean   ean
         , t2.id    t2_id
         , t2.value value
      from t1
         , t2
    where t1.id = t2.t1_id (+)
       and t1.ean is not null
    create trigger mv_trg_ariud
    after insert or update or delete on mv
    for each row
    begin
      add_log_message
      ( case
          when inserting then 'I'
          when updating then 'U'
          when deleting then 'D'
        end
    end;
    select * from mv
    insert into t1 values (11, '999999999999999999')
    commit
    select rpad(text,10) || to_char(time,'hh24:mi:ss.ff6') log
      from logtable
    order by id
    select * from mv where ean = '999999999999999999'
    insert into t2 values (11,11,1)
    commit
    select * from mv where ean = '999999999999999999'
    select rpad(text,10) || to_char(time,'hh24:mi:ss.ff6') log
      from logtable
    order by id
    update t2 set value = 2 where id = 11
    commit
    select * from mv where ean = '999999999999999999'
    select rpad(text,10) || to_char(time,'hh24:mi:ss.ff6') log
      from logtable
    order by id
    set echo off
    drop materialized view mv
    drop table t2 purge
    drop table t1 purge
    drop procedure add_log_message
    drop sequence log_seq
    drop table logtable purge
    /Regards,
    Rob.
    Edited by: Rob van Wijk on 7-mrt-2009 9:49
    bump

    Rob,
    here's what Tom says about this:
    seems dangerous as there is nothing stopping Oracle from performing an "update" of a materialized
    view as a DELETE+INSERT.  For you see, the internals of how materialized views are maintained are
    "internal" and subject to change (so even if documented - so what, you cannot control the "how" of
    materialized view refreshes)
    ...It is from 2006 though ...things might have changed ;)

  • How can i output backup set that generated by RMAN into a named pipe?

    Hi, buddy!
    Now i want to backup and restore oracle database or tablespaces with RMAN, and i need to use RMAN to write/read backup set into a named pipe that Operation System created. Is there any method to do it??
    Thank you for your attention!!

    Thank you very much!!
    I hava read this article you give and have a try according to it. When i start RMAN with pipe mode, i can send command in sqlplus and receive the result log from RMAN. But i can't take the RMAN to backup database into a pipe. for example, my sql statements is following that:
    please note line 2,"FORMAT 'ORA$RMAN_P1_OUT' ". It is error ,but that is what i want.
    so could you tell me how should i do? Or Rman does not support output the backup set to a pipe radically.
    SQL> DECLARE
    2 V_INPUT VARCHAR2(32767) := 'BACKUP DATABASE FORMAT 'ORA$RMAN_P1_OUT';';
    3 V_OUT NUMBER;
    4 BEGIN
    5 DBMS_PIPE.PACK_MESSAGE(V_INPUT);
    6 V_OUT := DBMS_PIPE.SEND_MESSAGE('ORA$RMAN_PI_IN');
    7 DBMS_OUTPUT.PUT_LINE(V_OUT);
    8 COMMIT;
    9 END;
    10 /

  • How to acheive this output during the XML conversion ?.

    I am converting the data into XML. I am using Oracle8i.
    create table emp(empno number,
    ename varchar2(20),
    deptno number);
    insert into emp values(101,'Krish',10);
    insert into emp values(102,null, 10);
    insert into emp values(103,'Scott',20);
    commit;
    CREATE OR REPLACE PROCEDURE STP_TEST_XML AS
    v_context DBMS_XMLQUERY.CTXTYPE;
    v_document CLOB;
    v_error_code VARCHAR2(3) := 'OK';
    BEGIN
    v_context:= DBMS_XMLQUERY.NEWCONTEXT('SELECT * FROM EMP');
    DBMS_XMLQUERY.USENULLATTRIBUTEINDICATOR(v_context,TRUE);
    DBMS_XMLQUERY.SETROWSETTAG(v_context,'EMPIMPORT');
    DBMS_XMLQUERY.SETROWTAG(v_context,'EMP');
    v_document := DBMS_XMLQUERY.GETXML(v_context);
    DBMS_XMLQUERY.CLOSECONTEXT(V_context);
    PRINT_XML(v_document);
    END;
    CREATE OR REPLACE PROCEDURE print_xml(result IN OUT NOCOPY CLOB) is
    xmlstr varchar2(32767);
    line varchar2(2000);
    begin
    xmlstr := dbms_lob.SUBSTR(result,32767);
    loop
    exit when xmlstr is null;
    line := substr(xmlstr,1,instr(xmlstr,chr(10))-1);
    dbms_output.put_line('| '||line);
    xmlstr := substr(xmlstr,instr(xmlstr,chr(10))+1);
    end loop;
    end;
    The output is showing as below.
    <?xml version = '1.0'?>
    <EMPIMPORT>
    <EMP num="1">
    <EMPNO>101</EMPNO>
    <ENAME>Krish</ENAME>
    <DEPTNO>10</DEPTNO>
    </EMP>
    <EMP num="2">
    <EMPNO>102</EMPNO>
    <ENAME NULL="YES"/>
    <DEPTNO>10</DEPTNO>
    </EMP>
    <EMP num="3">
    <EMPNO>103</EMPNO>
    <ENAME>Scott</ENAME>
    <DEPTNO>20</DEPTNO>
    </EMP>
    </EMPIMPORT>
    But my requirement needs my output should be as below. Please let me know how to achieve this output.
    <?xml version = '1.0'?>
    <EMPIMPORT>
    <EMP num="1">
    <EMPNO>101</EMPNO>
    <ENAME>Krish</ENAME>
    <DEPTNO>10</DEPTNO>
    </EMP>
    <EMP num="2">
    <EMPNO>102</EMPNO>
    <ENAME/>
    <DEPTNO>10</DEPTNO>
    </EMP>
    <EMP num="3">
    <EMPNO>103</EMPNO>
    <ENAME>Scott</ENAME>
    <DEPTNO>20</DEPTNO>
    </EMP>
    </EMPIMPORT>

    can you please tell me how to acheive 1,2,3  instead of the chars.
    Also if I use virtual characteristic can I able to access the query structure in the user exit like the restricted key figures etc or just the records how they appear in the cube.
    Thank you guys for the quick response.

  • ORA-03113: end-of-file on communication channel:(The queuing is not enabled

    The queuing is not enabled.
    SQL> select * from user_queues;
    NAME QUEUE_TABLE QID QUEUE_TYPE MAX_RETRIES RETRY_DELAY ENQUEUE DEQUEUE RETENTION USER_COMMENT
    ACK_QUEUE ACK_QUEUE_T 36560 NORMAL_QUEUE 5 6 NO NO 0
    AQ$_ACK_QUEUE_T_E ACK_QUEUE_T 36561 EXCEPTION_QUEUE 0 0 NO NO 0 exception queue
    AQ$_IFW_SYNC_E IFW_SYNC 36562 EXCEPTION_QUEUE 0 0 NO NO 0 exception queue
    IFW_SYNC_QUEUE IFW_SYNC 36563 NORMAL_QUEUE 5 6 NO NO 0
    In blrhpqe2 system when we try to create the queue it gives end-of-communication error. It seems there some problem with the dbms_aqadmn. Can you please check-up and let know your feedback.
    Below the output of the screen contents:
    1* select * from user_queues
    SQL> begin
    2 dbms_aqadm.start_queue(ACK_QUEUE);
    3 commit;
    4 end;
    5 /
    begin
    ERROR at line 1:
    ORA-03113: end-of-file on communication channel
    please help me on this

    >>>ERROR at line 1:
    ORA-03113: end-of-file on communication channel
    conn to database again.
    ORA-03113: end-of-file on communication channel
    Cause: The connection between Client and Server process was broken.
    Action: There was a communication error that requires further investigation. First, check for network problems and review the SQL*Net setup. Also, look in the alert.log file for any errors. Finally, test to see whether the server process is dead and whether a trace file was generated at failure time.

  • Search for records in the event viewer after the last run (not the entire event log), remove duplicate - Output Logon type for a specific OU users

    Hi,
    The following code works perfectly for me and give me a list of users for a specific OU and their respective logon types :-
    $logFile = 'c:\test\test.txt'
    $_myOU = "OU=ABC,dc=contosso,DC=com"
    # LogonType as per technet
    $_logontype = @{
        2 = "Interactive" 
        3 = "Network"
        4 = "Batch"
        5 = "Service"
        7 = "Unlock"
        8 = "NetworkCleartext"
        9 = "NewCredentials"
        10 = "RemoteInteractive"
        11 = "CachedInteractive"
    Get-WinEvent -FilterXml "<QueryList><Query Id=""0"" Path=""Security""><Select Path=""Security"">*[System[(EventID=4624)]]</Select><Suppress Path=""Security"">*[EventData[Data[@Name=""SubjectLogonId""]=""0x0""
    or Data[@Name=""TargetDomainName""]=""NT AUTHORITY"" or Data[@Name=""TargetDomainName""]=""Window Manager""]]</Suppress></Query></QueryList>" -ComputerName
    "XYZ" | ForEach-Object {
        #TargetUserSid
        $_cur_OU = ([ADSI]"LDAP://<SID=$(($_.Properties[4]).Value.Value)>").distinguishedName
        If ( $_cur_OU -like "*$_myOU" ) {
            $_cur_OU
            #LogonType
            $_logontype[ [int] $_.Properties[8].Value ]
    #Time-created
    $_.TimeCreated
        $_.Properties[18].Value
    } >> $logFile
    I am able to pipe the results to a file however, I would like to convert it to CSV/HTML When i try "convertto-HTML"
    function it converts certain values . Also,
    a) I would like to remove duplicate entries when the script runs only for that execution. 
    b) When the script is run, we may be able to search for records after the last run and not search in the same
    records that we have looked into before.
    PLEASE HELP ! 

    If you just want to look for the new events since the last run, I suggest to record the EventRecordID of the last event you parsed and use it as a reference in your filter. For example:
    <QueryList>
      <Query Id="0" Path="Security">
        <Select Path="Security">*[System[(EventID=4624 and
    EventRecordID>46452302)]]</Select>
        <Suppress Path="Security">*[EventData[Data[@Name="SubjectLogonId"]="0x0" or Data[@Name="TargetDomainName"]="NT AUTHORITY" or Data[@Name="TargetDomainName"]="Window Manager"]]</Suppress>
      </Query>
    </QueryList>
    That's this logic that the Server Manager of Windows Serve 2012 is using to save time, CPU and bandwidth. The problem is how to get that number and provide it to your next run. You can store in a file and read it at the beginning. If not found, you
    can go through the all event list.
    Let's say you store it in a simple text file, ref.txt
    1234
    At the beginning just read it.
    Try {
    $_intMyRef = [int] (Get-Content .\ref.txt)
    Catch {
    Write-Host "The reference EventRecordID cannot be found." -ForegroundColor Red
    $_intMyRef = 0
    This is very lazy check. You can do a proper parsing etc... That's a quick dirty way. If I can read
    it and parse it as an integer, I use it. Else, I just set it to 0 meaning I'll collect all info.
    Then include it in your filter. You Get-WinEvent becomes:
    Get-WinEvent -FilterXml "<QueryList><Query Id=""0"" Path=""Security""><Select Path=""Security"">*[System[(EventID=4624 and EventRecordID&gt;$_intMyRef)]]</Select><Suppress Path=""Security"">*[EventData[Data[@Name=""SubjectLogonId""]=""0x0"" or Data[@Name=""TargetDomainName""]=""NT AUTHORITY"" or Data[@Name=""TargetDomainName""]=""Window Manager""]]</Suppress></Query></QueryList>"
    At the end of your script, store the last value you got into your ref.txt file. So you can for example get that info in the loop. Like:
    $Result += $LogonRecord
    $_intLastId = $Event.RecordId
    And at the end:
    Write-Output $_intLastId | Out-File .\ref.txt
    Then next time you run it, it is just scanning the delta. Note that I prefer this versus the date filter in case of the machine wasn't active for long or in case of time sync issue which can sometimes mess up with the date based filters.
    If you want to go for a date filtering, do it at the Get-WinEvent level, not in the Where-Object. If the query is local, it doesn't change much. But in remote system, it does the filter on the remote side therefore you're saving time and resources on your
    side. So for example for the last 30 days, and if you want to use the XMLFilter parameter, you can use:
    <QueryList>
    <Query Id="0" Path="Security">
    <Select Path="Security">*[System[TimeCreated[timediff(@SystemTime) &lt;= 2592000000]]]</Select>
    </Query>
    </QueryList>
    Then you can combine it, etc...
    PS, I used the confusing underscores because I like it ;)
    Note: Posts are provided “AS IS” without warranty of any kind, either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

Maybe you are looking for

  • Problem with: Action Required: Your AOL Username login must transition to Apple ID

    In the early days of the iTunes store, it was possible to log in and make purchases with an AOL screen name. This has since been discontinued. In March 2015, Apple sent out a message to legacy iTunes account holders who have not yet converted their i

  • Reset Clear/Remove Library Message

    Using itunes for windows. When I clear to 'clear' a song from the library I used to get a message asking if I also wanted to remove it from my hard drive. The last time I checked a box that says DO NOT ASK ME AGAIN (or similar) How do I reset this so

  • Is it possible to convert a project in SD to a project in HD

    I finally made the leap from PP 2.0 to PP 5.5.  I have a few projects that where shot in HDV, but downconverted to SD to be able to edit in PP 2.0.  Now that I have PP 5.5 is there anyway to take the original project that was done in SD and unlink th

  • Reducing the precision of the number datatype while creating a M view

    Hi, I am trying to create a materialized view using the query create materialized view mv1 as select cast(empno-7000 as number(3)) empno, sal from emp where empno > 7000; But after creating the mv the description is shown as below SQL> desc mv1 Name

  • [Solved] Recent updates cause Gramps error: No module named _bsddb

    Did a 'pacman -Syu' today and Gramps fails to start: $ gramps 2599: ERROR: gramps.py: line 142: Unhandled exception Traceback (most recent call last): File "/usr/share/gramps/gui/grampsgui.py", line 271, in __startgramps from GrampsLogger import Rota