Doubt in decode

hi,
here is a scenario:
in a query i have to check whether a memory variable is > 100, if it is > 100 then i have to add 500 to that varaible else i will have to subtract 50 from it..
i tried using decode as shown below:
select decode(a>100, a + 500, a-50)
from dual
but it throws : ORA-00907: missing right parenthesis error message.
So please provide a solution for this.
Regards,
Sridhar

Use a CASE instead, a lot easier to do, something like
select a  + case when a > 100 then 500 else -50 end
  from tbl.. not tested

Similar Messages

  • Doubt in DECODE function

    DECODE(User Je Category Name,'%REV%',SUBSTR(Jnl Line Description,12,20))
    Could you suggest some way of doing this please?
    Thanks

    Well, if you want/must do it with decode, then
    DECODE(INSTR(User Je Category Name,'REV'),0,NULL,SUBSTR(Jnl Line Description,12,20))Else you can use simple CASE
    CASE WHEN User Je Category Name like '%REV%' THEN SUBSTR(Jnl Line Description,12,20) ENDRegards
    Dmytro

  • Doubt with Decode function(By Naren)

    Hi all
    i have the following query
    SELECT S.SCHOOLNAME,
    SUM(DISTINCT DECODE(LR.QUESTIONNAIRE_ID,62, L.WORK_SPACE))/5 As LITSUM
    FROM TQDB_LEARNER_RESPONSE L LEFT JOIN TQDB_LEARNER_RESPONSERS LR ON LR.RESPONSER_ID=L.RESPONSER_ID LEFT JOIN
    SCHOOLS S ON S.SCHOOLID=LR.SCHOOL_ID
    GROUP BY S.SCHOOLNAME
    It is working fine if i fixed QUESTIONNAIRE_ID AS 62.
    Can i use parameter in place of 62 like :QID
    When i execute this query and gave 62 as parameter value it should give LITSUM depend on 62,And if i wont give value(null or blank) it should give result irrespective of QUESTONNAIRE_ID.
    I tried it by changing above query like following.
    SELECT S.SCHOOLNAME,
    SUM(DISTINCT DECODE(LR.QUESTIONNAIRE_ID,:QID, L.WORK_SPACE))/5 As LITSUM
    FROM TQDB_LEARNER_RESPONSE L LEFT JOIN TQDB_LEARNER_RESPONSERS LR ON LR.RESPONSER_ID=L.RESPONSER_ID LEFT JOIN
    SCHOOLS S ON S.SCHOOLID=LR.SCHOOL_ID
    GROUP BY S.SCHOOLNAME
    But it is not working properly,not giving expected result.
    Pls help me.

    never noticed that bit, sorry.
    I am assuming that your questionnaire_id is not null, so when you pass null there are no records with a questionnaire_id of null.
    if you want to total all L.WORK_SPACE if you pass null then try this
    SELECT S.SCHOOLNAME,
    SUM(DISTINCT DECODE(:QID, NULL, L.WORK_SPACE, DECODE(LR.QUESTIONNAIRE_ID, :QID, L.WORK_SPACE))) / 5 AS
    LITSUM
    FROM TQDB_LEARNER_RESPONSE L LEFT JOIN TQDB_LEARNER_RESPONSERS LR ON LR.RESPONSER_ID = L.RESPONSER_ID LEFT JOIN SCHOOLS S ON S.SCHOOLID = LR.SCHOOL_ID
    GROUP BY S.SCHOOLNAME;

  • Doubt in Decode and Using Temporary variable

    I was facing the following issue,
    For example,
    The column_name if A should be stored with the value B or, with itself for which I included a statement as following,
    Case [1]
    SELECT ....DECODE(column_name,'A','B',column_name) alias_name
         FROM table_name
              WHERE condition;
    But,
    when i used a temporary variable as following i could not get the expected change,
    Case [2]
    SELECT ...column_name
         FROM table_name
              WHERE condition;
    temp VARCHAR(10);
    BEGIN
    IF column_name='A' THEN
         temp:='B';
    ELSE
         temp:=column_name;
    END IF;
    END;
    I was able to get the right output in Case[1],but failed to get in [2]. Please help and Thanks in advance.

    Without seeing your code, whatever I can say might be just an assumption. I can give an example to show that it will work.
    SET SERVEROUTPUT ON
    DECLARE
      var      VARCHAR2(10);
      col_name VARCHAR2(30);
      TEMP     VARCHAR2(20);
    BEGIN
      SELECT column_name
      INTO col_name
      FROM user_tab_columns
      WHERE table_name = 'EMP'
      AND rownum       =1;
      IF (col_name     ='EMPNO') THEN
        temp          := 'X';
      ELSE
        temp := col_name;
      END IF;
      var := 'abc '||temp;
      dbms_output.put_line(var);
    END;
    OUTPUT :
    abc X
    PL/SQL procedure successfully completed.

  • Doubts regarding db connection with encrypted password usage in sandbox

    Hi All,
    We have setup the db connection using configuration file. The configuration file contains db connection information including the encrypted password.
    Below are my doubts:
    1. If we are going to import the ETL project in zip file directly into the sandbox can we run the graphs directly or we need to check how the password which is encrypted in configuration file will be decoded.
    2. Can we directly modify the configuration file for db connection like db connection,user name and password. Suppose I want the graphs to run in some other database which is not specified in configuartion fiel .Can I directly update that?
    3.Is it possible to change the encrypted password in the configuration file in the sandbox. Is it that we need to create the project in Integrator Designer, change the password using the Integrator Designer, and then copy the encrypted password into the configuration file in sandbox, or the Endeca provides a functionality to allow user to directly change the password in the sandbox on the Integrator server.
    Can someone please let me know their comments on above.
    Thanks in Advance.
    Regards,
    Amrit

    can someone please help me on this issue

  • Decode in pl/sql

    Hi all
    I read that in order to use the DECODE function in PL/SQL block you will have to use the system table dual.
    my query is why we cannot use user table like emp while using decode function???

    thois might give some help,
    in general use dual, if the function used in the select list is independent of any data of a particular table, like emp in your case, check this out,
    select decode('',null,'is null','is not null') from dual
    will return is null
    but
    select decode('',null,'is null',' is not null') from emp
    will work and will give the same result but will give many records as of emp table, so either a distinct can be used or row_num = 1 can be used, but the whole point to to get things done with little cost, so better use dual for such tables...
    answering this query, i have got few doubts, decode() is a fuunction which does the selection operation, but
    1) how to implement a custom function with variable number of parameters
    2) as decode is a function which returns one of the input parameter on execution, why can't we call
    x := decode('',null,'is null','is not null');
    kindly reply to the above two queries???
    cheere

  • To use Boolean function in DECODE or CASE statement

    Hi all
    I have a scenario where i need to use a boolean function inside DECODE statement. When i tried this way iam getting "ORA-06553: PLS-382: expression is of wrong type".
    I doubt whether i can use boolean function inside DECODE or not?
    My query will be like this:
    select decode(my_fuction( ),'TRUE',1,'FALSE',0) from dual;
    Any help is highly appreciated.
    Thanks
    Sriram

    Overloaded functions must differ by more than their
    return type . At the time that the overloaded
    function is called, the compiler doesn't know what type
    of data that function will return. The compiler cannot,
    therefore, determine which version of the function to
    use if all the parameters are the same.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Using decode function without negative values

    Hi friends
    I am using oracle 11g
    I have at doubt regarding the following.
    create table Device(Did char(20),Dname char(20),Datetime char(40),Val char(20));
    insert into Device values('1','ABC','06/13/2012 18:00','400');
    insert into Device values('1','abc','06/13/2012 18:05','600');
    insert into Device values('1','abc','06/13/2012 18:55','600');
    insert into Device values('1','abc','06/13/2012 19:00','-32768');
    insert into Device values('1','abc','06/13/2012 19:05','800');
    insert into Device values('1','abc','06/13/2012 19:10','600');
    insert into Device values('1','abc','06/13/2012 19:15','900');
    insert into Device values('1','abc','06/13/2012 19:55','1100');
    insert into Device values('1','abc','06/13/2012 20:00','-32768');
    insert into Device values('1','abc','06/13/2012 20:05','-32768');
    Like this I am inserting data into table for every 5 minutes Here i need the result like
    output:
    Dname 18:00 19:00 20:00
    abc 400 -32768 -32768
    to retrieve this result i am using decode function
    SELECT Dname,
    MAX(DECODE ( rn , 1,val )) h1,
    MAX(DECODE ( rn , 2, val )) h2,
    FROM
    (SELECT Dname,Datetime,row_number() OVER
    (partition by Dname order by datetime asc) rn FROM Device
    where substr(datetime,15,2)='00' group by Dname.
    According to above data expected result is
    Dname 18:00 19:00 20:00
    abc 400 600(or)800 1100
    This means I dont want to display negative values instead of that values i want to show previous or next value.
    Edited by: 913672 on Jul 2, 2012 3:44 AM

    Are you looking for something like this?
    select * from
    select dname,
           datetime,
           val,
           lag(val) over (partition by upper(dname) order by datetime) prev_val,
           lead(val) over (partition by upper(dname) order by datetime) next_val,
           case when nvl(val,0)<0  and lag(val) over (partition by upper(dname) order by datetime) >0 then
             lag(val) over (partition by upper(dname) order by datetime)
           else 
             lead(val) over (partition by upper(dname) order by datetime)
           end gt0_val
    from device
    order by datetime
    where substr(datetime,15,2)='00';Please take a look at the result_column gt0_val.
    Edited by: hm on 02.07.2012 04:06

  • Doubt regarding  ALE SETTINGS in IDOC scenario.

    Hi Friends,
            I have some doubts regarding ALE settings for IDOC scenarios,  can anyone  please clarify my doubts.
    For exmaple take IDOC to FILE scenario
    The knowledge i got from SDN is --
    One need to do at the  R3 side is  --- RFC DESTINATION (SM59)  for the XI system.
                                                       --- TRFC PORT  for sending IDOC  to the  XI system
                                                       --- CREATING LOGICAL SYSTEM
                                                       --- CREATING PARTNER PROFILE 
                   at the XI side is  --- RFC  Destination ( For SAP sender system)
                                           --- CREATING  PORT  for receiving IDOC from the SAP sending system(IDX1).
    1. Do we create two logical systems for both Sender ( R3 system ) and Receiver( XI system ) in R3 system itself or in XI system or in both systems we create these logical systems? Is this a mandatory step in doing ALE configurations?
    In IDOC to IDOC scenario-------
      2.  Do we craete two RFC destinations in XI system? One RFC DESTINATION for the Sender R3 system and another RFC DESTINATION for the Receiver R3 System? and do we create RFC DESTINATION for the XI system in receiver R3 system? If not.....y we don't create like this........Please give me some clarity on this.............
      3.  If we use IDOC adapter ,since IDOC adapter resides on the ABAP STACK ,we don't need sender communication channel ,for the similar reason----
    y we r creating receiver communication channel in the case of FILE to IDOC scenario?
      4. Can any one please provide me the ALE settings for IDOC to FILE scenario,
                                                                                    FILE to IDOC scenario,                                                                               
    IDOC to IDOC scenario individually.
    Thanks in advance.
    Regards,
    Ramana.

    hi,
    1. Yes, we create two logical systems for both Sender ( R3 system ) and Receiver( XI system ) in R3 system itself and
    it is a mandatory step in doing ALE configurations
    2. We create 1 RFC destination each in R3 and XI.
        R3 RFC destination points to Xi and
        XI RFC destination  points to R3
    3 We need to create Communication Channel for Idoc receiver as the receiver channel is always required but sender may not be necessary
    4. ALE settings for all IDOC scenarios are same  as follows....
    Steps for ALE settings:-
    Steps for XI
    Step 1)
         Goto SM59.
         Create new RFC destination of type 3(Abap connection).
         Give a suitable name and description.
         Give the Ip address of the R3 system.
         Give the system number.
         Give the gateway host name and gateway service (3300 + system number).
         Go to the logon security tab.
         Give the lang, client, username and password.
         Test connection and remote logon.
    Step 2)
         Goto IDX1.
         Create a new port.
         Give the port name.
         Give the client number for the R3 system.
         Select the created Rfc Destination.
    Step 3)
         Goto IDX2
         Create a new Meta data.
         Give the Idoc type.
         Select the created port.
    Steps for R3.
    Step 1)
         Goto SM59.
         Create new RFC destination of type 3(Abap connection).
         Give a suitable name and description.
         Give the Ip address of the XI system.
         Give the system number.
         Give the gateway host name and gateway service (3300 + system number).
         Go to the logon security tab.
         Give the lang, client, username and password.
         Test connection and remote logon.
    Step 2)
         Goto WE21.
         Create a port under transactional RFC.(R3->XI)
         Designate the RFC destination created in prev step.
    Step 3)
         Goto SALE.
         Basic settings->Logical Systems->Define logical system.
         Create two logical systems(one for XI and the other for R3)
         Basic settings->Logical Systems->Assign logical system.
         Assign the R3 logical system to respective client.
    Step 4)
         Goto WE20.
         Partner type LS.
         Create two partner profile(one for XI the other for R3).
         Give the outbound or inbound message type based on the direction.
    Step 5)
         Goto WE19
         Give the basic type and execute.
         fill in the required fields.
         Goto IDOC->edit control records.
         Give the following values.(Receiver port,partner no.,part type and sender Partner no. and type)
         Click outbound processing.
    Step 6)
         Go to SM58
         if there are any messages then there is some error in execution.
         Goto WE02.
         Check the status of the IDOC.
         Goto WE47.
         TO decode the status code.
    Step 7)
         Not mandatory.
         Goto BD64.
         Click on Create model view.
         Add message type.
    BD87 to check the status of IDOC.
    In case if not authorized then go to the target system and check in SU53, see for the missing object
    and assign it to the user.
    SAP r3
    sm59(status check)(no message)
    WE02(status check)
    WE05(status check)
    BD87(status check)
    Xi
    IDx5(Idoc check)
    SU53(authorization check)
    Reward points if helpful
    Prashant

  • Digital 5700 Decoder

    Hi,I have an issue with the Inspire 5.1 Digital 5700 decoder( I did log a call with Customer Services, but I'll get to that in a bit!). Essentially, when I power the on, the LED light goes from red to green. I then select the output I require? everything is fine. Seconds later, the unit switches itself off and the LED light goes back to red! When I try to turn it back on again, it always goes back to red. I logged a call with Customer Services, who asked what happens when I "gently tap" the unit. The LED does go to green, but eventually goes back to red again. Customer Services also asked me for the serial number, which I duly provided (CAMF375047000040N). They came back saying that they had no record of that serial number on their system. I even took photos of the unit with the SN and sent them across, but they still came asking me for proof of purchase and a 3rd confirmation of the SN. I'm at a bit of a loss as I no longer have the proof of purchase. The unit is 2.5 years old, and possible out of warranty. But I would like to know if what is happening with the unit is a common problem and if there is a fix? If there isn't, then I'll have to throw everything away and start again. Many thanks

    MasterRusty,
    I have a post on here titled "inspire 5700's are junk" from back in Dec 2004, you are having the same problem with yours that I had so don't worry they will quit working altogether very soon. The digital decoder goes out in them usually within a year AFTER the warranty goes out so creative just says " oh well they are more than year old so too bad" I know from experience with them. There is nothing you can do about this except to pack them up and buy another brand. I stated before that maybe if enough people wrote in stating their problems with this system that maybe just maybe creative would realize that there really is a problem here and they would take a serious look into it and admit that yes we screwed up here and we will fix the problem for our customers, but I really doubt it because as I said before " they are the big company and we are the little people". I was told that "we can't offer unlimited warranties on our products" which I understand; but if you look at some of the other speaker companies they offer 2,3 even 4 year warranties, but again as I said you are really out of luck. I would really like to see Creative make a liar out of me and look into the problem and make things right for us, but I feel that is only a wish that won't come true.
    good luck,
    MrDave

  • Decode vs. Case in OWB Transformation

    Hello all,
    I am trying to count or sum all of Reasons where the value is Test. Here is the code which I would like to covert into OWB transformations:
    sum(decode( REASON ,'Test',1,0) )
    Step 1:
    I tried to use Decode in expression
    (decode( REASON ,'Test',1,0) ) and it gives me following error:
    Line 1, Col 1:
    PLS-00204: function or pseudo-column 'DECODE' may be used inside a SQL statement only
    Line 0, Col 1:
    PL/SQL: Statement ignored
    It seems OWB does not recognize Decode. How should I solve the problem? Should i try using Case to substitute the above decode code ? like:
    Case
    when Reason='Test'
    then 'Test'
    End
    Am I doing it right?
    and following this I can use aggregator to Sum(test) for counting/summing all tests. Is there anyway I can use this code: sum(decode( REASON ,'Test',1,0) ) in one transformation? Please let me know.
    Thanks,
    K

    OWB provides case statement in place of decode. OWB does not recognize decode statements(till what i know, and tried out)
    Why dont you first use a filter (on reason='test') and then use an aggregrator transformation, You can put input as the column reason from the filter and make a new column in the output group for summing it.
    Hope i have solved your doubts....
    -Nikita.

  • Reports Query Doubt??

    hi all,
    Thanks to ALL the replies to my query.
    I have a doubt in Oracle reports.
    This is the query in the format trigger.
    ctr,cnt - are summary columns in the group above which counts the detail group
    I have to retrieve the records for status codes equal to active and cancelled.
    and suppress the records with no records for either of these status codes
    if :ctr <> 0 and :cnt <> 0 and :status_code in ('act,'can') then
    return(true);
    else
    return(false);
    end if;
    Now the records with status code 'can'
    are not been retrieved.
    Could you please suggest as to how I could
    rectify where Iam going wrong.
    TIA
    sg
    null

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by ():
    Why don't you use a decode in your query?<HR></BLOCKQUOTE>
    if :ctr <> 0 and :cnt <> 0 and
    (:status_code = 'act' or
    :status_code = 'can') then
    return(true);
    else
    return(false);
    end if;
    null

  • Arstechnica: Creative lies on missing DTS/Dolby Decoding feature

    Creative Says : "these functions are not supported at driver level in Windows Vista." This isn't true. When two of the driver files from a standard X-Fi card are replaced with two driver files drawn from a Dell-specific driver available at the company's support [url="http://support.us.dell.com/support/downloads/download.aspx?c=us&l=en&s=gen&releaseid=R44728&for matcnt=&libid=0&fileid=9372">web site[/url], DTS and DD decoding immediately reappear as options and function correctly."
    "Creative might be able to get away with saying that DTS and DD decoding aren't enabled at the driver level for X-Fi and Audigy cards, but the functionality is clearly baked into the driver and is thus supported."
    [url="http://arstechnica.com/news.ars/post/2008033-creative-irate-after-modder-spruces-up-vista-x-fi-drivers.html">Arstechnica story on the Dolby & DTS Decoding scandal
    [/url]
    Below is my open letter to Creative about this situation ....
    To Creative Executi'ves ,
    I am a core customer, someone who has been purchasing your cards for years. Hear me out.
    What you may not realize is this whole backlash about your drivers is not new, it has been building up slowly for months and has just now come to a head. With both my Audigy and more recently my X-fi Fatality card on XP, I have always used my Creative card as the center of sound on both my computer and my entertainment system. I took it for granted that after spending so much money on the ultimate sound card, that I could just plug in my cable box or dvd player into x-fi and my Klipsch speakers would hum. After spending so much money on computer speakers that would also double as my TV center speakers I was not about to buy another external decoder to do something I expect my sound card to do.
    At first after moving to Vista I thought that this feature was eventually coming, that you were working diligently to get my x-fi's decoding capabilities back. Then month after month my expectations dwindled. Imagine my anger when I come to realize that this feature was purposely removed at the software level. That by simply adding two files from a x-fi dell driver that the feature came back. Then on top of it you pour salt into the wound by never fully explaining the reason why you removed these important features. Your explanation was simply that it was not supported and that PowerDVD would now handle all Dolby/DTS decoding. After months of waiting your explanation was far from sufficient. Imagine how annoyed i was trying to figure out how to get PowerDVD to actually decode something from an outside source , which it does not. In my case, and many others on this forum your explanation was lacking. Im going to take a leap and assume that something about Vista's DRM has prevented you from decoding Dolby & DTS. If that is the case why not come out and just explain it to your customers as such. Your lack of transparency on this issue has just been plain bad and now because of it you are angering your customer base.
    Let me be clear, in my eyes, this situation has severely hurt your companies reputation and brand. The sad thing about this is that in the end this is not a story about lacking features. It's a story about a company with good products that just did not know how to effecti'vely communicate with it's customers. Will I ever buy another creative product again, I dunno. But I do know that this whole fiasco has decreased the chances that I will. If I do , it will most definitely not be one of your upper end products as I have always purchased in the past.
    Im done with this rant, im going to play some Battlefield 2 with Ultra High EAX settings. Hey, at least they did not take away all my features like they did with those poor Audigy users
    Message Edited by soundfire on 04-05-2008 09:4 PMMessage Edited by soundfire on 04-05-2008 09:45 PM

    PawPaw, I feel your pain ! I currently own both an Audigy Platinum and a Creative X-fi Fatality. The main reason I purchased the upgrade cards which included breakout boxes is for the optical/digital in feature. As I say in my letter, I have, for years hooked up my DVD and cable box to provide my theater entertainment though my computer speakers. The setup worked great?
    Creative in essence has retroacti'vely removed the feature that was the motivating factor in my purchase of their upper model cards. By making the decision not to add this "expected" feature on Vista (The default OS)? Creative, as I see it has in actuality removed a defining functionality from it's product line. It has made the front box with all it's special hook ups, pointless. Angering your enthusiast base is just not a good way to bring your company back into the green. If Creative had at least explained the reason for the feature removals, that's one thing. It would at least be a start towards improving customer communication.
    It's sad to see such a staple in the tech industry go down hill so fast. While the company executi'ves in singapore are huddling around planning their company comeback.... Which is no doubt the next greatest thing high fidelity MP3 players . They ought to take some time out to think about the customer again because a company li'ves and dies on it's customers, not it's technology.
    My first sound blaster card : Sound Blaster 6 - 993
    Possibly my Last? : Creative x-fi fatalty - 2007

  • Time for jpeg decoding

    Hi to all!
    i'm working with a thread that read a stream from a camera (stream of Jpeg ) end show the video on the screen.
    I'm testing with max resolutions (704x576) e low compression at 25 fps.
    The result is very far from 25 fps! and depending from the library for decoding. I have tested with:
    1) immagine = ImageIO.read(test);
    2) immagine=Toolkit.getDefaultToolkit().createImage(imageData);
    3) with Reader: immagine = reader.read(0);
    4) with JPEGDecoder: immagine = decoderA.decodeAsBufferedImage();
    The target is 40 ms for one of that line.
    Analysing the problem i have found that the time for decoding Increases enormously every 3-4 frame (at 704x576 while at low resolutions the number increases) like:
    67 ms,70 ms,68 ms, 240 ms,68 ms,72 ms,77 ms,220 ms,69 ms,68 ms,77 ms,79 ms,199 ms,62 ms,59 ms, ecc..ecc...
    The size is consistently about 34000 byte (also when employs 200 ms....).
    and obviously average values of FPS collapse up to 3-6 fps (at 704x576) precisely those values up 200 ms !
    I can not understand why!
    that is for linux on pentium or for windows (java VM is version 6up5).
    No sleep or other operation is done at regular intervals that could cause this.
    Someone has had a similar problem or have a suggestion?
    thanks in advance,
    Nicola
    Edited by: nicopalm on Apr 10, 2008 2:07 AM
    Edited by: nicopalm on Apr 10, 2008 2:16 AM

    Thanks Andrew,
    I have tetsted your suggestion but i have some problem with my Reader ...
    i create imageinputstream for Reader from bytearrayinputstream and i must allocate a new test every time because the imagedata is different every time...
    test = new ByteArrayInputStream(bufferArray, 0,lungbyte);
    iis = ImageIO.createImageInputStream (test);
    I try to say as I did to find out if I have done well.....(sorry for my english...)
    1) I have a stream come from network camera.
    2) I open DataInputStream (iStrm).
    I know the lenght (L) of each image end i read from iStrm imageLength bytes (after i have fount the boundary e read the info between two images) .
    3) With these values fill a byte array (imageData). Because each images have different lenght, i must allocate imageData=new byte[imageLength]. (After draw i make imageData=null).
    4) With imageData i create a ByteArrayInputStream. test= new ByteArrayInputStream(imageData).
    5) Finally i have the multiple way to decode like image=ImageIO.read(test) or other....
    Is the proper procedure?
    My doubt is this:
    The new ByteArrayInputStream have the imageData like is buffer.
    Can i create a buffer of fixed size (example higher than the average value of images length)      so that i can make a new ByteArrayInputStream one time only ?
    In this way could fill the array (which is certainly less buffer).
    thanks
    Nicola

  • Decoding in Labview, ASCII, Unicode

    hello guys! I am a Labview novice and trying to build a program which communicates with an angular orientation sensor, which sends data in 2 formats, ASCII and binary. 
    When handling the data sent from the orientation sensor coded in ASCII, some garbled codes are returned somehow. I don't really understand how Chinese characters can come out, when the data is encoded in ASCII. I am personally using a Chinese Windows 7 platform, but that shouldn't affect the program since my labview is in English. 
    Is there anyway to control how Labview decode the bytes of data sent from the sensor? I doubt that it might be using Unicode or something to decode the data bytes, resulting in the garbled codes.
    Thanks in advance!
    Matthew
    Attachments:
    garbled code.JPG ‏10 KB

    How are you communicating with your device?  If using RS-232, make sure your baud rate is correct.  That is the common reason I have seen a mess of bytes like that.  The other option is that the instrument is returning binary data.  Try chaning the view of your string to Hex and see if the data makes any sense that way.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

