How convert string to number

How convert string to number

my character

Select form double to_number ('1,6,9,4'); my putting here 1,6,9,4

get the character of number conversion error.


Published by: vr on March 31, 2011 23:59

Published by: vr on March 31, 2011 23:59

VR says:
Getting error while the conversion of character to the number in instring is possible to get the position of the channels at one time

I have the following table, called pack

Acct_No pack2 pack3 pack1
1000 10101011 111111101 01010101111

Select * Pack
where instr (pack2, ' 1') and * (to_number (replace('1,6,9,4',','))); * - getting values of function as string '1,6,9,4'

If you want to retrieve lines where the position of the first "1" in the pack2 chain is one of the positions in your list number e.g. position 1, 6, 9, or 4?

Something with regexp_like can help...

SQL> ed
Wrote file afiedt.buf

  1  with pack as (select '1000' as acct_no, '10101011' as pack1, '111111101' as pack2, '01010101111' as pack3 from dual union all
  2                select '1001', '10101011', '000011111', '10101010110' from dual union all
  3                select '1001', '10101011', '000000001', '10101010110' from dual)
  4  --
  5  -- end of test data
  6  --
  7  select pack.*, case when regexp_like('1,6,9,4','(^|,)'||to_char(instr(pack2,'1'),'fm9999')||'(,|$)') then 'Yes' else 'No' end as x
  8* from pack
SQL> /

ACCT PACK1    PACK2     PACK3       X
---- -------- --------- ----------- ---
1000 10101011 111111101 01010101111 Yes
1001 10101011 000011111 10101010110 No
1001 10101011 000000001 10101010110 Yes

Tags: Database

