Type casting with dblink?

Hi!
I want to use an functions result for both a call to local procedure and an remote procedure.
When I want to call an remote procedure, I must declare the (return)variable and return-signature
as "remote type", e.g. using @dblinkname
the function i write is of general purpose so I want to deploy it on local and remote site. I could deploy it locally using ...@dblinkname and remote without.
But I would like to use on version of the same code and not two, so I tried this:
codelines dbms_sql.varchar2s@DL_PROD.WORLD;
codelinesl dbms_sql.varchar2s;
codelinesl := f();
codelines := cast (codelines as dbms_sql.varchar2s@DL_PROD.WORLD);
and got pls-00220

the function i write is of general purpose so I want
to deploy it on local and remote site. I could deploy
it locally using ...@dblinkname and remote without.
But I would like to use on version of the same code
and not two,Why would the use of the function in the above example result into two versions?

Similar Messages

  • Type cast with String representation

    I have a hashtable full of Objects along with a String representation of their type. Is it possible to cast an Object back using a String representation of its type. ie
    String str = "helpme";
    String type = "String";
    str = (Object)str;
    now I want to get str back to String type but with using the variable type.

    Do not crosspost: http://forum.java.sun.com/thread.jsp?thread=355714&forum=4&message=1482427

  • Type cast with operator +=

    Hi,
    can somebody explain me, why the java compiler complains about a missing type cast (which is good) in
    int a = 0;
    double b = 1.3;
    a = a + b; // compiler error (missing type cast)but does not complain when using the += shorthand form?
    int a = 0;
    double b = 1.3;
    a += b; // works (!)Thanks,
    Michael

    Because the compound assignment operator has an implied cast.
    A compound assignment expression of the form E1 op= E2 is equivalent to E1 = (T)((E1) op (E2)), where T is the type of E1, except that E1 is evaluated only once.

  • TYPE casting with SQL Server 2005

    Hi,
    I recently migrated to SQL Server 2005 database from Oracle 10g. I used the %TYPE operator in Oracle to cast to the appropriate column data type.
    PROCEDURE INS_USER
                   i_USERNAME               IN USERS.USERNAME%TYPE,
                   i_PASSWORD               IN USERS.PASSWORD%TYPE,
    IS BEGIN
    How can I do this in SQL Server 2005? Is there any similar operator to %TYPE in SQL Server??

    i don't know !
    you can try a SQL server forum.

  • Type cast with string name

    I have a hashtable full of Objects. I also have there type represented by a String. How can I typecast these Objects back to there type. i.e.
    String str = "helpme";
    str = (Object)str;
    String type = "String";
    can I use the var type to cast str back to a String;

    I've never used reflection before so my answer maybe way off from what you're looking for.... but to solve your problem on casting an Object to a type specified by a String variable you could use a case or if statement if you know what types are available ahead of time and call the appropriate methods to return your Object type.
    For example... You could create a method for each type you expect to return.
    public String getStringValue( Object obj ) {
         return (String)obj;
    public Integer getIntegerValue( Object obj ) {
         return (Integer)obj;
    public Byte getByteValue( Object obj ) {
         return (Byte)obj;
    }Then... depending on what the value of your String type variable is you can call the appropriate method that will return the Object type you're wanting.
    String type = "String";
    if( type.equals("String") )
         String yourStr = getStringValue(yourObject);
    else if( type.equals("Integer") )
         Integer yourInt = getIntegerValue(yourObject);
    else if( type.equals("Byte") )
         Byte yourByte = getByteValue(yourObject);This maybe not be the most efficient way especially since there can be potential errors but it can work assuming the String type is really representing the type of Object yourObject is.
    I don't know.. just a possible solution that popped in my head.
    .kim

  • J2SE 6 warning message when using type casting

    With Java SE 5 and 6 version, there's always an annoying warning message when I write the following code:
    LinkedList<MyBean> cart0 = (LinkedList<MyBean>) session.getAttribute("cart");The warning message is because I use the type casting with the getAttribute method and thus this is not type-safe. So how do I get around the warning message and write standard code that sticks to the J2SE 6 standards? Thank you.

    Add a @SuppressWarnings annotation to the method. A bit intelligent IDE will provide you a quickfix option for it.
    Keep in mind: it's a warning, not an error. The sessionMap is cannot be specifically parameterized and will never be, it should be able to store any object to your taste. Further on this has not much to do with JSF at itself.

  • Type cast to an enum with U8 representation fails

    When casting an U32 integer to an enumeration type with an internal U8 representation nothing happens (the output enum will not change its value!) if the U32 is not explicitely mapped to an U8 before type casting! See attached example. Bug or feature?
    Attachments:
    TypeCastDesaster.vi ‏13 KB
    MyEnum.ctl ‏5 KB

    Since the typecast function is polymorphic, there is no way for it to determine if the programmer has done something which will yield undesirable results.  Typecast takes the raw binary representation of the data and applies it as a new data type.  So, with a U32, you get 4 bytes, and only one of them is needed for the U8, and I believe it takes the first byte, in the case the highest order byte (bits 24-31).
    The VI would have to look at two inputs and determine that the byte sizes are different at compile time and generate the broken wires.
    As far as to why the upper bytes, it probably has to do with the fact that LabVIEW uses big endian format for its binary
    numbers, while most Windows programs use little endian format. LabVIEW
    uses big endian, because that is what the MacOS uses, and LabVIEW was
    created first for the Macintosh. (from here).
    It could also be a decision made at some point in time.  NI has shown in the past that they don't necessarily conform to ANSI.  The typecast just takes the raw data and from the beginning and processes until it's used the bytes it needs.  The numeric casting functions know exactly what you are trying to do and can therefore handle the byte dropping properly.
    If you're trying to get your enum to a U32, then you just need the to
    U32 conversion.  If your going from U32 to enum, you need the to U8 and
    then the typecast to avoid coercion dots.

  • Is there a way to type cast an array of strings to numbers and back again?

    I'm working on an application where I want to type cast a string like "power supply" into an array of existing numbers. Then sort the existing numbers, and finally convert the casted numbers back into a string so it can be read by the user. In the attachment, you can see my latest attempt with flatten/unflatten data and the 'convert string to byte array'. I can't seem to make this work. Any ideas?
    Thanks - Paul
    Attachments:
    Paul's Temp scan for components.vi ‏56 KB

    OK, here's a quickie (LabVIEW 7.0).
    Simply get the sort key from the 1D array, then build the table.
    Message Edited by altenbach on 10-27-2006 01:34 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    SortedTable.png ‏4 KB
    SortedTable.vi ‏37 KB

  • How can I read a binary file stream with many data type, as with AcqKnowledge physio binary data file?

    I would like to read in and write physiological data files which were saved by BioPac�s AcqKnowledge 3.8.1 software, in conjunction with their MP150 acquisition system. To start with, I�d like to write a converter from different physiodata file format into the AcqKnowledge binary file format for version 3.5 � 3.7 (including 3.7.3). It will allow us to read different file format into an analysis package which can only read in file written by AcqKnowledge version 3.5 � 3.7 (including 3.7.3).
    I attempted to write a reader following the Application Note AS156 entitled �AcqKnowledge File Format for PC with Windows� (see http://biopac.com/AppNotes/ app156Fi
    leFormat/FileFormat.htm ). Note the link for the Mac File format is very instructive too - it is presented in a different style and might make sense to some people with C library like look (http://biopac.com/AppNotes/ app155macffmt/macff.htm).
    I guess the problem I had was that I could not manage to read all the different byte data stream with File.vi. This is easy in C but I did not get very far in LabView 7.0. Also, I was a little unsure which LabView data types correspond to int, char , short, long, double, byte, RGB and Rect. And, since it is for PC I am also assuming the data to be written as �little endian� integer, and thus I also used byte swap vi.
    Two samples *.acq binary files are attach to this post to the list. Demo.acq is for version 3.7-3.7.2, while SCR_EKGtest1b.acq was recorded and saved with AcqKnowledge 3.8.1, which version number is 41.
    I would be grateful if you someone could explain how to handle such binary file stream with LabView and send an example to i
    llustrate it.
    Many thanks in advance for your help.
    Donat-Pierre
    Attachments:
    Demo.acq ‏248 KB
    SCR_EKG_test1b.acq ‏97 KB

    The reading of double is also straight forward : just use a dble float wired to the type cast node, after inverting the string (indian conversion).
    See the attached example.
    The measure of skin thickness is based on OCT (optical coherent tomography = interferometry) : an optical fiber system send and received light emitted to/back from the skin at a few centimeter distance. A profile of skin structure is then computed from the optical signal.
    CC
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        
    Attachments:
    Read_AK_time_info.vi.zip ‏9 KB

  • Dynamic [Runtime] type casting in Java

    Hello,
    This is my requirement.
    I have a method that takes class name as a parameter.
    Ex:
    Object myMethod(String classname){
    Object xyz = getObject(); //userdefine method which returns some object
    /*<b>I need to typecast above object with the class name passed as the method parameter</b>*/
    /*<b>How can i type cast this object</b>*/
    Object obj = (classname) xyz;
    return obj;
    In the above example, how can i dynamically typecast the object with class whose name is passed as the method parameter?

    Hello,
    This is my requirement.
    I have a method that takes class name as a parameter.
    Ex:
    Object myMethod(String classname){
    Object xyz = getObject(); //userdefine method which
    returns some object
    /*<b>I need to typecast above object with the class
    name passed as the method parameter</b>*/
    /*<b>How can i type cast this object</b>*/
    Object obj = (classname) xyz;
    return obj;
    In the above example, how can i dynamically typecast
    the object with class whose name is passed as the
    method parameter?Perhaps a little more background on the project (what you are trying to do) will help the experts here answer?
    /*with a class that takes a noarg constructor*/
    public Object getObject(String classname) throws Exception
      //might want to get a bit more specific with which exceptions it will throw
      return Class.forName(classname).newInstance();
    }Do I think this sometimes is indicative (perhaps even more often than not), of a possible design flaw? Yes..
    It gets a little trickier if you have constructors (you have to create a Class object representing the string with the .forName(..) ..and then use some reflection to determine constructors and then a bit of logic to determine which of those to use...)
    ~Dave

  • Is it possible to make a type cast in TestStand?

    I've got the following problem.
    I use a receive function which waits for an undefined package. (struct package).
    The problem is i can't specify the module with the exaxt package.
    Generally in C i define a Pointer and create enough buffer for it. Is it the same in TestStand?
    Is it possible to make a type cast?
    for example:
    i've got these packages
    struct packet;
    struct  data;
    the function does not know which structure to receive.
    err = receive(buffer,maxlen);
    how do i specify the buffer variable?
    can i create a type "void" with a String to have enough buffer.
    and then to make a type cast, for example "Locals.dataobject = ((data)Locals.buffer)"
    any ideas?
    thx for help

    Unfortunately there is no way to do type-casts in TestStand. What you could do is write a wrapper-dll in C, that has for example two parameters for both possible structs. The dll then takes one of the parameters, does the typecast and passes it on to your original dll.
    From TestStand you can pass the struct(or better container in the "TestStand language") you want to use to the accoridng parameter of the wrapper-dll, leaving the other parameter empty or with some default-value.
    Hope this helps!
    André

  • Help needed in data type casting

    I have a java program which will receive data and its type in the String format. During program execution, the data in the String data has to be converted into the respective data type and assigned to a variable of that data type so that it could be used in the program. Programmer may not know the type of data that the value has to be converted into.
    I really got struck up with this. This is a RMI application and one process node is sending the data to another node in the String format and the type of data it should get converted into so that it can be converted into the respective type and used for computation.
    Can you understand what I am asking for ....if you can pls help and it is highly appreciated

    I dont know whether i ahve expressed it correctly
    look at this code
    dataPacket sendtoNode = send.senDatatoNode(inputReq);
    String recnodnum = sendtoNode.nodeNum;
    String recvarnum = sendtoNode.varNum;
    String recvartype = sendtoNode.dataType;
    String recvalvalue     = sendtoNode.dataVal;
    int num;     int type;
    double result;
    // here in this case the result variable type is double
    if (recvartype.equals("int")){
              type = 1;
         result = Integer.parseInt(recvalvalue); will pose problem
         else
         if (recvartype.equals("double")){
              type = 2;
              result = Double.parseDouble(recvalvalue);
         else
         if(recvartype.equals("float")){
              type =3;
              result = Float.parseFloat(recvalvalue); will pose problem
         else
         if(recvartype.equals("Boolean")){
              if ((recvalvalue.equals("true")) || (recvalvalue.equals("TRUE")))
              type = 4;
              result = Boolean.parseBoolean(recvalvalue); will pose problem
         else
         if(recvartype.equals("char")){
              type = 5;
              result = (char)recvalvalue; will pose problem
    else
    if(recvartype.equals("String")){
         type = 6;
              result = recvalvalue; will pose problem
         else
         if(recvartype.equals("byte")){
              type = 7;
              result = Byte.parseByte(recvalvalue); will pose problem
         else
         if(recvartype.equals("long")){
              type = 8;
              result = Long.parseLong(recvalvalue); will pose problem
         else
         if(recvartype.equals("short")){
              type = 9;
              result = Short.parseShort(recvalvalue); will pose problem
         //forvarval varvalue = new forvarval();
         //varvalue.forvarval(recvartype, recvalvalue);
    // this has to be done after sorting the problem of type casting string result = recvalvalue;
    //result = value; //<this will surely give me a problem as i m assigning string to double>??
    send.host(result);
    System.out.println("result received and the result is " +recvalvalue );
    now i need to assign the converted string in to a variable and use in the compuation ..thts where the challenge n not in teh conversion process...

  • Splitting and type casting huge string into arrays

    Hello,
    I'm developing an application which is supposed to read measurement files. Files contain I16 and SGL data which is type casted into string. I16 data is data from analog input and SGL is from CAN-bus data in channel form. CAN and analog data is recorded using same scan rate.
    For example, if we have 6 analog channels and 2 CAN channels string will be (A represents analog and C represents CAN):
    A1 A2 A3 A4 A5 A6 C1 C2 A1 A2 A3 A4 A5 A6 C1 C2 A1 A2 .... and so on
    Anyway, I have problems reading this data fast enough into arrays. Most obvious solution to me was to use shift registers and split string in for loop. I created a for loop with two inner for loops. Number of scans to read from string is wired to N terminal of the outermost loop. Shift register is initialized with string read from file.
    First of the inner loops reads analog input data. Number of analog channels is wired to its N terminal. It's using split string to read 2 bytes at a time and then type casts data to I16. Rest of the string is wired to shift register. When every I16 channel from scan is read, rest of the string is passed to shift register of the second for loop.
    Second loop is for reading CAN channels. It's similar to first loop except data is read 4 bytes at a time and type casted to SGL. When every CAN channel from scan is read, rest of the string is passed to shift register of the outermost loop. Outputs of type cast functions are tunneled out of loops to produce 2D arrays.
    This way reading about 500 KB of data can take for example tens of seconds depending on PC and number of channels. That's way too long as we want to read several megabytes at a time.
    I created also an example with one inner loop and all data is type casted to I16. That is extremely fast when compared to two inner loops!
    Then I also made a test with two inner loops where I replaced shift register and split string with string subset. That's also faster than two inner loops + shift register, but still not fast enough. Any improvement ideas are highly appreciated. Shift register example attached (LV 7.1)
    Thanks in advance,
    Jakke Palonen
    Attachments:
    String to I16 and SGL arrays.vi ‏39 KB

    OK, there is clearly room for improvement. I did some timing and my two above suggestions are already about 100x faster than yours. A few teeaks led to a version that is now over 500x faster than the original code.
    A few timings on my rather slow computer (1GHz PIII Laptop) are shown on the front panel. For example with 10000 scans (~160kB data as 6+2) my new fastest version (Reshape II) takes 14 ms versus the original 7200ms! It can do 100000 scans (1.6MB data) in under 200 ms and 1000000 scans (15MB data) in under 2 seconds.
    I am sure the code could be further improved. I recommend the Reshape II algoritm. It is fastest and can deal with variable channel counts. Modify as needed.
    Attached is a LabVIEW 7.1 version of the benchmarking code, containing all algorithms. I have verified that all algorithms produce the same result (with the limitation that the cluster version only works for 6*I16+2*SGL data, of course). Remember that the reshape function is extremely efficient, because it does not move the data in memory. I have some ideas for further improvements, but this should get you going.
    Message Edited by altenbach on 08-05-2005 03:06 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    StringI16SGLCastingTimer.png ‏48 KB
    StringtoI16andSGLArraysMODTimer.vi ‏120 KB

  • Dynamic Type casting

    Can we dynamically type-cast an object reference passed to Object Clss to that specific class?
    Here is what I want to do.
    I am going to pass an object reference to a method, which has Object class as parameter to it, as shown below. Using getClass() or some other way, I want to dynamically typecast this reference to the original Class and call some method of this Class.
    void test (Object ref1){
    ((ref1.getClass())ref1).writeLog();
    By doing this, am I violating the basic Object Orineted rules?

    I mean, consider an hypothetical case (which is wrong
    from OO point of view) that there are suppose 10
    classes in my system. None of them related to each
    other, all are independent classes. But each one has a
    method called, writeLog(). Now I want to write one
    method which will be called by each of these classes
    (in some 11th class), which will have "Object" as a
    parameter. Now using the actual reference I want to
    call the corresponding writeLog() method.
    1 - Point out to management that the design is now officially broken.
    2 - Point out that if the design is not fixed then any solution that impliments the changes will cost more to maintain in the future and will likely lead to instabilities in the system (due to complexity.)
    3 - Implement one of the suggested solutions and make sure that you put in a lot of error checking and logging in the hacked solution.
    4 - Produce extensive documentation about the impact of changing any of the objects that you are relying on. Push it to anyone and everyone that might ever touch or even suggest changes to the code.
    Doing all of the above allows you to live stress free when the next revision breaks because someone didn't understand the implications of your hacked solution. You will be able to find the problem quickly and point out that it had nothing to do with your code but rather because someone else did not follow the complete documentation that you produced. And then when they complain that your solution was a hack you can point out that you explained that previously as well.

  • USE OF Type cast function ?

    can any one explain the use of type cast function with help of example please i am not able to understand the explaination given in ni.com site

    LabVIEW provides a function called Type Cast, which allows data to pass through it unchanged while the type of the wire changes. Please refer to the given link which elaborates on the type cast function with required instances.
    http://zone.ni.com/reference/en-XX/help/371361H-01​/glang/type_cast/
    In case of any clarifications needed, do revert.
    Regards,
    Sahil Singla
    Applications Engineer | National Instruments
    (Give Kudos to good Answers and Mark it as a Solution if your problem is Solved)

Maybe you are looking for

  • Has anybody gotten a RocketRAID 640 working in a Mac Pro?

    I have a RocketRAID 640 I purchased, based on the fact that it "had OS X drivers". Unfortunately l'm running into a bit of a snafu here. The English website (www.highpoint-tech.com) shows for the RR640 drivers that "Mac drivers are available at http:

  • Seperating sound from video clips?

    I was wondering if anyone could give me instructions on how to go about serperating audio from all of my video clips in order for me to delete the audio. Power Book G4   Mac OS X (10.4.6)  

  • Safari displaying pages inconsistently

    Pages that I'm sure used to display fine in Safari are suddenly not displaying at all - they're a completely white and displaying nothing. My first thought was to reinstall Safari, but that seems to be trickier than I thought. I have two Safari plugi

  • Problems syncing Photos since ios5.

    Many folders are now syncing Empty.  I have around 30 folders of pictures nicely organized & I haven't had any problems syncing with my iPhone or iPad before the ios5 and iCloud update... Now all folders sync but some of them are Empty; any thoughts?

  • Require Logic for the Program

    I have a requirement  in which I need to write a program. I need to fetch the payer data which is having KNA1-ZZDTCESS value populated(Payer which are having this field value blank no need to fetch those payer).ZZDTCESS is the cession date and this i