Datasource, POJO and java.sql.Blob

Hello,
is "java.sql.Blob" a valid type for a POJO datasource ?
I declared one but I just dit not succeed in rendering its jpg picture.
My java code is quite simple :
ReportClientDocument reportClientDocument = new ReportClientDocument ();
reportClientDocument.setReportAppServer(ReportClientDocument.inprocConnectionString);
reportClientDocument.open (REPORT_NAME, OpenReportOptions._openAsReadOnly);
// lBlob is a class which implements java.sql.Blob interface
LPOJOData [] dataP = {new LPOJOData(new lBlob("Picture.jpg"))};
POJOResultSetFactory factory = new POJOResultSetFactory(LPOJOData.class);
POJOResultSet resultSet = factory.createResultSet(dataP);
reportClientDocument.getDatabaseController().setDataSource(resultSet, "", "");
and my POJO class :
public class LPOJOData {          
          private java.sql.Blob zimage;
          public LPOJOData(java.sql.Blob zp){
               this.zimage = zp;
          public java.sql.Blob getzimage(){
               return zimage;
The field "zimage" on the report is designed through a "field definition only" database, zimage is defined as a Blob field.
Any clues ?
Regards,
Serge

I have just found a list of the data types supported by a POJO Class :
# boolean
# byte
# char
# double
# float
# int
# short
# java.lang.Boolean
# java.lang.Byte
# java.lang.Double
# java.lang.Float
# java.lang.Integer
# java.lang.Short
# java.lang.String
# java.SQL.Date
# java.SQL.Time
Well, java.SQL.Blob is not one of them.
Is java.SQL_Blob will be a valid POJO type in the future ?
Is there another way than POJO to feed a report from an in-memory datasource ?

Similar Messages

  • Get canvas.toDataURL('image/jpeg') and convert base64 encoding to java.sql.Blob

    Convert canvas.toDataURL('image/jpeg') to java.sql.Blob.
    I am using oracle adf so I am able to action a backing bean from javascript and pass in parameters as a map. I pass in the canvas.toDataURL('image/jpeg') which I then try to decode in my bean. Using BASE64Decoder and the converting the bytearray to a file I can see the image is corrupted as I can't open the file thus converting the bytearray to blob is also a waste.
    Has anyone any ideas on base64 encoding from canvas.toDataURL to file or Blob?

    Use Case:
    A jsf page that enables a user to take photos using the HTML5 canvas feature - interact with webcam -, take photos and upload to profile
    1. I have created the jsf page with the javascript below; this pops up as a dialog and works okay and onclick an upload image, triggers the snapImage javascript function below and sends the imgURL parameter to the serverside managedbean
    <!-- java script-->
    function snapImage(event){
                    var canvas = AdfPage.PAGE.findComponent('canvas');
                    AdfCustomEvent.queue(event.getSource(),"getCamImage",{imgURL:canvas.toDataURL('image/jpeg'),true);
                    event.cancel();
    <!-- bean -->
    public void getCamImage(ClientEvent ce){
    String url=(String)ce.getAttributes().get("imgURL");
    decodeBase64URLToBlob(url);
    private BlobDomain decodeBaseB4URLToBlob(String url64){
                    BASE64Decoder de=new BASE64Decoder();
                    byte[] bytes=de.decode(url64);
                    File file=new File("abc.jpg");
                    InputStream in = new ByteArrayInputStream(bytes);
                    BufferedImage bImageFromConvert = ImageIO.read(in);
                    in.close();
                    ImageIO.write(bImageFromConvert, "jpg", file);
                    return createBlobDomainFromFile(file);
    ----problem---
    Accessing the generated jpeg file shows the image is corrupted, probably missing bytes or encode/decoder issues.and the blob image after uploading to database is saved as a binary stream which ondownload doesnt render as an image or anything i know of.
    Is there anyways of achieving the conversion without errors?

  • Creating/constructing a java.sql.Blob and writing to Oracle with jdbc

    I'm trying to understand how to create a blob from an image file to write it to a Oracle database using jdbc.
    I know there'a a getBinaryStream method in java.sql.Blob to which I can write the files byte array, but how do I create an actual blob in the first place. All examples I've seen initialise the blob from an exiting Blob field in a database which I do not have filled yet
    thanks

    In general, you will do something like the following:
    Ensure setAutoCommit is false
    INSERT INTO foo (blob_column) values (empty_blob());
    SELECT blob_column FROM foo FOR UPDATE;
    Call getBlob() on the ResultSet
    Cast it to Oracle's specific BLOB (different object)
    Call getBinaryOutputStream() on the BLOB
    Pipe your data
    Commit (very importatnt as FOR UPDATE will lock that row)- Saish

  • Java.sql.Blob method setBinaryStream?

    Hi,
    I've been trying to use the java.sql.Blob methods instead of the "Oracle Extensions" so that people w/o Oracle (using MySQL etc.) can still use my code.
    Problem: trying to get the OutputStream to write to the Blob. As of JDK1.4, java.sql.Blob has a method to do this, setBinaryStream. Unfortunately, calling this in Oracle JDBC (tried it in both thin and OCI version) throws an SQLException (Unsupported feature).
    Sample code:
    //Assume we already have a connection to the database, over either OCI or thin.
    //Assume a Statement stmt created from the connection.
    //Assume a table BlobTable with 2 fields : id (number) and data (blob).
    public void uploadBlob(byte [] theBytes){
         try{
         stmt.executeUpdate("INSERT INTO BlobTable (id, data) VALUES (1,empty_blob())");
         ResultSet rs = stmt.executeQuery("SELECT data FROM BlobTable WHERE id=1 FOR UPDATE");
         if (rs.next()){
    java.sql.Blob blob=rs.getBlob(1);
         OutputStream out=blob.setBinaryStream(0);
         //Next line never printed - error thrown.
         System.out.println("Got Stream");
         catch(Exception e){e.printStackTrace();}
    //End code
    Am I doing something wrong? Or is there simply no way to write to a Blob without using the extensions?
    None of the docs (examples, guides, etc) make any mention of this, although the JDBC dev guide does mention that the similar method in PreparedStmt only works over OCI.
    Thanks,
    Dan

    Hi lancea,
    It's been a while since this thread was active, but I have a related question.
    Is there a comprehensive list of changes between JDBC 3 and JDBC 4 that makes application not work any more, such as this setBinaryStream issue or the CallableStatement/Named parameters issue that we stumbled upon. We would like to address these issues proactively and not find out about them in production, since we're upgrading from jdk1.4 to jdk6. Oracle has provided us with their changes regarding database versions, but have been less forthcoming with JDBC spec version changes.
    Thanks in advance,
    Thomas Auzinger

  • Store a uploaded file of type binary into a java.sql.Blob

    Hi all,
    I try a File-Upload and store the file in a  java.sql.Blob of a MaxDB.
    My Problem is, that I'm not able to import a Model-Attribute of data type byte[]. Further I don't no how to convert the uploaded value attribute of data type binary, in a java.sql.Blob.
    Regards,
    Silvia Hofmann

    http://www.excelsior-usa.com/jet.html
    http://www.ej-technologies.com/products/exe4j/overview.html
    http://jsmooth.sourceforge.net/
    Distributing your Application as an executable JAR file
    Google is your friend.

  • What is the diffrence between package javax.sql and java.sql

    Is javax designed for J2EE?
    And when to use package javax?

    Hi,
    What is the diffrence between package javax.sql and java.sql?The JDBC 2.0 & above API is comprised of two packages:
    1.The java.sql package and
    2.The javax.sql package.
    java.sql provides features mostly related to client
    side database functionalities where as the javax.sql
    package, which adds server-side capabilities.
    You automatically get both packages when you download the JavaTM 2 Platform, Standard Edition, Version 1.4 (J2SETM) or the JavaTM 2, Platform Enterprise Edition, Version 1.3 (J2EETM).
    For further information on this please visit our website at http://java.sun.com/j2se/1.3/docs/guide/jdbc/index.html
    Hope this helps.
    Good Luck.
    Gayam.Srinivasa Reddy
    Developer Technical Support
    Sun Micro Systems
    http://www.sun.com/developers/support/

  • Java.util.Date and java.sql.Date

    when i am trying to displaying date in my jsp page errors occurs saying that java.util.date and java.sql.date are matching..
    i have some sql statements which i need to execute in the page.so i cant delete that import sql statement.
    so what is the solution for this.
    i want to display the date as 19th april 2003....in the jsp page.
    thank u

    You should use full names.
    java.util.Date date;
    java.sql.Date sdate;
    ..And it may be a good idea to delete one of the two "import" declaration of packages.

  • Conversions between java.util.Date, java.util.Timestamp and java.sql dates

    I am coding a hoilday booking system using JSP to interact with a SQL Server database. On my JSP form which retrieves the information I have a little javascript pop-up date selector which appears to be returning a Timestamp value although the string value is visable in the entry field. Can I pass this to a javabean as a Timestamp, so far I have only passed strings? Also I then have to enter it in the database and so will need to convert it to an sql date type but I dont know which one is best. Previous to using the Timestamp returning calendar I was just entering text and parsing it to a util.Date in the bean and then converting that to an sql.Date for entry in the database. That worked fine but I want to use the pop-up any ideas? Also my bean won't compile if I declare java.util.Timestamp t;(cannot resolve symbol Timestamp !) even though I have imported util.

    First of all, java.util.Timestamp does not exist. You probably need java.sql.Timestamp.
    java.sql.Date and java.sql.Timestamp inherit from java.util.Date. So converting from java.sql.Date or java.sql.Timestamp to java.util.Date is easy, you don't have to do anything.
    To convert a java.util.Date to a java.sql.Timestamp, do something like this:
    import java.sql.Timestamp;
    import java.util.Date;
    Date date = new Date();
    Timestamp ts = new Timestamp(date.getTime());Jesper

  • Java, access database( mdb) and java.sql.date

    I having a problem querying my access database with user specified date the code is as follows
    //get results of income from database with respectto dates
         //so u first create the sql.date instances
         private void getResults(){
         String text1=from.getText();//text input is like this 01-01-2005
              String text2=to.getText();
         Date d1=new Date(Integer.parseInt(text1.substring(6)),Integer.parseInt(text1.substring(3,5)),Integer.parseInt(text1.substring(0,2)));
         JOptionPane.showMessageDialog(this,d1.toString());//traces date with 1900 added to year and 1 added to month
         try{
              //custom class DataSource used to connect to database
              Connection conn=DataSource.getConnection("RealFotoInc");
              PreparedStatement ps=conn.prepareStatement("select * from Members where date=?");
              ps.setDate(1,d1);
              ResultSet rs=ps.executeQuery();
              while(rs.next()){
                   System.out.println("going");
                   System.out.println("trial"+rs.getString(3));
         }catch(Exception se){
              JOptionPane.showMessageDialog(this,se);
         }and it prints out nothing I dont know what is wrong

    Whoever put that comment in there about "1900" and so on knew what had to be done. That "Date" class must be "java.sql.Date"; go and read the API documentation of that constructor you are using there. Then adjust the parameters you are passing to it accordingly.

  • A silly question about oracle.sql.timestamp and java.sql.timestamp

    Hi,
    I'm looking at a method that takes objects of type Object and does stuff if the object is really a java.sql.timestamp. If it is not then an error is flagged. In my case it flags an error when an object of type oracle.sql.timestamp is passed to it. Not really entirely comfortable with java (i'm still learning it), here's my stupid question :- why isn't oracle.sql.timestamp a subclass of java.sql.timestamp? Also in various books it indicates that java.sql.timestamp maps to oracle.sql.timestamp. Does that mean you have to physically do the mapping:
    i.e.
    java.sql.Timestamp t = new Timestamp( new oracle.sql.Timestamp( CURRENTTIMESTAMP ).timestampValue() );
    or is there something else to it.
    Thanks.
    Harold.

    The best forum for this is probably Forum Home » Java » SQLJ/JDBC
    Presumably you are refering to oracle.sql.TIMESTAMP. While this is intended to (and does) correspond to java.sql.Timestamp it can't be a subclass because it needs to be a subclass of oracle.sql.Datum.

  • RQL Error - JQuery Datepicker and java.sql.Timestamp

    Hello everyone,
    I am using JQuery Datepicker to select start and end date range.
    Both start date and end date are successfully passed as like this. 10/01/2013 and 10/31/2013
    It has java.sql.Timestamp mapping in both startDate and endDate.
    Property name in component browser is transactionTimestamp.
    It gives me following error when i passed both parameters.
    <dsp:droplet name="/atg/dynamo/droplet/RQLQueryForEach">
        <dsp:param name="repository" value="/atg/commerce/order/OrderRepository" />
        <dsp:param name="itemDescriptor" value="inStorePaymentStatus" />
        <dsp:param name="queryRQL" value="transactionTimestamp>=:startDate AND transactionTimestamp<:endDate" />
    **** Error    Wed Oct 02 16:07:21 IST 2013    1380710241490    /atg/dynamo/droplet/RQLQueryForEach    unable to parse/execute query due to RepositoryException    CONTAINER:atg.repository.RepositoryException; SOURCE:java.sql.SQLException: java.sql.SQLDataException: ORA-01843: not a valid month
    It gives NO error when i passed single parameter.
      <dsp:param name="queryRQL" value="transactionTimestamp>=:startDate"/>
    can anyone suggest me a solution.
    Thanks
    saminda konkaduwa

    Hi all,
    Found the solution. We have to use parameter converter tools as well. that is the additional parameter called "date" where we passed date format.
    <dsp:param name="startDate" param="10/12/2012" date="MM/dd/yyyy"/>
    <dsp:param name="endDate" param="10/12/2015" date="MM/dd/yyyy"/>
    Explanation :
    JSP FILE ( testing.jsp)
    =================
    <dsp:page>
    <head>
    <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
    <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
    <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
    <script type="text/javascript" src="merchant_portal_ajax_agent_report.js"></script>
    <script type="text/javascript">
        $(function() {
            $("#startDate").datepicker();
        $(function() {
            $("#endDate").datepicker();
    </script>
    </head>
    <body>
    <table>
                        <tr>
                            <td>Start Date</td>
                            <td><input type="text" id="startDate" class="picker" name="sDate" /></td>
                            <td>End Date</td>
                            <td><input type="text" id="endDate" class="picker" name="sDate" /></td>
                            <td><input value="Find" type="submit" class="atg_button" onclick="loadAgentReport()" /></td>                       
                        </tr>
                        <tr>
                                    <div id="agentReportTable"></div>
                        </tr>
    </table>
    </body>
    </dsp:page>
    JAVA SCRIPT FILE (merchant_portal_ajax_agent_report.js)
    ============================================
    function loadAgentReport() {
        var startDateValue = $("#startDate").val();
        var endDateValue = $("#endDate").val();
            $(document).ready(function() {
              $.ajax({
                    type : "POST",
                    url : "merchant_portal_view_agent_report.jsp",
                    data : {
                       startDate : "" + startDateValue + "" , endDate : "" + endDateValue + ""
                    success : function(result) {
                        $("#agentReportTable").html("");
                        $("#agentReportTable").html(result);
    JSP File ( This invoked by Jquery ) merchant_portal_view_agent_report.jsp
    =======================================================
    <dsp:page>
                                <dsp:droplet name="/atg/dynamo/droplet/RQLQueryForEach">
                                    <dsp:param name="repository" value="/atg/commerce/order/OrderRepository" />
                                    <dsp:param name="itemDescriptor" value="inStorePaymentStatus" />
                                    <dsp:param name="queryRQL" value="agentId=:agentId AND transactionTimestamp>:startDate AND transactionTimestamp<:endDate" />
                                    <dsp:oparam name="output">
                                       <dsp:valueof param="element.transactionId"/>  <dsp:valueof param="element.transactionStatus"/>
        </br> 
                                    </dsp:oparam>
                                    <dsp:oparam name="empty">
                                             No data found
                                   </dsp:oparam>
                               </dsp:droplet>
    </dsp:page>
    Thanks
    saminda konkaduwa

  • Oracle, Serializable and java.sql.SQLException

    I'm reading in the weblogic documentation about serializable transactions
    and Oracle at:
    http://www.weblogic.com/docs51/classdocs/API_ejb/EJB_environment.html
    I've excerpted below the section of interest. Essentially it says that if
    you want to use an isolation level of SERIALIZABLE with Oracle,
    you must be prepared to catch and retry transactions which fail due
    to the "can't serialize access for this transaction". What I don't understand,
    is where do I catch this exception. The doc below suggests that it
    is in the EJB client code. By this, I assume it should be caught
    by any client calling into an EJB method which is starting a transaction.
    What I don't understand is I didn't think that ejb methods threw a
    java.sql.SQLException. How can I catch this exception? The
    exception is caused at commit time, which I don't have any
    direct control over since I am using CMP.
    Do I then need to inspect the exception text for the string:
    "ORA-08177: can't serialize access for this transaction", in order
    to determine whether to retry the transaction?
    Is there any sample code for this. I just need to know where
    the exception should be caught in my code, and how to
    inspect the exception (scanning text based error messages
    sounds problematic, since the exact message text might
    change over versions of the database and deployment, etc.).
    I am planning on using CMP, so I am not making any
    jdbc calls directly.
    Jason
    Special note for Oracle Databases
    Keep in mind that Oracle uses optimistic concurrency. As a consequence, even with a setting of TRANSACTION_SERIALIZABLE, Oracle does
    not detect serialization problems until commit time. The message returned is:
    java.sql.SQLException: ORA-08177: can't serialize access for this transaction
    Even if you use the TRANSACTION_SERIALIZABLE setting for an EJB, you may receive exceptions or rollbacks in the EJB client if
    contention occurs between clients for the same rows. To avoid these problems, you must ensure that clients catch and examine the SQL
    exceptions, and take appropriate action, such as restarting the transaction.
    Jason Rosenberg
    SquareTrade
    (remove 'nospam' from my return address)

    I'm reading in the weblogic documentation about serializable transactions
    and Oracle at:
    http://www.weblogic.com/docs51/classdocs/API_ejb/EJB_environment.html
    I've excerpted below the section of interest. Essentially it says that if
    you want to use an isolation level of SERIALIZABLE with Oracle,
    you must be prepared to catch and retry transactions which fail due
    to the "can't serialize access for this transaction". What I don't understand,
    is where do I catch this exception. The doc below suggests that it
    is in the EJB client code. By this, I assume it should be caught
    by any client calling into an EJB method which is starting a transaction.
    What I don't understand is I didn't think that ejb methods threw a
    java.sql.SQLException. How can I catch this exception? The
    exception is caused at commit time, which I don't have any
    direct control over since I am using CMP.
    Do I then need to inspect the exception text for the string:
    "ORA-08177: can't serialize access for this transaction", in order
    to determine whether to retry the transaction?
    Is there any sample code for this. I just need to know where
    the exception should be caught in my code, and how to
    inspect the exception (scanning text based error messages
    sounds problematic, since the exact message text might
    change over versions of the database and deployment, etc.).
    I am planning on using CMP, so I am not making any
    jdbc calls directly.
    Jason
    Special note for Oracle Databases
    Keep in mind that Oracle uses optimistic concurrency. As a consequence, even with a setting of TRANSACTION_SERIALIZABLE, Oracle does
    not detect serialization problems until commit time. The message returned is:
    java.sql.SQLException: ORA-08177: can't serialize access for this transaction
    Even if you use the TRANSACTION_SERIALIZABLE setting for an EJB, you may receive exceptions or rollbacks in the EJB client if
    contention occurs between clients for the same rows. To avoid these problems, you must ensure that clients catch and examine the SQL
    exceptions, and take appropriate action, such as restarting the transaction.
    Jason Rosenberg
    SquareTrade
    (remove 'nospam' from my return address)

  • EJBQL, MIN and java.sql.Timestamp

    I am trying to create a new finder method for a cmp bean which returns me the date of the oldest bean available.
    the ejbql query looks like this:
    select MIN (a.receiveDate) from AssetSchema as a
    receiveDate is defined as a java.sql.Timestamp field in the bean. I am getting the following error:
    Bean: Asset
    Method: clover.AssetLocal findOldestDeleted()
    EJBQL: select MIN (a.receiveDate) from AssetSchema as a
    Error: JDO75334: Invalid type 'java.sql.Timestamp' of select clause expression for finder method.
    anything wrong with the query or .....

    Instead of using a finder, use an ejbSelect method. You can then use the aggregate function MIN. Wrap the ejbSelect in a home method.
    In remote Home interface, define home method:
    public java.lang.String selectMinSingle() throws RemoteException;
    define the ejbSelect method in EJB class:
    public abstract java.lang.String ejbSelectMinSingle() throws FinderException;
    The ejbSelect is wrapped in a ejbHome method:
    public java.lang.String ejbHomeSelectMinSingle()
    try {
    String s = ejbSelectMinSingle();
    return s;
    } catch(Exception e) {
    throw new EJBException("ejbHomeSelectMinSingle: " + e);
    Call home method from client:
    String s1 = beanHome.selectMinSingle();
    Not sure if this is what you're looking to do.
    There is also the ORDER BY clause; i.e.,
    <ejb-ql>Select p.quantity from ProductBean p ORDER BY p.quantity</ejb-ql>
    use the ASC or DESC keyword:
    <ejb-ql>Select p.quantity from ProductBean p ORDER BY p.quantity ASC</ejb-ql>
    For finder:
    query>
    <description></description>
    <query-method>
    <method-name>findProductsByHighestQuantity</method-name>
    <method-params />
    </query-method>
    <ejb-ql>Select DISTINCT OBJECT(p) From ProductBean p ORDER BY p.quantity DESC</ejb-ql>

  • Ejb-ql and java.sql.Timestamp object

    Hi, I have a mySql database table that has a column containing a Timestamp object. I need a finder method for my ejb's that will allow me to query the table for rows between certain dates.
    In other words, I need to query for entries that have a Timestamp object between 2 specified dates.
    One solution is to change the column type from Timestamp to long (date in milliseconds). That way I can use the BETWEEN clause to search between 2 longs. I would rather not do that. Does anyone know of a way that I can search between 2 Timestamp objects?

    You can use the SQL BETWEEN clause with dates, just use it like this:
    WHERE OrderDate BETWEEN '1998/5/1' AND '1998/5/31'

  • Make java.sql.Blob object from java serialized object

    I have an ImageIcon which I get from an applet. It gets passed to a servlet. Now, I want to turn the ImageIcon into a blob object so that I can insert it into a database (as/400). How do I do that?

    Hi there,
    NORMALLY this is a 2-step process:
    1.) Convert the ImageIcon into a byte-array
    2.) Write the byte-array into the database/blob
    For step 1 (this code is 'freehand'):
    =====================================
    ByteArrayOutputStream bos = new ByteArrayOutputStream();
    ObjectOutputStream oos = new ObjectOutputStream(bos);
    oos.write(myImageIcon);
    oos.close();
    byte[] data = bos.getBytes();
    For step 2:
    ============
    This is often database specific, but normally you select a column of a record for update, get the blob-object from the resultset and start writing bytes to it.
    BUTTTTTTTT Consider this alternate approach: Assuming the image that is being sent is always small in size, you may simply chose to base-64 encode it and store the resultant string in a varchar column. When you read it back, base-64 decode it. Although the encoding/decoding may appear to be an overhead, I'll bet you it's much faster than blob-level access, both for reads and writes. It's also portable (code-wise) and you can update images through a simple UPDATE statement. In fact, if your database supports it, you could even have a default value for the column (a default image)...

Maybe you are looking for

  • Itunes Library that I swapped in after switching to new PC is out of date, missing ~3 months of added music

    Hi, I just got a new PC laptop (replacing a dying one) and transferred my Itunes library to its C drive from an external drive, and copied the Itunes Library folder over as well so that I wouldn't have to recreate playlists (and, more importantly, re

  • Sunray 5.2 Kiosk mode - Creation of Submenu's?

    Hi folks, Looking for a solution to a problem we have encountered. Looking to create our own menu structure on our thin client kiosk sessions. At the moment, we are running Sun JDS3 on our sunrays, using an application list to run some programs. They

  • Help Needed Sony Monitor Cable Hookup

    I just received my Sony PVM 14-L2 monitor today for color correcting and need help with what cables I should use. I have a Canon Elura camcorder that I will be using as a deck. Please guide me on which ones I should use as I don't want to buy/use the

  • Inserting new condition Price on BAPI (BAPI_SALESORDER_SIMULATE)

    Goodnight everyone, need to run the bapi BAPI_SALESORDER_SIMULATE, indicating a new condition of payment (KDKGR) and I need after the performance, I return to the same new condition in the table of conditions (ORDER_CONDITION_EX). The problem is I do

  • MRP - source list!!

    Hi All, I have two vendors in the source list. I have fixed the second vendor in the source list. When I run the MRP for the material the system assigns the first vendor to the PR and not the second vendor which is fixed!! This is something strange.