Similar Questions

  • How to convert string to number in TS?


    Anyone know how to convert string to number in TS?

    I couldn't find the Num() function.

    Thank you


  • [JS] Convert String to number (decimal)


    I have a variable with the string value "12,5 ', I have to convert it to a number and kept his reckless.
    How to convert the comma point?

    Thank you.


    Hello ,

    I one variable with the string value " 12 5 , I need to convert to decimal number and kept sound. "
    How to convert le decimal point in ?

    Thank you .

    He is there not a function?

    Non; in fact, the majority of programming languages are hardcoded to the American conventions. But the charge to replace it if necessary is tiny.

    You might have a similar problem, if someone enters a number of thousands separators: '12.500,0' If you replace the comma with a period, "parseFloat ("12.500.00")" Fortunately will read the number, all the way to the next ' invalid' character, which corresponds to the second period. And then he'll "12.5"...

  • How to convert string to number

    Hi everoyne, I need to make a program simple calculation of the GPA in 5 classes. Where A, B, C, D, F are the entries for each other...

    Here's what I've done so far.

    But it seems that it is not recognized when I assigns numeric values to each letter. So I would appreciate any help. I tested for the release of "GP" and input A (4) = CT. The answer for GP should be 4 x 3 = 12. But I get a number beyond that.

    I'm relatively new to Labview so sorry if this is a stupid question.


    I would like to make a table of the clusters.  Each element of the array corresponds to a single course.  Inside of the bunch, I would have a string for the name of the course, an enum for the grade and a digital for the number of credit hours.  Use an enum for the grade, so you can make sure that the user space only in the values that you no longer the enum is actually a number.  No actual conversion.  Then you just use a loop FOR (autoindexing) including some shift registers to keep your totals, then divide the totals of the year by the credit hours.

  • OpenScript/Bank of data/how to convert string to int


    As far as I know, the values read from the database is a type of Sting. Now, I want to convert a character number stored in the database of type int.
    For example, in "Test.csv" I stored the '9' in the column 'Number' character, then I use the following code to read the character and convert an int in one:
    getDatabank("Test").getNextDatabankRecord ();
    String Testnumber = "{{db." Test.Numberr}} '; Info (Testnumber);
    int number = Integer.parseInt (Testnumber);

    However, it seems this does not work, because he says "basic unexpected failure caused by: NumberFormatException occurred." For the input string: «{{db.» Test.Numberr}}.
    I think that this error can be caused by the conversion of character '9' int 9.
    Can someone tell me how to convert a character to be read from database in an int?

    Thank you very much!

    Kind regards


    You can use the same approach. Use eval()

    String Testnumber =eval("{{db.Test.Numberr}}") ;
    int number = Integer.parseInt(Testnumber);

    Kind regards
    Dembélé M

  • Whole singed to hexadecimal string to number converter

    HI guys...

    I want to convert the number to hex string to number converter but when I connect integer, otherwise it does not change the value (as if you write 'EC78' you should get "-5000", but I get the value in the range of 60 thousand ")...

    Any ideas?

    Thanks in advance...


    Hi Eric,.

    clearly, the OP asked for signed integers!

    Use this approach:


    It will mean by '-' 5000 for your example EC78h...

  • How to convert a large number to the spell without truncate to 32-bit.

    I'm trying to convert a hexadecimal number (string). The number is truncated to 32 bits, which is not what I want. For example, the number 28037546508295 (double) must be 0 x 198000000007. LabVIEW truncates and the resulting string is 0x7FFFFFFF, using number of Hex I'm stuck. Thank you.

    'Number of hexadecimal string' accepts only data of I32. So, you should see a red dot of coercion when you connect your floating point number.

    You must use "Format of value" (also in the String > number of rope/coercion-pallet) and use '%x' as a format string.

    hope this helps,


  • How to convert string input streams

    Can someone tell me how to convert string input streams...

    There are multiple ways. I will list down few of them.

    With the help of the old solution and standard java.

    publicstaticString fromStream(InputStream in)throwsIOException


       BufferedReader reader =newBufferedReader(newInputStreamReader(in));

       StringBuilder out =newStringBuilder();

       String line;

       while((line = reader.readLine()) !=null) {






    If you use Google-Collections/guava-

    InputStream stream = ...

    String content = CharStreams.toString(newInputStreamReader(stream, Charsets.UTF_8));


    If you use the common Apache library... then it is worthwhile.

    StringWriter writer =newStringWriter();

    IOUtils.copy(inputStream, writer, encoding);

    String theString = writer.toString();

    Quick way but only work during deserialization.

    String result = (String)newObjectInputStream( inputStream ).readObject();

    Note: ObjectInputStream is on deserialization and the flow of data must respect the Protocol of serialization to work, which may not always true in all cases.

    Ultimately, the most effective solution and only in two lines using java class Scanner.

    Tricky is to remember the \A regex that matches the beginning of the entry. It actually indicates Scanner to mark all of the flow, from start to beginning next (illogical).

    publicstaticString convertToString(InputStream in) {

       java.util.Scanner s =newjava.util.Scanner(in).useDelimiter("\\A"); 


       returns.hasNext() ? :"";


    Read more:

  • How to convert Datetime in number?



    SELECT c.chg_date_time, TO_DATE('01011900','DDMMYYYY') + CHG_DATE_TIME OF CHNGHIST C

    After that, run:
    2010-03-30 11:48:29

    In the above query, convert us number to datetime.

    Now, I want to convert Datetime in number.

    i.e., 03-30-2010 11:48:29 =? (40265.492)

    Thank you

    Simply activate your expression.

    not tested

    SELECT to_date('30/03/2010 11:48:29','dd/mm/yyyy HH24:mi:ss')-TO_DATE('01011900','DDMMYYYY') FROM dual;
  • String conversion number

    Hi all

    I need to convert the string like "-73.28" to the number - 73.28. With decimal string to number Vi I get only - 73,00 output with "-73.28" Dim input As string. What I've done wrong? How to get the required results? Also, note that it must be. the number of output!

    Thank you!

    Hi Nina,

    Firstly: have the decimal separator ',' in a digital indicator is just for aesthetic purposes, you can always calculate using the value...

    (1) you can change the settings of the operating system (Win: settings regional aka regional Einstellungen). I do this for all my computers as it seems "natural" for me when working with scientists/measurement data

    (2) you can move LV to ignore the decimal separator system settings - you will find in the dialog box options...

    But when using properly formatted output functions you do not need to change any setting...

  • String to number conversion problem

    I have a VI that pulls in data from a device using VISA, and I got it on another computer to work a few weeks back. I had to transfer the VI to a laptop computer to run a few tests, and now I can't make it work. I am unable to put my VI because the laptop on it's is unable to access the network companies, I will do my best to explain it all, I apologize for the inconvenience! My problem is not however with VISA, it's with an exit VISA number conversion chain.

    I have attached a painting drawing of VI to better explain it.

    I use the block series Visa football match in baud rate and all that many good things to the unit and port settings set of device management. Then, a while loop is entered. The loop will run until you press the stop"" button. The next block of visa is the writing block, he asks for a reading of the device. The next block of visa is the first block of reading, he returns playback in the form of "NA-XXX. X' where x are numbers. The next block of visa is the second reading block, this block just echoes back the command sent to the device. Playback of the first visa read block, "NA-XXX. X' is going exponential/fractional chain to digital converter.

    When you perform a run/debug to highlight run, the release of visa reports the correct value, is the value of the device reading - however the string to number converter generates a 0,000, no matter what channel number is. I am at a loss as to what may be wrong because it's the EXACT set up I had to work very well a few weeks ago!

    I'm using Labview 10 on the laptop, the old computer was labview 7. I'm guessing that this is perhaps the rub... I Redid the VI from scratch, although I have not opened the old VI in labview 10.

    Any help would be appreciated. Again, sorry I am unable to attach the VI.

    DARB wrote:

    I have attached a painting drawing of VI to better explain it.

    Would it not have been easier to just post a screenshot? You might also have used the Tool of Capture of Code. (Which reminds me that I need to install it to my previous versions of LabVIEW, as evidenced by the screenshot I took. )

    As to the question: you probably either:

    • employee analysis of chain initially and when you rewrote the VI you used the regular string conversion functions.
    • Wired an offset value in the string to the number function.

  • Sub - VI with the entry as a string og number

    At this small Subvi. I wonder if I could make it more flexible and be able to take the string and number as a value ('value dbl' market) entry.  Is there some sort of variable of variant type that could be used?

    Michael.Koppelgaard wrote:

    At this small Subvi. I wonder if I could make it more flexible and be able to take the string and number as a value ('value dbl' market) entry.  Is there some sort of variable of variant type that could be used?

    It is possible with the key to write OpenG (varying) But the problem is that when you want to read this back, you need to know what type it is. If you write to a different section of the config file each with a specific type, the TI will work. With this solution, you must use the key to reading OpenG (varying) to read and convert the value to LV

    Another way is to use Get Type of the Variant Data Type palette. The trick here is to convert double or string before saving it in the config file (wire structure dealing with the output type of the vi and do conversions in the case of type dbl and string). Here, too, you must use a different section, one for dbl for string. Here, you use the standard Read button live file configutaion palette.


  • How to detect the number of channels on an oscilloscope?

    I have various models sitting around the laboratory, some two-channel, a few four-channel oscilloscope.  I would like for my program to be able to detect the number of channels is available.

    I can just tell my program how much string is available based on the model number, but is there a VISA command to request scope directly what channels he has?  I would also be able to ask what, if any, ability to function math there.

    "all drivers of the oscilloscope must return the instrumentID after initialization, and that should be enough to know the number of channels.

    What Albert was referring to is that all compatible drivers IVI in their base class interface have an attribute/property that indicates how many channels has the scope.

    If you don't want to use the driver of the IVI for the scope then maybe download some of the drivers and check the source code to see how they calculate this dynamic repeated capablity.

  • convert string to float


    I would like to convert string to float. I have a text which float to string contents of the file number.

    for example:

    10,000 2 of. 1.32323 0000 these channels I would like to convert float or double number.

    Help, please!

    I use the string of spreadsheet in table vi and I need to properly adjust the format string.

    %.; %f

    Thank you all!

  • How can I find number of objects in a layer?

    I have a document with hundreds of layers. I want to delete the specific purpose of layers. I iterate through all the layers, but I couldn't iterate over objects within a single layer to find that specific object.

    I there a way I can go through all objects in the layer?


    How can I find number of objects in a layer?

    I'm going through the API documents but could not find.

    Here is the code I wrote,

    var artLayer = undefined;
            if(app.documents.length == 0)
            var myDocument = app.activeDocument;
            var layerCount = myDocument.layers.length;
            for (var index = layerCount - 1; index >= 0; index-- ) 
                var targetLayer = myDocument.layers[index];
                var layerName = new String( );
                if(layerName == "Colorways")
                    artLayer = myDocument.layers[index];
                    //Can I iterate through objects in a layer??
    //                for(var newIndex = 0; newIndex < artLayer.items.length;newIndex++)
    //              {
    //                    Need something like this
    //                }

    instead of points, you should use "pageItems.

    for (newIndex var = 0; newIndex)< artlayer.items.length;newindex++)="" there="" is="" no="" "items"="">

    for (newIndex var = 0; newIndex)<>

    or as in your second post, instead of the activeDocument, target your layer



Maybe you are looking for

  • How can I transfer video from my ipad on my mac

    How can I transfer video from my ipad on my mac

  • Driver Windows XP for LCDs

    Hello! This topic can be placed so apologies in advance, but I was wondering if Toshiba have created all of the Windows XP Display drivers for LCD screens? I have a Toshiba 26WL36 LCD monitor capable of producing a resolution of 1280 x 768. However,

  • connect a controller without opc Server

    Hi, I can connect a controller for labview 7.1 (to send and read the data) without an opc server, using only one cable rs232 of the plc to the pc.

  • Unknown channel or feature name repeated

    Hello I want to connect NI SMU-5451(waveform generator) and NI-SMU-7966R(Flex RIO) with peer-to-peer technology. I took an example of NOR-FGEN, which works perfectly, but when I use it in my project there is a mistake takes place - the "unknown chann

  • How to convert data from XY graph for type ' signal in "for measurement functions

    Hi all, I have a driver file that generates the screenshot XY graph.  I want to measure the period, using the measurement functions in the LabVIEW palette.  Can someone tell me how to convert this type of signal "in".  The X (time) and Y (power) are