Nested Remoted Objects

When using Remote Objects, I'm successfully using AMF to
transfer PHP Objects.
I have an ArrayCollection that forces the
"com.gh.vo.ContactMainViewVO" type - Works great.
My problem is when I try go another level deeper and type an
array inside of that object, it only types it as an object and not
the [ArrayElementType("com.gh.vo.ContactPhoneNumber")].
Is it possible to do this?
[Bindable]
[ArrayElementType("com.gh.vo.ContactMainViewVO")]
private var _contactsMainView:ArrayCollection;
package com.gh.vo {
import com.gh.vo.*;
import flash.net.registerClassAlias;
import mx.collections.ArrayCollection;
[RemoteClass(alias="ContactMainViewVO")]
[Bindable]
public class ContactMainViewVO {
public var contactId:int;
public var firstName:String;
public var lastName:String;
public var title:String;
public var companyName:String;
public var emailAddress:String;
[ArrayElementType("com.gh.vo.ContactPhoneNumber")]
public var phoneNumbers:Array;
package com.gh.vo {
import com.gh.vo.*;
import flash.net.registerClassAlias;
[RemoteClass(alias="ContactPhoneNumberVO")]
[Bindable]
public class ContactPhoneNumberVO {
public var contactPhoneNubmerId:int;
public var contactId:int;
public var phoneNumer:String;
public var phoneNumberType:String;
public var primaryNumber:int;

UPDATE:
I've worked around the problem by using the following (after
correcting some spelling errors *nubmer):
[ArrayElementType("com.gh.vo.ContactPhoneNumber")]
public var phoneNumbers:Array;
[ArrayElementType("com.gh.vo.ContactPhoneNumber")]
private var _phoneNumbers:ArrayCollection;
public function get phoneNumbers():ArrayCollection {
return _phoneNumbers;
public function set phoneNumbers( phoneNumbers:* ):void {
var ac:ArrayCollection = new ArrayCollection();
for each( var pNum:ContactPhoneNumberVO in phoneNumbers ) {
ac.addItem( pNum );
_phoneNumbers = ac;
------------------------------------------------------------

Similar Messages

  • Exporting two remote objects on the same port

    Hi,
    I would like to export two remote objects on the same host, same port and bind them with different service names.
    There is no problem when I do that from the same Java program.
    But when I export and bind an object from a Java program 1, I cannot do the same with the second (and similar) Java program 2. This is the stack trace of my Exception:
    java.rmi.server.ExportException: Port already in use: 50040; nested exception is:
         java.net.BindException: Address already in use: JVM_Bind
         at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:243)
         at sun.rmi.transport.tcp.TCPTransport.exportObject(TCPTransport.java:178)
         at sun.rmi.transport.tcp.TCPEndpoint.exportObject(TCPEndpoint.java:382)
         at sun.rmi.transport.LiveRef.exportObject(LiveRef.java:116)
         at sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:145)
         at sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:129)
         at java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.java:275)
         at java.rmi.server.UnicastRemoteObject.exportObject(UnicastRemoteObject.java:178)
         at java.rmi.server.UnicastRemoteObject.<init>(UnicastRemoteObject.java:75)Can some one help please

    It should work in any version of Java as long as the server socket factories are null or equal according to Object.equals() or its override in the SSF.equals() method if any. Which needs to be present and needs to take the form:
    public boolean equals(Object object)
      return object != null && object.getClass() == this.getClass();
    }with further tests if the server socket factories have additional state.

  • Communication Error with Host and Remote Object

    Hi,
    I was executing my RMI program in a Linux Grid Network environment and the communication was no problem and the code did work.
    However I have switched to the same code to another network with linux machines and when try to execute the code I get the Error:
    java.rmi.ConnectIOException: Exception creating connection to: 136.186.14.96; nested exception is: java.net.NoRouteToHostException: No route to host
    136.186.14.96 is the place where the registry is running and Server Object is bound
    Client Locate the Registry as below
    LocateRegistry.getRegistry("136.186.14.96",1099);
    ACTUAL CODE:
    +//Pass The Remote Reference+
    +try {+
    oClient.registry = LocateRegistry.getRegistry(oClient.o_RegistryReference,oClient.i_Port);
    oClient.server = (ART_Interface) oClient.registry.lookup("Server_Obj");
    oClient.server.clientRegister(oClient.i_ClientID, oClient);
    System.out.println("SEQUENCE <1>  Client [" iID + "] Request to Register");+
    +} catch (Exception e) {+
    System.out.println("Client [" oClient.i_ClientID + "]Registration Error: " + e);+
    +}+
    Client Code Execution....
    +#ART_CLIENT <HOST> <PORT> <Client ID> <slavesPerClient>+
    java -cp /home/research/mbcooray/network/mercury/GRID/ -Djava.rmi.server.codebase=file:/home/research/mbcooray/network/mercury/GRID/ -Djava.security.policy=/home/research/mbcooray/network/mercury/GRID/Policy.txt ART_Client 136.186.14.96 1099 0 1 &

    No for multiple instances of clients communicating (Reporting) to Server, wouldn't server have a dedicated port for them?No. A remote object is exported on port X, the client forms an inbound (from the server's point of view) connection to it, an accepted-socket is created, also on X. netstat -an will show you that: X LISTENING and zero or more X ESTABLISHED. A TCP connection consists of the tuple {TCP, client-address, client-port, server-address, server-port}. Here 'server-port' is X, 'client-port' is allocated by the system. So there can exist multiple inbound connections to X, and the server-port number is always X.
    For Call backs I guess JVM gets hold of a random free portFor all outbound connections, TCP gets hold of a random free port.
    as it is running on a separate thread (I assume)Threads have nothing to do with it.
    Is this done by using socketfactory? Forget it. You don't want to do this, for the reasons I have. You probably don't need to do it, and if you do need to do it you should shoot the netadmin instead.
    Yes, the server exports the object and binds it in the local registryThat's not the same thing as exporting it on port 1099. You can specify a port number when exporting, or when calling super() if your remote objects extend UnicastRemoteObject. If you are using LocateRegistry.createRegistry(), port 1099 will get reused automatically for all subsequently-exported remote objects unless you are using a socket factory, which you aren't. If you are using a separate Registry you should specify the export port number yourself, and you can't re-use 1099.
    The background to this is that firewalls often contain rule configurations about what remote port numbers may be connected to, which corresponds to the reality that Internet services have fixed port numbers, so you can decide e.g. to allow your users to connect to HTTP servers (80,443,8080,8443) and SSH (22) but not for example Telnet (23). However by symmetry they often also allow similar rules for outbound port numbers, which are completely useless as they do not correspond to any reality whatsoever. If you have a netadmin who is enforcing outbound port number rules, just tell him to stop it.

  • Remote object trying to return another remote object and a ClassCastExcepti

    I have a server running with a TreeModel (the tree model implements Remote). I also have the the TreeNodes all linked together on the server. Now, I can get to the TreeModel on the server and the root node of the remote tree model.
    treeModelStub = (treeModelIface)Naming.lookup(url+"remoteTM"); //works
    rootStub = (remoteTreeNodeIface)treeModelStub.getRoot(); //works. The call to getRoot returns Object
    But when I call
    remoteTreeNodeIface aChild = (remoteTreeNodeIface)rootStub.getChildAt(index) //Does not work. "Exception in thread "main" java.lang.ClassCastException
    at remoteTreeNode_Stub.getChildAt(Unknown Source)
    The remote tree node method getChildAt returns TreeNode because the class implements TreeNode:
    public class remoteTreeNode extends UnicastRemoteObject implements rdcaDataIface, Comparable, TreeNode {
    public TreeNode getChildAt(int idx) {
    System.out.println("DEBUG: class is "+this.getClass()); // class is remoteTreeNode
    return (remoteTreeNode)children.get(idx);
    The remote interface is defined as:
    public interface rdcaDataIface extends java.rmi.Remote {
    public TreeNode getChildAt(int idx) throws RemoteException;
    Any ideas why this does not work. Why can a remote object of type Object be returned just fine, but a TreeNode not be returned?
    Thank you for your help,
    Brent

    I have a server running with a TreeModel (the tree
    model implements Remote). I also have the the
    TreeNodes all linked together on the server. Now, I
    can get to the TreeModel on the server and the root
    node of the remote tree model.
    treeModelStub =
    (treeModelIface)Naming.lookup(url+"remoteTM");
    //works
    rootStub =
    (remoteTreeNodeIface)treeModelStub.getRoot();
    //works. The call to getRoot returns Object
    But when I call
    remoteTreeNodeIface aChild =
    (remoteTreeNodeIface)rootStub.getChildAt(index)******************************************
    can only be casted to rdcaDataIface. The returned object is an instanceof the rdcaDataIface_stub, which have nothing to do with TreeNode.
    //Does not work. "Exception in thread "main"
    java.lang.ClassCastException
    at remoteTreeNode_Stub.getChildAt(Unknown
    t(Unknown Source)
    The remote tree node method getChildAt returns
    TreeNode because the class implements TreeNode:
    public class remoteTreeNode extends
    UnicastRemoteObject implements rdcaDataIface,
    Comparable, TreeNode {
    public TreeNode getChildAt(int idx) {
    System.out.println("DEBUG: class is
    lass is "+this.getClass()); // class is
    remoteTreeNode
    return (remoteTreeNode)children.get(idx);
    The remote interface is defined as:
    public interface rdcaDataIface extends java.rmi.Remote
    public TreeNode getChildAt(int idx) throws
    ows RemoteException;
    Any ideas why this does not work. Why can a remote
    object of type Object be returned just fine, but a
    TreeNode not be returned?
    Thank you for your help,
    Brent

  • Remote Object - not able to get the returned value from java method

         Hi ,
    I am developing one sample flex aplication that connects to the java code and displays the returned value from the
    java method in flex client. Here I am able to invoke the java method but not able to collect the returned value.
    lastResult is giving null .  I am able to see the sysout messages in server console.
    I am using flex 3.2 and blazeds server  and java 1.5
    Here is the code what I have written.
    <?xml version="1.0" encoding="utf-8"?><mx:WindowedApplication  xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" backgroundColor="#FFFFFF" initialize="initApp()">
     <mx:Script><![CDATA[
    import mx.controls.Alert; 
    import mx.binding.utils.ChangeWatcher; 
    import mx.rpc.events.ResultEvent; 
    import mx.messaging.*; 
    import mx.messaging.channels.* 
    public function initApp():void { 
         var cs:ChannelSet = new ChannelSet(); 
         var customChannel:Channel = new AMFChannel("my-amf", "http://localhost:8400/blazeds/messagebroker/amf");     cs.addChannel(customChannel);
         remoteObj.channelSet = cs;
    public function writeToConsole():void {      remoteObj.writeToConsole(
    "hello from Flash client");
          var returnedVal:String = remoteObj.setName().lastResult;     Alert.show(returnedVal);
    //[Bindable] 
    // private var returnedVal:String; 
    ]]>
    </mx:Script>
    <mx:RemoteObject id="remoteObj" destination="sro" /> 
    <mx:Form width="437" height="281">
     <mx:FormItem>  
    </mx:FormItem>  
    <mx:Button label="Write To Server Console" click="writeToConsole()"/>
     </mx:Form>
     </mx:WindowedApplication>
    Java code
    public  
         public SimpleRemoteObject(){  
              super();     }
      class SimpleRemoteObject { 
         public void writeToConsole(String msg) {          System.out.println("SimpleRemoteObject.write: " + msg);     }
         public String setName(){          System.
    out.println("Name changed in Java"); 
              return "Name changed in Java";
    And I have configured destination in  remote-config.xml
    <destination id="sro">
       <properties>    
        <source>SimpleRemoteObject</source>
        <scope>application</scope>
       </properties>
      </destination>
    Please help me .

    You are not able to get the returned value because if you see the Remote object help you will realise you have to use result="resultfn()" and fault = "faultfn()"
    In this you define what you wish to do.
    More importantly in the remote object you need to define which method you wish to call using the method class like this
    <mx:RemoteObject id="remoteObj" destination="sro" result="r1" fault="f1"  >
         <Method name="javaMethodName" result="r2" fault="f2"/>
    <mx:RemoteObject>
    r2 is the function where you get the result back from java and can use it to send the alert.

  • Two remote objects calls on the same php class

    Hi to all,
           I've encountered a strange issue while developing with remote objects.
    I've a mxml component with an init() method inside which is called by a menu.
    When the init() method is called it makes 7 remote object calls which are bound to some components' dataprovider.
    Among this calls I've got 2 remote object which refer to the same remote class. This because I have to call the class twice and the bind the result to two different combobox. Below you find the code:
    <mx:RemoteObject id="myFile" source="myRemoteClass" destination="amfphp"  showBusyCursor="true" makeObjectsBindable="true" fault="traceFault(event)"/>
    <mx:RemoteObject id="myXls"  source="myRemoteClass" destination="amfphp"  showBusyCursor="true" makeObjectsBindable="true" fault="traceFault(event)"/>
    in the init function I make this calls:
    myFile.listDir("dir_1")
    myXls.listDir("dir_2")
    then in the mxml code I bound the result of myFile to combobox1 and the result of myXls on combobox2.
    The problem arise when I call the myXls' listDir method. When I call it I receive the following error:
    code:
    Client.Error.DeliveryInDoubt
    Message:
    Channel disconnected
    Detail:
    Channel disconnected before an acknowledgement was received
    The strange thing is that not only the myXls object returns this error, but also all the other 6 remote object return the same error above.
    I'm not sure, but I guess that the error could be caused by the two remote object which call the same php remote class. If I comment one of the two calls everything works fine.
    Do you have any suggestion about?
    Thanks!!
    Bye
    Luke

    Hi Jan.
    1) We have the 2 VO, each with 3 rows to fill in data. What I mean is that when i just fill in all the fields for the first row of the first VO, and the value of one of these fields is bigger than 50, then after the exception is thrown and the message is displayed, the fields for the first VO are duplicated and shown in the second VO as if the user had inserted them.
    2) We tried yesterday the validateEntity and a Method and Atributte Validator approaches after reading that white paper with the same results.
    The validation is correctly done using any of the those methods.
    I will try to reproduce this issue with the HR schema.
    Thanks in advance once again.

  • PL/SQL: ORA-04052: error occurred when looking up remote object.

    Hi All,
    I'm getting the following error message while executing a PL/SQL Block.
    PL/SQL: ORA-04052: error occurred when looking up remote object UPLDUSER.filestatushistory@FTS
    ORA-00604: error occurred at recursive SQL level 1
    ORA-03106: fatal two-task communication protocol error
    ORA-02063: preceding line from FTSStatement
    declare
    v_coun number;
    begin
    select count(*) into v_coun
    from updluser.filestatushistory@fts;
    end;Back ground of the situation as follows,
    My DataBase version 10.2.0.3 DB Name :DB1
    Table Owner : UPLDUSER
    Table Name : FILESTATUSHISTORY
    I have a report user on the same database and I have grant all on the above table to report user
    Report User : RPT_FTS
    SQL> GRANT ALL ON FILESTATUSHISTORY_V TO RPT_FTS;Now Please find the below database details where I'm getting subjected error.
    Database version : 9.2.0.8
    DB Name : DB2
    User Name : RPT_REPORTS
    I Have create a dblink from RPT_REPORTS to RPT_FTS on DB1 and the dblink works fine. But getting the above error while running it.
    but When I do the same other 10.2.0.3 db , the above PL/SQL block works fine without any problem.
    +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    Now the strange about this is that I have Created a new table on DB1 db like below;
    SQL> CREATE TABLE UPLDUSER.ABC AS SELECT * FROM FILESTATUSHISTORY;and retry my code on DB2 (9.2.0.8) after changing the table to ABC and it worked. Now I don't know whats wrong with a original table(FILESTATUSHISTORY).
    To over come the problem and a work-a-round method I create a view on the DB1 (RPT_FTS) like the below
    SQL> CREATE VIEW FILESTATUSHISTORY AS SELECT * FROM UPLDUSER.FILESTATUSHISTORY;and was able to run the PL/SQL block Remotely.
    Just wants To know what whould have been the cause for this .
    Cheers
    Kanchana

    Hi Kanchana,
    Perhaps following link of google search has answer to your query
    ORA-04052. The search result contains some useful articles whose URLs I shan't post in the forums.
    HTH!
    *009*

  • Trying to create a local instance of the remote object

    Hi,
    I have a ClassA on which I need to be able to invoke RMI calls. Problem is the interface which ClassA implements does not throw exceptions. To get around this problem I have created a wrapper class ClassWrap which has a ClassA attribute and calls made to ClassWrap are directed to this ClassA object. A facade type design I think it's called.
    ClassWrap implements Remote so it can be used as a Remote object.
    When I create an instance of ClassWrap and deploy it on a server, my client has no problem communicating with the remote ClassWrap object via a remote stub ClassWrap_Stub.
    Problem is I also want my client to be able to use a local instance of ClassWrap. Whan I try to create an instance of ClassWrap in my client I get a remote Exception ... but !! when I have a ClassWrap_Stub object in my classpath then there is no problem creating a ClassWrap object.
    Any ideas why this happens?

    What you are trying to do should work just fine. Do you have the wrapper class file in your client jar?

  • How does the remote object connect to the correct host

    i have had a small doubt on how the remote reference manages to find the correct host to call the subsequent methods after a sucessful lookup.
    given a rebind or bind to the registry, the registry only stores the alias and the remote reference, now imagine a client calling a lookup on the registry would only get the remote reference, and not in which machine the remote object is found.
    what i wanted to know is how does the client or atleast the remote reference returned by the registry correctly connects to the machine where the remote object is located. i dont think its stored in the stub bcos the stub is a complie time stuff.
    i would be pleased to have a comprehensive answer for this.

    The membership in the group communication framework is always accurate and upto date.Up to date to the moment when you check. Not up to date to the moment when you make the RMI call.
    i could basically chk if this ip is available in the membership list.Complete waste of time. It doesn't matter what you check ahead of time, you are still trying to predict the future.
    And you still have to deal with ConnectException etc from the actual remote method call. And the way you will deal with that in your situation is exactly the same as what you were going to do if your ahead-of-time check failed.
    So just catch the exception(s) and deal with the problem there.

  • Clustered Remote Object Bound To JNDI

    Hello,
              I'd like to know if Weblogic 5.1 (service pack 10) supports
              clusterable remote objects.
              What I am trying to do is to implement a remote object that extends
              UnicastRemoteObject interface and bind it to JNDI. When the client
              needs the services, it will lookup that object in JNDI and call its
              methods remotely.
              What happens to my test implementation is that it all works well when
              I run Weblogic locally, but if it is run on the remote server, it
              gives me the exception to the extend that the stub for my remote
              object is not found (although it is in the classpath). I understand
              that this is because I should be using weblogic.rmic instead of
              regular rmic, is that right?
              Thanks,
              Eugene Kononov.
              

    Hello,
              I'd like to know if Weblogic 5.1 (service pack 10) supports
              clusterable remote objects.
              What I am trying to do is to implement a remote object that extends
              UnicastRemoteObject interface and bind it to JNDI. When the client
              needs the services, it will lookup that object in JNDI and call its
              methods remotely.
              What happens to my test implementation is that it all works well when
              I run Weblogic locally, but if it is run on the remote server, it
              gives me the exception to the extend that the stub for my remote
              object is not found (although it is in the classpath). I understand
              that this is because I should be using weblogic.rmic instead of
              regular rmic, is that right?
              Thanks,
              Eugene Kononov.
              

  • Creating remote objects and passing the retrieved data to modules

    I found at this Adobe tutorial a nice "RemoteService" class that  creates a RemoteObject and contains the functions for handling the  result and fault events. If I wanted to use this approach, how could I  pass the data from the result handler to interfaces that modules from  the main application could use?
    I could put the RemoteService/RemoteObject in the modules, but (in my  opinion- and I could be wrong) the best design seems to be using the  remote calls in the main app and passing the data along to the modules.
    Ultimately, I would like to know what the "best practices" are for creating remote objects and passing the retrieved data to modules
    Thanks!

    public void mouseClicked(MouseEvent e) {
      X x = new X(e.getX(), e.getY());
    }I don't see the difficulty.

  • Weblogic 10.3.0 issues with remote object calls.

    All:
    I was wondering if anyone has experienced any issues with Weblogic 10.3.0 dropping initial remote object calls over AMF Secure Channel. Here are the issues we are experiencing.
    1.     FLEX applications fail consistently on the first remote object call made across the AMF Secure Channel. Resulting in the request not returning from the application server; which has had varying affects on the different applications including missing data, application freeze and general degrading of the user experience.
    2.     FLEX applications require a browser/application refresh once the application has been inactive for a certain period of time. In our experiences the behavior occurs after 30 minutes of inactivity.
    I've deployed this same code to Weblogic 10.3.3 and the behaviors go away. Are there any patches to 10.3.0 that might take care of this issue that we are not aware of?
    Thanks for you help,
    Mike

    Hello,
    I found the problem. But I needed change the target of all my datasources until discover that one of my datasource didn´t answer and no errors was trigged.
    My server was waiting this datasource, and not get started.

  • Breaking up data in a remote object

    Currently I have a chart that gets its data using a remote
    object connection. The chart currently shows a months worth of
    data. Now I need to break that monthly data into weekly data. The
    customer would rather have the data spread acroos four weekly
    charts instead of just one monthly chart. The customer would then
    just click click a 'Next' or 'Previous' button to cycle through the
    charts.
    I know that I just change the function (CFC) that calls for
    the data to only return a weeks worth of data, but I don't want to
    make a separate data call every time the user clicks 'Next' or
    'Previous'
    Is there a way to grab the whole month's data set and then
    divide it into weekly data sets within the app?

    Okay I figured this one out. If I add a hSlider with two
    thumbs I can set the thumbs with just a couple of functions.
    Basically when the user clicks either button a function is called
    that passes in a predetermined value of how many tick marks to
    move.
    The HSlider has a property called 'values' that holds the
    positions of all the thumbs. Using some simple functions they can
    easily be manipulated.
    Setting the slider's visible property to 'false' will keep
    the navigation focused on just the buttons.

  • File upload through BlazeDS remote object?

    Hi,
    After researching file upload options in flex, it seems like the only option is through HTTP service requests, such as:
    private var fileRef:FileReference;
    fileRef.upload(new URLRequest(FILE_UPLOAD_URL));
    Is there any way to use BlazeDS remote objects to upload a file from Flex interface? Perhaps passing in a FileReference object and marshalling it into an equivalent Java object?
    Thanks!

    I know there is a workaround like this. It uses a servlet to upload a file and returns a url. The uploaded file is either stored in session or server file system until the session expires. Use the PropertyProxy to register a custom class which contains this url and convert to java.io.File. It is the limitation of the player. It cannot read the local file system for security reason. There is a sample in blazeds/trunk/qa/apps/qa-regress/WEB-INF/src/blazeds/qa/remotingService/Echo.java
    static
    PropertyProxyRegistry registry = PropertyProxyRegistry.getRegistry();
    PropertyProxy proxy = registry.getProxy(java.io.File.class);
    if (proxy == null)
    registry.register(java.io.File.class, new FileProxy());
    proxy = registry.getProxy(FileReference.class);
    if (proxy == null)
    registry.register(FileReference.class, new FileReferenceProxy());
    Hope it can help

  • DBMS_SQL.PARSE to access remote objects

    I am using following code in a procedure ...
    DBMS_SQL.PARSE (cur, vSQL, DBMS_SQL.NATIVE);
    where variable vSQL can contain a remote object.
    A DB link (with Fixed User option) exists to access that database.
    The DB link is working. The remote object is accessible outside this procedure.
    When this command is executed, I get ...
    ORA-24374: define not done before fetch or execute and fetch
    ... error.
    Can DBMS_SQL handle remote objects?
    Oracle version is 9.2.0.5.0
    Any help would be greatly appreciated.

    Here is the code I am running ...
    CREATE OR REPLACE PROCEDURE p_sql_valid_or_not_cnt
    (vSQL IN VARCHAR2, vValid OUT NUMBER, vMessage OUT VARCHAR2, vCount OUT NUMBER) IS
    -- Purpose: Returns 0 in vvalid if SQL is valid, else returns -1. Returns row count when SQL is valid.
    -- Parameters:
    -- IN : vSQL
    -- OUT : vValid
    -- OUT : vMessage
    -- OUT : vCount
    cur INTEGER := DBMS_SQL.OPEN_CURSOR;
    fdbk INTEGER;
    BEGIN
    DBMS_SQL.PARSE (cur, vSQL, DBMS_SQL.NATIVE);
    fdbk := DBMS_SQL.EXECUTE (cur);
    vCount := 0;
    LOOP /* Fetch next row. Exit when done. */
    EXIT WHEN DBMS_SQL.FETCH_ROWS (cur) = 0;
    vCount := vCount + 1;
    END LOOP;
    vValid := 0;
    vMessage := 'No errors';
    DBMS_SQL.CLOSE_CURSOR (cur);
    END p_sql_valid_or_not_cnt;
    To run ...
    set serveroutput on
    declare
    i number;
    m varchar2(500);
    c number;
    begin
    p_sql_valid_or_not_cnt('SELECT * FROM TAB where 1 <> 1',i,m,c);
    DBMS_OUTPUT.PUT_LINE(i);
    DBMS_OUTPUT.PUT_LINE(m);
    DBMS_OUTPUT.PUT_LINE(c);
    end;
    This runs fine.
    But when I try to access an object from a remote server using DB link. I get the error ...
    set serveroutput on
    declare
    i number;
    m varchar2(500);
    c number;
    begin
    p_sql_valid_or_not_cnt('SELECT * FROM REMOTE_SCHEMA.T_REMOTE@REMOTE_SERVER where 1 <> 1',i,m,c);
    DBMS_OUTPUT.PUT_LINE(i);
    DBMS_OUTPUT.PUT_LINE(m);
    DBMS_OUTPUT.PUT_LINE(c);
    end;
    declare
    ERROR at line 1:
    ORA-24374: define not done before fetch or execute and fetch
    ORA-06512: at "SYS.DBMS_SYS_SQL", line 1125
    ORA-06512: at "SYS.DBMS_SQL", line 328
    ORA-06512: at "IMEPAS.P_SQL_VALID_OR_NOT_CNT", line 16
    ORA-06512: at line 6
    I can run the SQL that I am passing as vSQL directly in SQLPLUS ...
    This code in itself works.
    SELECT * FROM
    REMOTE_SCHEMA.T_REMOTE@REMOTE_SERVER
    where 1 <> 1;
    The user I am using to logon to my server is also there on REMOTE_SERVER.
    The DB LINK is created by CONNECTED USER option. The user on REMOTE_SERVER has explict select access on the table (not via role) I am accessing.
    Any help would be much appreciated.

Maybe you are looking for

  • How to stop syncing voice memos

    iTunes is driving me crazy because every time I sync my iPhone 5S 16GB it is importing my voice memos into my Library despite the fact that I have done the following: the "sync only checked songs and videos" box is checked the "include voice memos" b

  • Safari will not open; same with software update. Work on diff. user.

    I have OS X 10.4.9 installed, There are two users (I am the Admin user) and Safari will not open, it launches, then instantly crashes, same for software update, and widgets that connect to the internet. Firefox and IE, work fine, and Safari works on

  • Indesign CS2 Crashes when I try to export a document as pdf

    I'm using Indesign CS2 on a G5 using OS X version 10.4.11. As i try to export my document indesign completely crashes after I click the 'export' button in the pdf options window. I've tried saving using different pdf options and different document ty

  • Import Subtitle File (STL)

    Hi - I am trying to work out how to import a text subtitle file for use with DVD Studio Pro 4. I've been reading the manual and, from Page 456 it gave this example: $FontName = Arial $FontSize = 65 //The following subtitles are for scene one. 00:00:1

  • No sound or clicker

    Any reason why the ipod classic would play but have no sound.  I have read of others having this problem, what was the outcome?