LabView String StartsWith functionality like in C#?

Hello all,
in C# (.NET) there is a good class: String
There it is possible e.g. to get information, if the string startswith a special substring.
Is there such possibility in LabView? Is there such LabView vi, which offers this functionality? (Some snippet?)
Why I am asking:
I want to create a switch/case-block (case-structure) in labview for this code:
if(string.startswith("XYZ"))  step into case1
else if(string.startswith("DEF")) step into case2
BTW:
It would be so nice if anybody could create polymorphic VI with these functions: 
(from C# string class)
public object Clone();
public static int Compare(string strA, string strB);
public static int Compare(string strA, string strB, bool ignoreCase);
public static int Compare(string strA, string strB, StringComparison comparisonType);
public static int Compare(string strA, string strB, bool ignoreCase, CultureInfo culture);
public static int Compare(string strA, string strB, CultureInfo culture, CompareOptions options);
public static int Compare(string strA, int indexA, string strB, int indexB, int length);
public static int Compare(string strA, int indexA, string strB, int indexB, int length, bool ignoreCase);
public static int Compare(string strA, int indexA, string strB, int indexB, int length, StringComparison comparisonType);
public static int Compare(string strA, int indexA, string strB, int indexB, int length, bool ignoreCase, CultureInfo culture);
public static int Compare(string strA, int indexA, string strB, int indexB, int length, CultureInfo culture, CompareOptions options);
public static int CompareOrdinal(string strA, string strB);
public static int CompareOrdinal(string strA, int indexA, string strB, int indexB, int length);
public int CompareTo(object value);
public int CompareTo(string strB);
public static string Concat(IEnumerable<string> values);
public static string Concat<T>(IEnumerable<T> values);
public static string Concat(object arg0);
public static string Concat(params object[] args);
public static string Concat(params string[] values);
public static string Concat(object arg0, object arg1);
public static string Concat(string str0, string str1);
public static string Concat(object arg0, object arg1, object arg2);
public static string Concat(string str0, string str1, string str2);
public static string Concat(object arg0, object arg1, object arg2, object arg3);
public static string Concat(string str0, string str1, string str2, string str3);
public bool Contains(string value);
public static string Copy(string str);
public void CopyTo(int sourceIndex, char[] destination, int destinationIndex, int count);
public bool EndsWith(string value);
public bool EndsWith(string value, StringComparison comparisonType);
public bool EndsWith(string value, bool ignoreCase, CultureInfo culture);
public override bool Equals(object obj);
public bool Equals(string value);
public static bool Equals(string a, string b);
public bool Equals(string value, StringComparison comparisonType);
public static bool Equals(string a, string b, StringComparison comparisonType);
public static string Format(string format, object arg0);
public static string Format(string format, params object[] args);
public static string Format(IFormatProvider provider, string format, params object[] args);
public static string Format(string format, object arg0, object arg1);
public static string Format(string format, object arg0, object arg1, object arg2);
public CharEnumerator GetEnumerator();
public override int GetHashCode();
public TypeCode GetTypeCode();
public int IndexOf(char value);
public int IndexOf(string value);
public int IndexOf(char value, int startIndex);
public int IndexOf(string value, int startIndex);
public int IndexOf(string value, StringComparison comparisonType);
public int IndexOf(char value, int startIndex, int count);
public int IndexOf(string value, int startIndex, int count);
public int IndexOf(string value, int startIndex, StringComparison comparisonType);
public int IndexOf(string value, int startIndex, int count, StringComparison comparisonType);
public int IndexOfAny(char[] anyOf);
public int IndexOfAny(char[] anyOf, int startIndex);
public int IndexOfAny(char[] anyOf, int startIndex, int count);
public string Insert(int startIndex, string value);
public static string Intern(string str);
public static string IsInterned(string str);
public bool IsNormalized();
public bool IsNormalized(NormalizationForm normalizationForm);
public static bool IsNullOrEmpty(string value);
public static bool IsNullOrWhiteSpace(string value);
public static string Join(string separator, IEnumerable<string> values);
public static string Join<T>(string separator, IEnumerable<T> values);
public static string Join(string separator, params object[] values);
public static string Join(string separator, params string[] value);
public static string Join(string separator, string[] value, int startIndex, int count);
public int LastIndexOf(char value);
public int LastIndexOf(string value);
public int LastIndexOf(char value, int startIndex);
public int LastIndexOf(string value, int startIndex);
public int LastIndexOf(string value, StringComparison comparisonType);
public int LastIndexOf(char value, int startIndex, int count);
public int LastIndexOf(string value, int startIndex, int count);
public int LastIndexOf(string value, int startIndex, StringComparison comparisonType);
public int LastIndexOf(string value, int startIndex, int count, StringComparison comparisonType);
public int LastIndexOfAny(char[] anyOf);
public int LastIndexOfAny(char[] anyOf, int startIndex);
public int LastIndexOfAny(char[] anyOf, int startIndex, int count);
public string Normalize();
public string Normalize(NormalizationForm normalizationForm);
public string PadLeft(int totalWidth);
public string PadLeft(int totalWidth, char paddingChar);
public string PadRight(int totalWidth);
public string PadRight(int totalWidth, char paddingChar);
public string Remove(int startIndex);
public string Remove(int startIndex, int count);
public string Replace(char oldChar, char newChar);
public string Replace(string oldValue, string newValue);
public string[] Split(params char[] separator);
public string[] Split(char[] separator, int count);
public string[] Split(char[] separator, StringSplitOptions options);
public string[] Split(string[] separator, StringSplitOptions options);
public string[] Split(char[] separator, int count, StringSplitOptions options);
public string[] Split(string[] separator, int count, StringSplitOptions options);
public bool StartsWith(string value);
public bool StartsWith(string value, StringComparison comparisonType);
public bool StartsWith(string value, bool ignoreCase, CultureInfo culture);
public string Substring(int startIndex);
public string Substring(int startIndex, int length);
public char[] ToCharArray();
public char[] ToCharArray(int startIndex, int length);
public string ToLower();
public string ToLower(CultureInfo culture);
public string ToLowerInvariant();
public override string ToString();
public string ToString(IFormatProvider provider);
public string ToUpper();
public string ToUpper(CultureInfo culture);
public string ToUpperInvariant();
public string Trim();
public string Trim(params char[] trimChars);
public string TrimEnd(params char[] trimChars);
public string TrimStart(params char[] trimChars);
Eugen Wiebe
Bernstein AG
CLAD - Certified LabView Associate Developer
Solved!
Go to Solution.

Why I am asking:
I want to create a switch/case-block (case-structure) in labview for this code:
This can be done already with the case structure, you can do simple parsing in the case selector, which takes a string as an input.
Type into the case for first case "XYZ....XYZ~"
Type into next case "DEF...DEF~"
Next case is empty string, default.
How does this work:
The "XYZ...XYZ~"  matches all strings that start with XYZ and have any ascii value after the ~ is the highest printable 7bit ascii value so this catches all other characters.
Option 2 is parse (there are very good reg expression vi in the string palette) the string and create interger value if a matched then habdle the unique integers in the case structure.
There are so many ways to do it without making a wrapper for the .net string class, I provided a few quick methods
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA

Similar Messages

  • Simple String Compression Functions

    Hi all !
    I need two simple String compression functions, like
    String compress(String what)
    and
    String decompress(String what)
    myString.equals(decompress(compress(myString)))
    should result in true.
    Primarily I want to encode some plain text Strings so they are not too easy to read, and compression would be a nice feature here.
    I already tried the util.zip package, but that one seems to need streams, I simply need Strings.
    Any ideas ??
    thx
    Skippy

    It does not do any compression, in fact it does
    expansion to better encrypt the string (about 50%).How does that work? You want encryption to
    decrease entropy.Why in the world do you say that, pjt33? What a very odd statement indeed. I sure hope you don't work in security, or I do hope you work in security if I'm a bad guy, or a competitor.
    Let's say you had a 6-character string you wanted to encrypt.
    Well, if you didn't increase the entropy, any 6-character plaintext string would have a 6-character encoded equivalent. And if you decreased entropy (e.g. coding the most commonly used words to shorter strings,) it gets even easier to decrypt.
    Presumably there would be no hash collisions, after all, you want this to be reversible.
    Hash collisions decrease entropy too, and, by doing so, make it easier to find a plaintext string that happens to hash to a certain value. This is a Bad Thing.
    Now, to decode this, the Bad Guy only has to consider the set of 6-character strings and their hash values. You could even precalculate all of the common dictionary words, and everything with common letters and punctuation, making decryption virtually instantaneous. Especially if you had decreased the entropy in the signal, making fewer things I had to try.
    But somebody who increased the entropy of their signal by adding random bits and increasing the encrypted size of the message to, say, 64 characters, would make it a lot harder to decrypt.
    The ideal encryption system is pure noise; pure randomized entropy. An indecipherable wall of 0 and 1 seemingly generated at random. Statistical methods can't be used against it; nothing can be deciphered from it; it's as decipherable and meaningless as radio hiss. Now that's encryption!

  • How to use an external start button for 6024E w/ sc-2345, I would like it to function like a start button in LabView but I don't know how to connect the external button to the sc-2345's connector block

    I am confused as to how to connect my external start botton. I would like it to function like a start button on a front panel of a VI. I would like to use the +5V on pin 14 but I really don't know where to go from here. Any guidence for a novice would be most appreciated.

    phod,
    This is the LabVIEW Real-Time forum, so I suggest that in the future that you post this type of question to the Multifunction DAQ forum.
    For the simplest solution you will have to connect your button to a digital line of your board, consult the sc-2345 user manual for a diagram of where these lines are exposed. You will have to connect your start button in series with a line that is high, such as your 5V pin or another digital line. Then connect this to a digital line that will be your start trigger.
    Your program can poll the digital line that is connected to your button in a while loop and when it goes high, it lets the rest of the program execute. For the programming, I suggest you take a look at the shipping examples that come with LabVIEW. If yo
    u have LabVIEW 7.0 go to Help>>Find Examples. Open Hardware Input Output>>Traditional DAQ>>Digital Input and Output>>E Series for some examples of digital I/O programming with E-series boards.
    Hope that gets you started.
    Gerardo

  • Is there any function like malloc and free in labview?

    Im writing a vi that will handle my memory request.
    Im doing a very high speed video record sessions , and the frames cant be saves on hardisk in realtime), so im saving the frames on memory, and i want to use memory as
    much as i can(~2GB) and to save the maximum frames that i can save (and it depends on bit depth, height, width, total memory).
    VI Operations={
    Allocate Memory (frame width, frame height,TotalMemorySize) ,
    Add Frame(index) ,
    Get Frame (index),
    Free Memory
    In each record session, there will be a different FrameWidth and Height, so the maximum frame that i can save in memory may be different and equal to
    IndexMax=TotalMemorySize/(FrameWidth*FrameHeight)
    Im doing this by allocating a 3D array [FrameIndex , row , column]
    The fact that the width and height change in different sessions indicate  that i need an ability to free the previous allocated 3D array memory and allocate a new one.
    (lets say that i have 2GB total memory..)

    This request really takes the system and the programmer to the limits....
    First of all:
    LabVIEW does not have any functions like malloc and free. LV wants to prevent the user to have to think about stuff like this. On the other hand, the memory management in LV is therefore hard to do or even impossible, at least to such an extend as you request.
    Some thoughts about your application:
    1. If you want to have about 2GB of framedata in RAM during runtime, you will need the large memory awareness active. Otherwise, a 32 bit OS will give you "out of memory" messages. Refer to the LV help "VI memory usage".
    2. Storing the data in an array could be a difficult task. Arrays have to be in memory without any gap. Therefore, you'd encounter "out of memory" messages even if your RAM totals enough free memory (theoretical).
    3. The idea of linked-lists does not compy in LV since you cannot store pointers to structs (since those are abstracted from the user).
    4. Maybe you should take a look into vision. 
    hope this helps,
    Norbert 
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • Like Ini related functions, is there any functions for reading other functions like .c, .h file

    Hi,
          For reading the *.ini file there are many Ini realted functions. Like that I need in built function in CVI to read the files like
    *.c, *.h line by line. Actually string searching function is not helping me as I want to read it line by line and perform
    the operations in which I am interested.
    Can anyone help me on this?
    Thanks and Regards
    Nagraj B

    It's not clear to me what you are aiming to, but reading a text file line by line can be accomplished by ReadLine () function.
    Parsing the line read to intercept special keyword can be done via regular expression instrument driver, which is included in CVI distribution.
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • How to know the no. of bytes in a String Control Function?

    Hi,
    I would like to know the no. of bytes for a certain String Control Data.
    For instance, if i have a String Length Function, on the left is a String Control and on the right is a Length Indicator.
    If i will type coordinates, i.e. 9.25,4.25 on the String Control it will show 9 on the Length Indicator. I think 9 do not mean 9 bytes but
    only a length. Is there any function in LV that will tell me the total bytes of the data on the string control?
    Appreciate for any advise.
    Thanks a lot.

    Thanks tst for your kind reply.
    Here is what i am trying to find/goal.
    I will be using wireless receiver for my system. The wireless receiver have some signal strength ranges; 95dbm @ 1Mbps (mega bit per sec), 90dbm @ 11Mbps, 82 dbm @ 24 Mbps and 75dbm @ 54 Mbps. Ofcourse i prefer to have lower data transfer rate so that my signal strength is best.
    I will be sending coordinate data/s via wireless communication using string controls. But i do not know how big/heavy is my coordinate data
    If i can know how many bytes or mega bytes the data i want to send then i will be able to transfer it to bits or mega bits(8 bits = 1 byte) thus i will know which setting i can use for the wireless receiver. And if the data is too big then i have a basis to redesign my data transfer to suite a better signal strength.
    Thanks for your help.

  • Pad leading zeros in a string.Format function

    How could use the string.Format function and in the format text pad a leading zero? 
    Pseudo code is:
    string parm = “5”;
    string format = “Some number formatted as 3 dig: Format({0}, 000)”;
    string output = string.Format(format, parm);
    Where the output would look like this:
    “Some number formatted as 3 dig: 005”
    Thanks.

    Thanks everyone. Unfortuantly there's a constraint where the padding operation needs to be embedded in the format string. This entire operatin is being put together dynamically where the format strings are being pulled from a library of format strings stored
    in a database. at runtime we don't know how which format will be used and how many parameters will be passed in. we have logic to handle the unknown number of paramters as there is metadata which helps us with that.
    the need for leading zeros needs to be part of the overall format defined in the format string.  for example, a real format string stored in the database looks like this:
    "LINE_NO = '{0}',  AND GEO_LOCATION = 'T{1}, {2},  R{3}, {4}, , Sec. {5}'"
    and its output from the string.Function is:
    "LINE_NO = 'TG-G2469',  AND GEO_LOCATION = 'T155, N,  R93, W, , Sec. 5'"
    the last parameter (param 5) had a value of 5.  In another case the output requirement might need to look like this:
    "LINE_NO = 'TG-G2469',  AND GEO_LOCATION = 'T155, N,  R93, W, , Sec. 05'"
    note the "05" at the end...
    the logic of using the leading zero needs to be embedded in the overall format string text.
    Thank you.

  • I have transefer function like (1/(s^2+s+​5)) and i have a square wave input , i want to use this transfer function with this input to see the output , how can i do that , with example please.

    i need to know also how to represent this transfer function in labview, try to send me example. answer me at my mail

    "st" wrote:
    > answer me at my mail
    give a valid e-mail first, and your name, we don't like to help anonymous
    people
    > try to send me example.
    how much do you pay ?
    > i have transefer function like (1/(s^2+s+5)) and i have a square wave
    > input , i want to use this transfer function with this input to see
    > the output , how can i do that
    First you have to know what you are doing, like an engineer : you have a
    Laplace, continuous time transfer function but LabView handles discrete
    signals only. Use matlab/simulink if you want to simulate continuous time
    systems easily...
    If you definitely want to use LabView, the first step is to discretize your
    continuous-time transfer function, i.e. decide a sampling rate and convert
    it to a "z transfor
    m". Then you can directly use the "IIR Filter.vi" as I
    said earlier.
    Philippe Guglielmetti - www.dynabits.com me at my mail

  • Searching for Calculation function like "@TONUMBER()" (Business Rules)

    Hello,
    I am searching for a calculation function like "@TO_NUMBER()" or a workaround.
    My current problem is as follows:
    @CONCATENATE("AAA_",(@SUBSTRING("BBB_2010",4) - 1) doesnt work --> SUBSTRING function returns "2010" (as STRING value, but then I cannot substract 1).
    Besides I am missing another function like @TO_STRING(), too, because @CONCATENATE("AAA_",2010) doesnt work - @CONCATENATE expects STRING and not NUMBER.
    Can anybody help?
    Thanks & kind regards
    André

    Hi Krish,
    thanks, but I would like to avoid using cdfs...
    I have another idea, but it doesnt work, too (I opened another thread):
    calculating with temporary variables doesnt work - does anybody knows the reason (and have a workaround for me)?
    Herewith my code:
    VAR varLoopAmount = 15;
    VAR varShiftValue = 1;
    LOOP(varLoopAmount)
    "Schadenquote BOZ" = "Schadenquote BOZ" + @SHIFT(&GCS_SchwaRue_Historie,varShiftValue,@ICHILDREN(&GCS_SchwaRue_Historie));
    varShiftValue = varShiftValue + 1;
    ENDLOOP;
    error message: Detail:(1012004): Invalid member name [varShiftValue]
    Thanks for help
    André
    Edited by: user10660408 on 04.06.2010 12:25

  • Typecasting String to Function in AS3

    Hi,
    I would like to typecast a String to Function. The following is the code snippet,
    var  
    var funcionVar:Function = functionName as Function;
    bt.addEventListener(MouseEvent.CLICK,funcionVar);
    public function onSearch(event:MouseEvent) {
    // Code here
    While converting String to Function, it is returning null value. Is there any possible ways to achieve this?
    Thanks,
    Srinivasan S
      functionName:String = "onSearch" ; 

    This is the code snippet,
    var functionName:String = "onSearch";
    var funcionVar:Function = functionName as Function;
    bt.addEventListener(MouseEvent.CLICK,funcionVar);
    public function onSearch(event:MouseEvent) {
    // Code here
    Could you please help to resolve this?
    Thanks,
    Srinivasan S

  • How do I watch my iTunes movies, tv shows on my mac without having to download them all to my HD?  I really want my Mac to function like my Apple TV since I have just moved and don't have my TV for another few weeks. Help please?

    How do I watch my iTunes movies, tv shows on my mac without having to download them all to my HD?  I really want my Mac to function like my Apple TV since I have just moved and don't have my TV for another few weeks. Since I purchased my three Apple TV. I have had no need to download any of my movies to my Mac.  Which has been great.  However, I remember that I used to now have to do this... or did I?  I am just frustrated because I want to stream all this stuff vice haveing to waiting for it all to download fill up my Mac's HD and then just delete. Someone help please?

    Play the movie in iTunes to stream it.
    Click the cloud icon to download it.

  • CIN: Converting a C String to a LabVIEW String

    Hi all,
    I have been developing CINs in Microsoft Visual C++ 6.0 for LabVIEW as
    project needs. However, I am having a problem with converting a C String
    to a LabVIEW String in CIN.
    I used two ways to try to make the conversion work that were LStrPrintf
    and MoveBlock as stated as following:
    1. LStrPrintf
    #include "extcode.h"
    #include "hosttype.h"
    #include "windows.h"
    struct teststrct{
    const char* test;
    struct teststrct testinstance;
    typedef struct {
    LStrHandle test
    } TD1;
    CIN MgErr CINRun(TD1 *testcluster, LVBoolean *Error) {
    char *tempCStr = NULL;
    strcpy(tempCStr, testinstance.test); // this would cause LabVIEW crash!
    LStrPrintf(testcluster->test, (CStr) "%s", tempCSt
    r);
    // but if I assigned tempCStr as tempCStr = "test", the string value
    "test" could be passed to LabVIEW without any problems.
    2. MoveBlock
    #include "extcode.h"
    #include "hosttype.h"
    #include "windows.h"
    struct teststrct{
    const char* test;
    struct teststrct testinstance;
    typedef struct {
    LStrHandle test
    } TD1;
    CIN MgErr CINRun(TD1 *testcluster, LVBoolean *Error) {
    char *tempCStr = NULL;
    int32 len;
    tempCStr = (char *)&testinstance.test; //since strcpy didn't work, I
    used this way to try to copy the const char* to char*.
    len = StrLen(tempCStr);
    if (err = NumericArrayResize(uB, 1L, (UHandle*)&testcluster->test,
    len))
    *Error = LVFALSE;
    goto out;
    MoveBlock(&tempCStr, LStrBuf(*testcluster->test), len); // the string
    was able to passed to LabVIEE, but it was unreadable.
    out:
    Did I do anything wrong? Any thougths or suggestions would be very
    appreciated!

    Thank you so much for your response, Greg. However, I still have problem after making
    corresponding modification for LStrPrintf approach:
    int32 len;
    char tempCStr[255] = "";
    strcpy(temCStr, testinstance.test);
    len = StrLen(tempCStr);
    LStrPrintf(testcluster->test, (CStr) "%s", tempCStr);
    LStrLen(*testcluster->test) = len;
    LabVIEW crashes. Any ideas?
    Greg McKaskle wrote:
    > The LStrPrintf example works correctly with the "test" string literal because
    > tempCStr= "test"; assigns the pointer tempCStr to point to the buffer containing
    > "text". Calling strcpy to move any string to tempStr will cause
    > problems because it is copying the string to an uninitialized pointer,
    > not to a string buffer. There isn't anything wrong with the LStrPrintf
    > call, the damage is already done.
    >
    > In the moveblock case, the code:
    > tempCStr = (char *)&testinstance.test; //since strcpy didn't work, I
    > used this way to try to copy the const char* to char*.
    >
    > doesn't copy the buffer, it just changes a pointer, tempCStr to point to
    > the testinstance string buffer. This is not completely necessary, but
    > does no harm and is very different from a call to strcpy.
    >
    > I believe the reason that LV cannot see the returned string is that the
    > string size hasn't been set.
    > Again, I'm not looking at any documentation, but I believe that you may
    > want to look at LStrLen(*testcluster->test). I think it will be size of
    > the string passed into the CIN, and it should be set to len before returning.
    >
    > Greg McKaskle
    >
    > > struct teststrct{
    > > ...
    > > const char* test;
    > > ...
    > > };
    > >
    > > struct teststrct testinstance;
    > >
    > > typedef struct {
    > > ...
    > > LStrHandle test
    > > ...
    > > } TD1;
    > >
    > > CIN MgErr CINRun(TD1 *testcluster, LVBoolean *Error) {
    > >
    > > char *tempCStr = NULL;
    > >
    > > ...
    > >
    > > strcpy(tempCStr, testinstance.test); // this would cause LabVIEW crash!
    > > LStrPrintf(testcluster->test, (CStr) "%s", tempCStr);
    > > // but if I assigned tempCStr as tempCStr = "test", the string value
    > > "test" could be passed to LabVIEW without any problems.
    > >
    > > ...
    > > }
    > >
    > > 2. MoveBlock
    > >
    > > #include "extcode.h"
    > > #include "hosttype.h"
    > > #include "windows.h"
    > >
    > > struct teststrct{
    > > ...
    > > const char* test;
    > > ...
    > > };
    > >
    > > struct teststrct testinstance;
    > >
    > > typedef struct {
    > > ...
    > > LStrHandle test
    > > ...
    > > } TD1;
    > >
    > > CIN MgErr CINRun(TD1 *testcluster, LVBoolean *Error) {
    > >
    > > char *tempCStr = NULL;
    > > int32 len;
    > > ...
    > >
    > > tempCStr = (char *)&testinstance.test; //since strcpy didn't work, I
    > > used this way to try to copy the const char* to char*.
    > > len = StrLen(tempCStr);
    > >
    > > if (err = NumericArrayResize(uB, 1L, (UHandle*)&testcluster->test,
    > > len))
    > > {
    > > *Error = LVFALSE;
    > > goto out;
    > > }
    > >
    > > MoveBlock(&tempCStr, LStrBuf(*testcluster->test), len); // the string
    > > was able to passed to LabVIEE, but it was unreadable.
    > > ...
    > >
    > > out:
    > > ...
    > >
    > > }
    > >
    > > Did I do anything wrong? Any thougths or suggestions would be very
    > > appreciated!

  • Left outer join functions like simple join

    I created two views SCO_REQGROSSLINES_V & SCO_REQLINESCOMPLETE on Oracle requisitions base tables. Our business rules enforce the following identity: the number of gross requisition lines will always be greater than or equal to the number of requisition lines complete. (By complete I mean delivered.)
    Each view has a key named DATESUBINV_KEY constructed of a transaction date and the subinventory code using this logic:
    , TO_CHAR(TRUNC(transaction_date),'YYYYMMDD') || subinventory_code
    On 03-SEP-2010 a user created a requisition with one line item for material from the HEAT subinventory which was not delivered. This row is retuned in the result set when I query on SCO_REQGROSSLINES_V but is NOT returned when I query on SCO_REQLINESCOMPLETE. So far so good.
    When I issue either of the the following left outer joins I do not get the row for the row for the HEAT subinventory on 03-SEP-2010:
    select rgl.trxn_date
    , rgl.subinventory
    , rgl.line_count gross_line_count
    , rgl.ext_prc gross_value
    , rlc.line_count lines_filled
    , rlc.ext_prc lines_filled_value
    from SCO_REQGROSSLINES_V rgl left outer join sco_reqlinescomplete_v rlc
    ON rgl.datesubinv_key = rlc.datesubinv_key
    where rgl.TRXN_DATE BETWEEN to_date('29-AUG-2010') AND to_date('04-SEP-2010')
    and rlc.trxn_date BETWEEN to_date('29-AUG-2010') AND to_date('04-SEP-2010')
    order by rgl.trxn_date, rgl.subinventory
    select rgl.trxn_date, rgl.subinventory
    , rgl.line_count gross_line_count
    , rgl.ext_prc gross_value
    , rlc.line_count lines_filled
    , rlc.ext_prc lines_filled_value
    from SCO_REQGROSSLINES_V rgl
    , sco_reqlinescomplete_v rlc
    where rgl.TRXN_DATE BETWEEN to_date('29-AUG-2010') AND to_date('04-SEP-2010')
    and rlc.trxn_date BETWEEN to_date('29-AUG-2010') AND to_date('04-SEP-2010')
    AND rgl.datesubinv_key = rlc.datesubinv_key(+)
    order by rgl.trxn_date, rgl.subinventory
    Question: Why would the left outer joins function as a simple join on DATESUBINV_KEY? Do keys on views function differently than keys defined in the data dictionary? If they do how can I make these keys to function like data dictionary keys?

    Hi,
    The WHERE clause is applied after the outer join is completed. In your example, rows from rgl will be in the result set even if they have no match in rlc. In those cases, all the columns from rlc will be NULL.
    Okay, so you have these rows that contain data from rgl but NULLs where the data from rlc was supposed to go. Now it's time to start the WHERE clause. You then apply conditions like this in the WHERE clause:
    AND     rlc.trxn_date BETWEEN ...NULL is between anything, so the row that the outer join prodeuced is rejected.
    All conditions involivn columns from rlc probably need to be part of the join condition, not the WHERE clause.
    For example, in you first query the FROM and WHERE clauses might be:
    FROM          sco_reqgrosslines_v      rgl
    LEFT OUTER JOIN  sco_reqlinescomplete_v  rlc  ON    rgl.datesubinv_key   = rlc.datesubinv_key
                                            AND   rlc.trxn_date       BETWEEN TO_DATE ( '29-AUG-2010'
                                                                        , 'DD-MON-YYYY'
                                                  AND       TO_DATE ( '04-SEP-2010'
                                                              , 'DD-MON-YYYY'
    WHERE   rgl.trxn_date     BETWEEN TO_DATE ( '29-AUG-2010'
                             , 'DD-MON-YYYY'
                   AND     TO_DATE ( '04-SEP-2010'
                             , 'DD-MON-YYYY'
                             )Always use (at least) two arguments when calling TO_DATE.
    Conditions that only involve rgl can be in the WHERE clause, but if any conditions from rlc are in the WHERE clause, then the effect will be the same as an inner join.
    There no difference between tables and views (or sub-queries) in this regard: the same thing would happen regardless of whether rgl and rlc were really tables or not.

  • Does oracle have similar functionality like MsSql "for xml path('')"

    Does oracle have similar build in functionality like MsSql “for xml path(‘’)” , or in another word, it can enforce the result set(multiple rows) into ONE line such kind of presentation way.
    Thanks in advance. Any help would be greatly appreciated.

    Here I would like specify my question mnore clearly,
    CREATE TABLE t(
    line NUMBER(3),
    site VARCHAR2(4),
    phase VARCHAR2(5),
    test VARCHAR2(25));
    INSERT INTO t VALUES (1, '0100', '*','1111111111111111111111111' );
    INSERT INTO t VALUES (2, '0100', '=','2222222222222222222222222' );
    INSERT INTO t VALUES (3, '0100', '=','3333333333333333333333333' );
    INSERT INTO t VALUES (4, '0100', '*','4444444444444444444444444' );
    INSERT INTO t VALUES (5, '0100', '=','5555555555555555555555555' );
    INSERT INTO t VALUES (6, '0200', '*','6666666666666666666666666' );
    Here I want to retrieve the 'line' column information in ONE line way
    select line from t I want the result is like '1,2,3,4,5,6'
    Any generous help would be greatly appreciated!!!

  • [SOLVED]:Is it possible to use functions like decode in 'setWhereClause()'?

    Hello,
    My requirement is that I have 2 poplists - Country and States.
    When I select a country,the corresponding states of that country should get populated in the states poplist.
    The approach I took is that :
    I selected firePartialAction as ActionType in Country poplist. Then I called a function to VOImpl of StatesVO and set the where clause there.
    Now I was thinking about using decode as there is no direct connection between the CountryVO and StatesVO.
    Is it possible to use functions like decode in 'setWhereClause()'?
    For Example:
    setWhereClause("DECODE(LOOKUP_TYPE,'XXC_IND_STATES','IND','XXC_US_STATES','US') = :1");
    setWhereClauseParam(0,Country);
    executeQuery();
    When I tried running the page,no error was given but when the country poplist was changed - there is no change in states poplist.
    If its not possible to use decode in setWhereClause(), could you please guide me as to how I can write a query to retrieve a value from a table and store it in a variable 'A'- so that I can pass that variable 'A' in setWhereClauseParam function .
    Message was edited by:
    Anju Susan

    That kewl, but for u knowledge u can add anything in ur where clause of query through ur code in Voimpl class. It is even possible to do change entire query, see Voimpl class methods in javadoc.
    --Mukul                                                                                                                                                                                                                                                                                                                                                                                                                           

Maybe you are looking for

  • Anyconnect SSL VPN Authentication Feilure

    Dear All, I have configured an Asa 5510 as SSL vpn gataway ver 8.2(4) Anyconnect Essential. The clients are authenticated via Radius and OTP password. All work well since yesterday. When I have did same configuration changes. My objective was has tha

  • Formula in Crosstab to calculate group totals

    Hi, I want to do a cross tab as following: ......................January.................. February.................................->up to current month.......... total per year ................. 2010.....2011............2010.....2011...............

  • Derived table query size limit 65KB?

    Hi.  When in Edit Derived Table, if I paste a query larger than about 65KB, the end of the query will be cut off.  Then I must create multiple Derived Tables.  Has anyone else experienced this?  Do you find the limit to be about 65KB? Thanks, Mike

  • Runtime Error while opening KM Content

    HI All,           We are experiencing a problem, when we open the KM content, we get a run time error, which says: An exception occured while processing the request. Additional information: null Exception ID = 8048f24e-bd16-2c10-1a97-898d02a52ffc Cou

  • Include PKGBUILD etc. in actual packages?

    I'm sure this must have been asked or requested before, but couldn't find any trace of it, so here goes: Would it not be helpful under various circumstances to have all the building stuff for a package (i.e. that which you would find in the abs direc