Maybe you are looking for

  • Credit Check not occurring for Customer with Partial Credit limit existing

    Hi, I have a scenario 1) where, if credit limit is crossed, then on creation of order I get an credit check even when i have not entered materials in sales order. 2) Partial Credit limit is pending (for e.g Credit limit of 100, 50 is still pending) w

  • Create a schema from web service in eclipse

    Hi all, I'm trying to export some data out of SF to an 3rd party via a web service. In the webUI I have the possibility(Attachment 1) to create a schema from web service so my outgoing file matches the requirements. In Eclipse I cannot find that opti

  • Report Conversion Tool in BI 4.1 SP2 not working from Client PCs

    Hi All, I am trying to convert some DeskI reports to WebI using report RCT 4.1 SP2. I'm converting the DekI reports in 4.1 direclty to WebI, so my source and destination is always going to be 4.1 I am able to select the reports to be converted and wh

  • CRS-1 boot failed problem ( REDFS-5-INIT_FAILED)

    Hi expert , today I face new problem with one RP , : Initializing DDR SDRAM...found 4096 MB Initializing ECC on bank 0 Initializing ECC on bank 1 Initializing ECC on bank 2 Initializing ECC on bank 3 Turning off data cache, using DDR for first time I

  • All Sorts of help required

    Friends, I started interning at a production studio a few weeks ago. They had installed Final Cut Server in July, and had gone through all the installation procedures, and were getting the administration details set up on my first day. I don't know e