How can I load a CMYK jpeg image

How can I load a CMYK jpeg image (originally saved from Photoshop) and then
turn it into an rgb BufferedImage, in order to display it on screen in an
applet?
I first tried ImageIO.read(), but that does not work for cmyk jpegs. I then
looked into the com.sun.image.codec.jpeg package, and tried methods like
decodeAsBufferedImage() and decodeAsRaster().
The first one (decodeAsBufferedImage) returned an image, but it seems that
it was interpreted as an ARGB, and the colors were incorrect.
I then read the documentation which (amongst many other things) stated that
"If the user needs better control over conversion, the user must request the
data as a Raster and handle the conversion of the image data themselves."
This made sense, so I took to decodeAsRaster(), only to find that I could
not figure out how to carry out the desired conversion.
Of course, I have looked into the documentation for BufferedImage, Raster,
ColorModel, ColorSpace etc, but after a while I was lost. (Before I got lost
I read that you can convert images with the help of methods like toRGB,
toCIEXYZ.)
I have a feeling that this is probably pretty simple if you just know how to
do it, but I sure would need some directions here.
Any help would be appreciated. Thanks.

You can either use the "Place" command from the main menu, under "File", or you can just open it, select the move tool "V", the click in the image and drag it to the other file's tab.

Similar Messages

  • How can i load or put an image into array of pixels?

    i am doing my undergraduate project , i am using java , mainly the project works in image manipulating or it is image relevant , few days ago i stucked in a little problem , my problem is that i want to put an image scanned from scanner into array or anything ( that makes me reach my goal which is go to specific locations in the image to gather the pixel colour on that location ) , for my project that's so critical to complete the job so , now am trying buffered image but i think it will be significant if i find another way to help , even it isn't in java i heared that matlab has such tools & libraries to help
    thanks .....
    looking forward to hearing from you guys
    Note : My project is java based .

    Check out the PixelGrabber class: http://java.sun.com/j2se/1.5.0/docs/api/java/awt/image/PixelGrabber.html
    It's pretty simple to get an array of Color objects - or you could just leave it as an int array - though it can be somewhat slow.
    //img - Your img
    int[] pix=new int[img.getWidth(null)*img.getHeight(null)];
    PixelGrabber grab=new PixelGrabber(img,0,0,img.getWidth(null),img.getHeight(null),pix,0,img.getWidth(null));
    grab.grabPixels();  //Blocks, you could use startGrabbing() for asynchronous stuff
    Color[] colors=new Color[pix.length];
    for(int in1=0;in1<colors.length;in1++){
    colors[in1]=new Color(pix[in1],true);  //Use false to ignore Alpha channel
    }//for
    //Colors now contains a Color object for every pixel in the image//Mind you, I haven't compiled this so there could be errors; but I've used essentially the same code many times with few difficulties.

  • Problem displaying CMYK jpeg images

    I have a problem with a CMYK jpeg image.
    I know that about supported JPEGs in JRE - JCS_CMYK and JCS_YCCK are not supported directly.
    And I found here how to load the image:
    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4799903
    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5100094
    I used both the suggestions described to load it, but when the image is displayed the colors are wrong, are very different from the one displayed in PhotoShop, for example.
    Any suggestion are very appreciated. If it's necessary i can send you the image.
    Roberto
    Here is the code
    package com.cesarer.example.crop;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.*;
    import java.io.*;
    import java.util.Iterator;
    import javax.imageio.ImageIO;
    import javax.imageio.ImageReader;
    import javax.imageio.stream.ImageInputStream;
    import javax.swing.*;
    import javax.swing.event.MouseInputAdapter;
    public class CroppingRaster extends JPanel
        BufferedImage image;
        Dimension size;
        Rectangle clip;
        boolean showClip;
        public CroppingRaster(BufferedImage image)
            this.image = image;
            size = new Dimension(image.getWidth(), image.getHeight());
            showClip = false;
        protected void paintComponent(Graphics g)
            super.paintComponent(g);
            Graphics2D g2 = (Graphics2D)g;
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                                RenderingHints.VALUE_ANTIALIAS_ON);
            int x = (getWidth() - size.width)/2;
            int y = (getHeight() - size.height)/2;
            g2.drawImage(image, x, y, this);
            if(showClip)
                if(clip == null)
                    createClip();
                g2.setPaint(Color.red);
                g2.draw(clip);
        public void setClip(int x, int y)
            // keep clip within raster
            int x0 = (getWidth() - size.width)/2;
            int y0 = (getHeight() - size.height)/2;
            if(x < x0 || x + clip.width  > x0 + size.width ||
               y < y0 || y + clip.height > y0 + size.height)
                return;
            clip.setLocation(x, y);
            repaint();
        public Dimension getPreferredSize()
            return size;
        private void createClip()
            clip = new Rectangle(140, 140);
            clip.x = (getWidth() - clip.width)/2;
            clip.y = (getHeight() - clip.height)/2;
        private void clipImage()
            BufferedImage clipped = null;
            try
                int w = clip.width;
                int h = clip.height;
                int x0 = (getWidth()  - size.width)/2;
                int y0 = (getHeight() - size.height)/2;
                int x = clip.x - x0;
                int y = clip.y - y0;
                clipped = image.getSubimage(x, y, w, h);
            catch(RasterFormatException rfe)
                System.out.println("raster format error: " + rfe.getMessage());
                return;
            JLabel label = new JLabel(new ImageIcon(clipped));
            JOptionPane.showMessageDialog(this, label, "clipped image",
                                          JOptionPane.PLAIN_MESSAGE);
        private JPanel getUIPanel()
            final JCheckBox clipBox = new JCheckBox("show clip", showClip);
            clipBox.addActionListener(new ActionListener()
                public void actionPerformed(ActionEvent e)
                    showClip = clipBox.isSelected();
                    repaint();
            JButton clip = new JButton("clip image");
            clip.addActionListener(new ActionListener()
                public void actionPerformed(ActionEvent e)
                    clipImage();
            JPanel panel = new JPanel();
            panel.add(clipBox);
            panel.add(clip);
            return panel;
        public static void main(String[] args) throws IOException
             File file = new File("src/ABWRACK_4C.jpg");
             // Find a JPEG reader which supports reading Rasters.
            Iterator readers = ImageIO.getImageReadersByFormatName("JPEG");
            ImageReader reader = null;
            while(readers.hasNext()) {
                reader = (ImageReader)readers.next();
                if(reader.canReadRaster()) {
                    break;
         // Set the input.
            ImageInputStream input =
                ImageIO.createImageInputStream(file);
            reader.setInput(input);
            Raster raster = reader.readRaster(0, null);
             BufferedImage bi = new BufferedImage(raster.getWidth(),
                    raster.getHeight(),
                    BufferedImage.TYPE_4BYTE_ABGR);
             // Set the image data.
             bi.getRaster().setRect(raster);
            // Cropping test = new Cropping(ImageIO.read(file));
             CroppingRaster test = new CroppingRaster(bi);
            ClipMoverRaster mover = new ClipMoverRaster(test);
            test.addMouseListener(mover);
            test.addMouseMotionListener(mover);
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(new JScrollPane(test));
            f.getContentPane().add(test.getUIPanel(), "South");
            f.setSize(400,400);
            f.setLocation(200,200);
            f.setVisible(true);
    class ClipMoverRaster extends MouseInputAdapter
        CroppingRaster cropping;
        Point offset;
        boolean dragging;
        public ClipMoverRaster(CroppingRaster c)
            cropping = c;
            offset = new Point();
            dragging = false;
        public void mousePressed(MouseEvent e)
            Point p = e.getPoint();
            if(cropping.clip.contains(p))
                offset.x = p.x - cropping.clip.x;
                offset.y = p.y - cropping.clip.y;
                dragging = true;
        public void mouseReleased(MouseEvent e)
            dragging = false;
        public void mouseDragged(MouseEvent e)
            if(dragging)
                int x = e.getX() - offset.x;
                int y = e.getY() - offset.y;
                cropping.setClip(x, y);
    }

    The loading process It takes about 10 seconds, and every repaint it takes the same time.The painting yes, the loading no. It shouldn't take much more time to load the image then an ordinary JPEG. In particular, your now using a "natively accelerated" JPEG image reader, so it should take less time on average to load any JPEG. 10 seconds is absurd. Are you sure your not including the drawing time in that figure?
    - Another problem: JAI-ImageIO is not available for MAC OS X platform.This is somewhat true. You can take the imageio.jar file and package it together with your program (adding it to the class path). This will give you most of the functionality of JAI-ImageIO; in particular the TIFFImageReader. You just won't be able to use the two natively accelerated ImageReaders that comes with installing.
    Right now, you're using the accelerated CLibJPEGImageReader to read the image. You can't use this image reader on the MAC, so you have to take the approach mentioned in the 2nd bug report you originally posted (i.e. use an arbitrary CMYK profile).
    The conversion is too long more than 30 seconds.The code you posted could be simplified to
    BufferedImage rgbImage = new BufferedImage(w,h,
                BufferedImage.3_BYTE_BGR);
    ColorConvertOp op = new ColorConvertOp(null);
    op.filter(cmykImage,rgbImage);But again, 30 seconds is an absurd value. After a little preparation, converting from one ICC_Profile to another is essentially a look up operation. What does,
    System.out.println(cmykImage.getColorModel().getColorSpace());print out? If it's not an instance of ICC_ColorSpace, then I can understand the 30 seconds. If it is, then something is dreadfully wrong.
    the RGB bufferedImage that i get after the transformation when it is displayed is much more brightThis is the "one last problem that pops up" that I hinted at. It's because some gamma correction is going on in the background. I have a solution, but it's programming to the implementation of the ColorConvertOp class and not the API. So I'm not sure about its portability between java versions or OS's.
    import javax.swing.*;
    import java.awt.color.ICC_ColorSpace;
    import java.awt.color.ICC_Profile;
    import java.awt.image.BufferedImage;
    import java.awt.image.ColorConvertOp;
    import javax.imageio.ImageIO;
    import java.io.File;
    public class CMYKTest {
         public static void main(String[] args) throws Exception{
            long beginStamp, endStamp;
            //load image
            beginStamp = System.currentTimeMillis();
            BufferedImage img = ImageIO.read(/*cmyk image file*/);
            endStamp = System.currentTimeMillis();
            System.out.println("Time to load image: " + (endStamp-beginStamp));
            //color convert
            BufferedImage dest = new BufferedImage(img.getWidth(),
                                                   img.getHeight(),
                                                   BufferedImage.TYPE_3BYTE_BGR);
            beginStamp = System.currentTimeMillis();
            sophisticatedColorConvert(img,dest);
            endStamp = System.currentTimeMillis();
            System.out.println("Time to color convert: " + (endStamp-beginStamp));
            //display
            JFrame frame = new JFrame();
            frame.setContentPane(new JScrollPane(new JLabel(new ImageIcon(dest))));
            frame.setSize(500,500);
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setVisible(true);
        public static BufferedImage sophisticatedColorConvert(BufferedImage src,
                                                              BufferedImage dst) {
            ICC_ColorSpace srcCS =
                    (ICC_ColorSpace) src.getColorModel().getColorSpace();
            ICC_Profile srcProf = srcCS.getProfile();
            byte[] header = srcProf.getData(ICC_Profile.icSigHead);
            intToBigEndian(ICC_Profile.icSigInputClass,header,12);
            srcProf.setData(ICC_Profile.icSigHead,header);
            ColorConvertOp op = new ColorConvertOp(null);
            return op.filter(src, dst);
        private static void intToBigEndian(int value, byte[] array, int index) {
                array[index]   = (byte) (value >> 24);
                array[index+1] = (byte) (value >> 16);
                array[index+2] = (byte) (value >>  8);
                array[index+3] = (byte) (value);
    }

  • How to insert a pdf or jpeg image into a blob column of a table

    How to insert a pdf or jpeg image into a blob column of a table

    Hi,
    Try This
    Loading an image into a BLOB column and displaying it via OAS
    The steps are as follows:
    Step 1.
    Create a table to store the blobs:
    create table blobs
    ( id varchar2(255),
    blob_col blob
    Step 2.
    Create a logical directory in the database to the physical file system:
    create or replace directory MY_FILES as 'c:\images';
    Step 3.
    Create a procedure to load the blobs from the file system using the logical
    directory. The gif "aria.gif" must exist in c:\images.
    create or replace procedure insert_img as
    f_lob bfile;
    b_lob blob;
    begin
    insert into blobs values ( 'MyGif', empty_blob() )
    return blob_col into b_lob;
    f_lob := bfilename( 'MY_FILES', 'aria.gif' );
    dbms_lob.fileopen(f_lob, dbms_lob.file_readonly);
    dbms_lob.loadfromfile( b_lob, f_lob, dbms_lob.getlength(f_lob) );
    dbms_lob.fileclose(f_lob);
    commit;
    end;
    Step 4.
    Create a procedure that is called via Oracle Application Server to display the
    image.
    create or replace procedure get_img as
    vblob blob;
    buffer raw(32000);
    buffer_size integer := 32000;
    offset integer := 1;
    length number;
    begin
    owa_util.mime_header('image/gif');
    select blob_col into vblob from blobs where id = 'MyGif';
    length := dbms_lob.getlength(vblob);
    while offset < length loop
    dbms_lob.read(vblob, buffer_size, offset, buffer);
    htp.prn(utl_raw.cast_to_varchar2(buffer));
    offset := offset + buffer_size;
    end loop;
    exception
    when others then
    htp.p(sqlerrm);
    end;
    Step 5.
    Use the PL/SQL cartridge to call the get_img procedure
    OR
    Create that procedure as a function and invoke it within your PL/SQL code to
    place the images appropriately on your HTML page via the PL/SQL toolkit.
    from a html form
    1. Create an HTML form where the image field will be <input type="file">. You also
    need the file MIME type .
    2. Create a procedure receiving the form parameters. The file field will be a Varchar2
    parameter, because you receive the image path not the image itself.
    3. Insert the image file into table using "Create directory NAME as IMAGE_PATH" and
    then use "Insert into TABLE (consecutive, BLOB_OBJECT, MIME_OBJECT) values (sequence.nextval,
    EMPTY_BLOB(), 'GIF' or 'JPEG') returning BLOB_OBJECT, consecutive into variable_blob,
    variable_consecutive.
    4. Load the file into table using:
    dbms_lob.loadfromfile(variable_blob, variable_file_name, dbms_lob.getlength(variable_file_name));
    dbms_lob.fileclose(variable_file_name);
    commit.
    Regards,
    Simma........

  • How to set color space to JPEG image with Java advance Imaging

    How to set color space to JPEG image with Java advance Imaging.
    is there any API in JAI which support to set color space.

    I'm definately no guru, but this is how you can change it.
    CTRL + ALT + Click on the part of the component that you want to change. This brings up the Hidden Dom Inspector, background of component will be surrounded with a red outline (Make sure the red outline is surrounding the part of the tabset you want to change), Now you go to properties sheet and click the ellipses next to rules property this will pop up a dialog you look in this list (At the top) to see the default style classes that are affecting the rendering of the component outlined in red. (You will be able to select different sections of a single component) then you just rewrite the style class that you want to change in your Stylesheet (You will not find the styleclass that you want to change because it is a part of your theme .jar but as long as you name it exactly the same and place in your stylesheet it will override the theme .jar style classes) it's actually very easy -- you were right should be a piece of cake for a guru. Don't have the link handy but you can check out Winston's Blog on changing Table Formatting to get this information...It is EXTREMELY useful if you want your apps to have a custom look and not default that comes with Creator Themes.
    Hope this helps you out God knows others have helped me alot!
    Jason

  • How can I load my data faster?  Is there a SQL solution instead of PL/SQL?

    11.2.0.2
    Solaris 10 sparc
    I need to backfill invoices from a customer. The raw data has 3.1 million records. I have used pl/sql to load these invoices into our system (dev), however, our issue is the amount of time it's taking to run the load - effectively running at approx 4 hours. (Raw data has been loaded into a staging table)
    My research keeps coming back to one concept: sql is faster than pl/sql. Where I'm stuck is the need to programmatically load the data. The invoice table has a sequence on it (primary key = invoice_id)...the invoice_header and invoice_address tables use the invoice_id as a foreign key. So my script takes advantage of knowing the primary key and uses that on the subsequent inserts to the subordinate invoice_header and invoice_address tables, respectively.
    My script is below. What I'm asking is if there are other ideas on the quickest way to load this data...what am I not considering? I have to load the data in dev, qa, then production so the sequences and such change between the environments. I've dummied down the code to protect the customer; syntax and correctness of the code posted here (on the forum) is moot...it's only posted to give the framework for what I currently have.
    Any advice would be greatly appreciated; how can I load the data faster knowing that I need to know sequence values for inserts into other tables?
    DECLARE
       v_inv_id        invoice.invoice_id%TYPE;
       v_inv_addr_id    invoice_address.invoice_address_id%TYPE;
       errString        invoice_errors.sqlerrmsg%TYPE;
       v_guid          VARCHAR2 (128);
       v_str           VARCHAR2 (256);
       v_err_loc       NUMBER;
       v_count         NUMBER := 0;
       l_start_time    NUMBER;
       TYPE rec IS RECORD
          BILLING_TYPE             VARCHAR2 (256),
          CURRENCY                 VARCHAR2 (256),
          BILLING_DOCUMENT         VARCHAR2 (256),
          DROP_SHIP_IND            VARCHAR2 (256),
          TO_PO_NUMBER        VARCHAR2 (256),
          TO_PURCHASE_ORDER   VARCHAR2 (256),
          DUE_DATE                 DATE,
          BILL_DATE                DATE,
          TAX_AMT                  VARCHAR2 (256),
          PAYER_CUSTOMER           VARCHAR2 (256),
          TO_ACCT_NO          VARCHAR2 (256),
          BILL_TO_ACCT_NO          VARCHAR2 (256),
          NET_AMOUNT               VARCHAR2 (256),
          NET_AMOUNT_CURRENCY      VARCHAR2 (256),
          ORDER_DT             DATE,
          TO_CUSTOMER         VARCHAR2 (256),
          TO_NAME             VARCHAR2 (256),
          FRANCHISES       VARCHAR2 (4000),
          UPDT_DT                  DATE
       TYPE tab IS TABLE OF rec
                      INDEX BY BINARY_INTEGER;
       pltab           tab;
       CURSOR c
       IS
          SELECT   billing_type,
                   currency,
                   billing_document,
                   drop_ship_ind,
                   to_po_number,
                   to_purchase_order,
                   due_date,
                   bill_date,
                   tax_amt,
                   payer_customer,
                   to_acct_no,
                   bill_to_acct_no,
                   net_amount,
                   net_amount_currency,
                   order_dt,
                   to_customer,
                   to_name,
                   franchises,
                   updt_dt
            FROM   BACKFILL_INVOICES;
    BEGIN
       l_start_time := DBMS_UTILITY.get_time;
       OPEN c;
       LOOP
          FETCH c
          BULK COLLECT INTO pltab
          LIMIT 1000;
          v_err_loc := 1;
          FOR i IN 1 .. pltab.COUNT
          LOOP
             BEGIN
                v_inv_id :=  SEQ_INVOICE_ID.NEXTVAL;
                v_guid := 'import' || TO_CHAR (CURRENT_TIMESTAMP, 'hhmissff');
                v_str := str_parser (pltab (i).FRANCHISES); --function to string parse  - this could be done in advance, yes.
                v_err_loc := 2;
                v_count := v_count + 1;
                INSERT INTO    invoice nologging
                     VALUES   (v_inv_id,
                               pltab (i).BILL_DATE,
                               v_guid,
                               '111111',
                               'NONE',
                               TO_TIMESTAMP (pltab (i).BILL_DATE),
                               TO_TIMESTAMP (pltab (i).UPDT_DT),
                               'READ',
                               'PAPER',
                               pltab (i).payer_customer,
                               v_str,
                               '111111');
                v_err_loc := 3;
                INSERT INTO    invoice_header nologging
                     VALUES   (v_inv_id,
                               TRIM (LEADING 0 FROM pltab (i).billing_document), --invoice_num
                               NULL,
                               pltab (i).BILL_DATE,                 --invoice_date
                               pltab (i).TO_PO_NUMBER,
                               NULL,
                               pltab (i).net_amount,
                               NULL,
                               pltab (i).tax_amt,
                               NULL,
                               NULL,
                               pltab (i).due_date,
                               NULL,
                               NULL,
                               NULL,
                               NULL,
                               NULL,
                               TO_TIMESTAMP (SYSDATE),
                               TO_TIMESTAMP (SYSDATE),
                               PLTAB (I).NET_AMOUNT_CURRENCY,
                               (SELECT   i.bc_value
                                  FROM   invsvc_owner.billing_codes i
                                 WHERE   i.bc_name = PLTAB (I).BILLING_TYPE),
                               PLTAB (I).BILL_DATE);
                v_err_loc := 4;
                INSERT INTO    invoice_address nologging
                     VALUES   (invsvc_owner.SEQ_INVOICE_ADDRESS_ID.NEXTVAL,
                               v_inv_id,
                               'BLAH INITIAL',
                               pltab (i).BILL_DATE,
                               NULL,
                               pltab (i).to_acct_no,
                               NULL,
                               NULL,
                               NULL,
                               NULL,
                               NULL,
                               NULL,
                               NULL,
                               SYSTIMESTAMP,
                               NULL);
                v_err_loc := 5;
                INSERT INTO    invoice_address nologging
                     VALUES   ( SEQ_INVOICE_ADDRESS_ID.NEXTVAL,
                               v_inv_id,
                               'BLAH',
                               pltab (i).BILL_DATE,
                               NULL,
                               pltab (i).TO_ACCT_NO,
                               NULL,
                               NULL,
                               NULL,
                               NULL,
                               NULL,
                               NULL,
                               NULL,
                               SYSTIMESTAMP,
                               NULL);
                v_err_loc := 6;
                INSERT INTO    invoice_address nologging
                     VALUES   ( SEQ_INVOICE_ADDRESS_ID.NEXTVAL,
                               v_inv_id,
                               'BLAH2',
                               pltab (i).BILL_DATE,
                               NULL,
                               pltab (i).TO_CUSTOMER,
                               pltab (i).to_name,
                               NULL,
                               NULL,
                               NULL,
                               NULL,
                               NULL,
                               NULL,
                               SYSTIMESTAMP,
                               NULL);
                v_err_loc := 7;
                INSERT INTO    invoice_address nologging
                     VALUES   ( SEQ_INVOICE_ADDRESS_ID.NEXTVAL,
                               v_inv_id,
                               'BLAH3',
                               pltab (i).BILL_DATE,
                               NULL,
                               'SOME PROPRIETARY DATA',
                               NULL,
                               NULL,
                               NULL,
                               NULL,
                               NULL,
                               NULL,
                               NULL,
                               SYSTIMESTAMP,
                               NULL);
                v_err_loc := 8;
                INSERT
                  INTO    invoice_event nologging (id,
                                                             eid,
                                                             root_eid,
                                                             invoice_number,
                                                             event_type,
                                                             event_email_address,
                                                             event_ts)
                VALUES   ( SEQ_INVOICE_EVENT_ID.NEXTVAL,
                          '111111',
                          '222222',
                          TRIM (LEADING 0 FROM pltab (i).billing_document),
                          'READ',
                          'some_user@some_company.com',
                          SYSTIMESTAMP);
                v_err_loc := 9;
                INSERT INTO   backfill_invoice_mapping
                     VALUES   (v_inv_id,
                               v_guid,
                               pltab (i).billing_document,
                               pltab (i).payer_customer,
                               pltab (i).net_amount);
                IF v_count = 10000
                THEN
                   COMMIT;              
                END IF;
             EXCEPTION
                WHEN OTHERS
                THEN
                   errString := SQLERRM;
                   INSERT INTO   backfill_invoice_errors
                        VALUES   (
                                    pltab (i).billing_document,
                                    pltab (i).payer_customer,
                                    errString || ' ' || v_err_loc
                   COMMIT;
             END;
          END LOOP;
          v_err_loc := 10;
          INSERT INTO   backfill_invoice_timing
               VALUES   (
                           ROUND ( (DBMS_UTILITY.get_time - l_start_time) / 100,
                                  2)
                           || ' seconds.',
                           (SELECT   COUNT (1)
                              FROM   backfill_invoice_mapping),
                           (SELECT   COUNT (1)
                              FROM   backfill_invoice_errors),
                           SYSDATE
          COMMIT;
          EXIT WHEN c%NOTFOUND;
       END LOOP;
       COMMIT;
    EXCEPTION
       WHEN OTHERS
       THEN
          errString := SQLERRM;
          INSERT INTO   backfill_invoice_errors
               VALUES   (NULL, NULL, errString || ' ' || v_err_loc);
          COMMIT;
    END;

    Hello
    You could use insert all in your case and make use of sequence.NEXTVAL and sequence.CURRVAL like so (excuse any typos - I can't test without table definitions). I've done the first 2 tables, so it's just a matter of adding the rest in...
    INSERT ALL
         INTO      invoice nologging
                    VALUES   (     SEQ_INVOICE_ID.NEXTVAL,
                                   BILL_DATE,
                                    my_guid,
                                    '111111',
                                    'NONE',
                                    CAST(BILL_DATE AS TIMESTAMP),
                                    CAST(UPDT_DT AS TIMESTAMP),
                                    'READ',
                                    'PAPER',
                                    payer_customer,
                                    parsed_francises,
                                    '111111'
         INTO      invoice_header
              VALUES   (      SEQ_INVOICE_ID.CURRVAL,
                        TRIM (LEADING 0 FROM billing_document), --invoice_num
                        NULL,
                        BILL_DATE,                 --invoice_date
                        TO_PO_NUMBER,
                        NULL,
                        net_amount,
                        NULL,
                        tax_amt,
                        NULL,
                        NULL,
                        due_date,
                        NULL,
                        NULL,
                        NULL,
                        NULL,
                        NULL,
                        SYSTIMESTAMP,
                        SYSTIMESTAMP,
                        NET_AMOUNT_CURRENCY,
                        bc_value,
                        BILL_DATE)
         SELECT 
         src.billing_type,
              src.currency,
              src.billing_document,
              src.drop_ship_ind,
              src.to_po_number,
              src.to_purchase_order,
              src.due_date,
              src.bill_date,
              src.tax_amt,
              src.payer_customer,
              src.to_acct_no,
              src.bill_to_acct_no,
              src.net_amount,
              src.net_amount_currency,
              src.order_dt,
              src.to_customer,
              src.to_name,
              src.franchises,
              src.updt_dt,
              str_parser (src.FRANCHISES) parsed_franchises,
              'import' || TO_CHAR (CURRENT_TIMESTAMP, 'hhmissff') my_guid,
              i.bc_value
            FROM        BACKFILL_INVOICES src,
                 invsvc_owner.billing_codes i
         WHERE   i.bc_name = src.BILLING_TYPE;Some things to note
    1. Don't commit in a loop - you only add to the run time and load on the box ultimately reducing scalability and removing transactional integrity. Commit once at the end of the job.
    2. Make sure you specify the list of columns you are inserting into as well as the values or columns you are selecting. This is good practice as it protects your code from compilation issues in the event of new columns being added to tables. Also it makes it very clear what you are inserting where.
    3. If you use WHEN OTHERS THEN... to log something, make sure you either rollback or raise the exception. What you have done in your code is say - I don't care what the problem is, just commit whatever has been done. This is not good practice.
    HTH
    David
    Edited by: Bravid on Oct 13, 2011 4:35 PM

  • How can I load an external SWF into a movie clip that's inside other movie clip?

    Hi.
    I creating my first flash (actionscript 3.0) website but I'm
    stuck with a visual effect I want to create.
    I have a window on my website called contentWindow. Every
    time you click a button this window is supposed to leave the stage,
    load the requested content and return to the stage.
    The sliding window is a movie clip with 83 frames, 21 to
    enter the stage, 21 to leave the stage again, 20 for nothing (its
    just to simulate the loading time) and 21 to return to the stage.
    Now my goal is, when the user clicks on a navigation button,
    the window exits the stage, loads an external SWF with the content,
    and then returns to the stage.
    I've the "window" movie clip with an instance name of
    "contentWindow". Inside there is another movie clip with an
    instance name of "contentLoader". The content that the user
    requested should appear inside the "contentLoader".
    Now, when the contentWindow leaves the stage, I get this
    error message:
    quote:
    TypeError: Error #1009: Cannot access a property or method of
    a null object reference.
    at rwd_fla::MainTimeline/trigger()
    If I switch
    "contentWindow.contentLoader.addChild(navLoader);" for
    "contentWindow.addChild(navLoader);" it works fine, but the
    external SWF doesn't move with the window.
    How can I load an external SWF into a movie clip that's
    inside other movie clip?

    Hi,
    Recently, I have been putting together a flash presentation.
    And I am just wondering if the following might help you, in your
    communication with the said swf file:
    loader.contentLoaderInfo.addEventListener(Event.COMPLETE,
    onComplete);
    function onComplete(event:Event):void
    event.target.content.thinggy_mc.y -= 100;
    Not the best example, but this allows you to target a mc
    within an external swf file. I think if you look up this code, you
    will have an answer ;)
    Kind Regards,
    Boxing Boom

  • How can i export a series of images in different aspect ratios to the same height

    How can i export a series of images in different aspect ratios to the same height?
    I wish to make a slider callery for my website. all the images need to be 750 Pixels high, the width does not matter.  I have a mixture of square pandscap and protraite images can i do thing as one export or do i have to do it twice?  Once for long edge and once for shot edge?
    Thanks

    Yes, you can but there is a trick to it.
    In the Export Dialog under <Image Sizing> select Widdth & Height.
    Then enter 750 pixels for Height.
    Put your cursor into the Width field behind all the numbers that appear there and with the backspace key delete the numbers. If you enter "0" it will not accept that. But it accepts when you just delete the field for Width with the backspace key. The Width field will now be just blank.
    When you then export all image will  have a height of 750 pixels and the width will fall variously according to thne height / width ratio.
    Or alternatively you can enter 7.5" for height at a resolution of 100 ppi.

  • How can I load a .pst file to an instrument in logic express 9?

    I have some instruments plug-in settings from my old computer that I used with logic, and I want to load them into logic so I can use them on the computer I moved them to. On any instrument I try (ES1, ES2, EXS24 and the rest) it won't allow me to load the files (.pst files) and I know I should be able to. Am I just going about it wrong or using the wrong instrument? How can I load these files so that I can use the instruments again?

    Pages is not in a format compatible for what you want to do.
    After you save a a Pages document, go to File > Export > and choose either Word or Pdf format. You can also choose RTF or PlainText too. Then you can email to yourself or others.
    Good Luck.
    Adam

  • How can I create a java.awt.Image from ...

    Hi all,
    How can I create a java.awt.Image from a drawing on a JPanel?
    Thanks.

    JPanel p;
    BufferedImage image =
        new BufferedImage(p.getWidth(), p.getHeight, BufferedImage.TYPE_INT_RGB);
    Graphics2D g = image.createGraphics();
    p.paint(g);
    g.dispose();

  • How can I create a high res image gallery, need to have print res photos for a pressroom section.

    How can I create a high res image gallery, need to have print res photos for a pressroom section.

    If you want Muse to "pass through" your images and not adjust, compress, crop etc - you need to place your images in the lightbox EXACTLY at the right size, pre-cropped and prepped in Photoshop.
    So if your light box is 800x600 the image you're dropping into that must be 800x600 exactly with no effects, rotation etc added to the lightbox frame. This stop Muse fiddling with your images, if they are perfect when inserted and you're not asking Muse to crop, expand, add effects etc. If it's perfect when inserted, Muse SHOULD also leave the resolution alone too, but I have not tried that one, but in theory, it should work.

  • How can I use some of the image i am working on to paint with? like if I wanted to give someone an extra eye in the forehead, ow could i then paint their own i in the forehead? I know there is a paint tool for that, i just can't find it ... :/

    How can I use some of the image i am working on to paint with? like if I wanted to give someone an extra eye in the forehead, ow could i then paint their own i in the forehead? I know there is a paint tool for that, i just can't find it ... :/

    It sounds like you are talking about the cloning tool?
    Tool looks like this:
    Then when selected you can change the size of the brush and using Alt (windows) and Command (Mac) to select your region you want to copy then start to create you cloned image.
    Hope this helps?

  • How can I load data into table with SQL*LOADER

    how can I load data into table with SQL*LOADER
    when column data length more than 255 bytes?
    when column exceed 255 ,data can not be insert into table by SQL*LOADER
    CREATE TABLE A (
    A VARCHAR2 ( 10 ) ,
    B VARCHAR2 ( 10 ) ,
    C VARCHAR2 ( 10 ) ,
    E VARCHAR2 ( 2000 ) );
    control file:
    load data
    append into table A
    fields terminated by X'09'
    (A , B , C , E )
    SQL*LOADER command:
    sqlldr test/test control=A_ctl.txt data=A.xls log=b.log
    datafile:
    column E is more than 255bytes
    1     1     1     1234567------(more than 255bytes)
    1     1     1     1234567------(more than 255bytes)
    1     1     1     1234567------(more than 255bytes)
    1     1     1     1234567------(more than 255bytes)
    1     1     1     1234567------(more than 255bytes)
    1     1     1     1234567------(more than 255bytes)
    1     1     1     1234567------(more than 255bytes)
    1     1     1     1234567------(more than 255bytes)

    Check this out.
    http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96652/ch06.htm#1006961

  • How can i change the title and image of  published exe

    Hi ,
    I have published a fla file in exe format .
    how can i change the title and image of this exe? do I ve to
    use some of the available softwares in the market? cant i do the
    customised setting in the flash player itself?

    On Fri, 4 Apr 2008 06:21:15 +0000 (UTC), "mFlexDev"
    <[email protected]> wrote:
    > I have published a fla file in exe format .
    > how can i change the title and image of this exe?
    I beleave the easiest way is to use PEResourceExplorer,
    Resource
    Hacker or similar software to modify EXE resources, such as
    window
    title and window icon.

  • How can i load Client side XML file to Table

    Hi,
    How can i load the all the XML files (near 10,000 files) available in client machine to the XML table .
    I did try with directrory list in the Webutility demo form, but when the number of file is near to 1,500 its giving error.
    Please suggest the best method to implement my requirements.
    1. XML fies are in a folder in end users machine(Windows OS)
    2. I need to load all the XML files to table (Oracle Database is in Unix)
    I am using forms 10g
    Thanks in advance.
    Rizly

    Hi,
    What is the error you are getting when you reach 1,500 records? Can you post it? You mentioned you are using the webutil to load them. How you are loading? From the client machine you are loading to the database directly? Can you post the code you are using for that?
    -Arun

Maybe you are looking for

  • VMS Client Channel Buffering Problem

    I just received my new Verizon VMS system which includes 2 client units.  I hooked everything up and all was working as it should except that when watching live TV on the two client units, it will not buffer two different TV channels and allow me to

  • #1  i'm having trouble installing acrobat 9 pro in a macbook pro.  #2 how to convert to searchable d

    #1  i'm having trouble installing acrobat 9 pro in a macbook pro.  #2 how to convert to a scan to a searchable and cut/paste doc.?

  • Embedded fonts do not display (-) in text

    Hi all, I have embedded few fonts in my project. Some of them do not display - in text. Those fonts also fails in winword, word is also not able to transcode - in those fonts. In word it shows that block instead of -. Any idea how to display - for th

  • How to map a cube to a non-leaf dimension level?

    Hi, I'm using AWM 11.2.0.1.0 and Oracle 11.2.0.2.0 on a CentOS 5.4 64-bit system. I have a time dimension with levels Year, Month, Day, Hour, Half-Hour and several cubes mapping to the Half-Hour level. Now I'm trying to populate a cube using a time h

  • Logging info about user, when deleting user from IDM

    Hi, I would like to be able create a report showing deleted users the last month. The problem is that I also need to fetch the user fullname, and some other IDM attributes as additional columns. This is not supported with a standard audit log report.