Read/write function reads a bad value?

HY,

I'm using on my FPGA OR Quadrature encoder.

(http://www.ni.com/white-paper/6608/en/)

I add a few entries, so that its possible to set an offset value.

In all the VI on the FPGA, works very well with my encoder.

If I start the VI on my FPGA, the position value is 0, because of the "first round"? Element.

Now, I used the command of read/write in a while loop on my host VI to get the current value of the encoder.

After I start my host vi the defiler position always shows the value "2".

If I use the highlight function, the value remains at '0 '.

This is a really strange behavior, I don't know what can be the cause of this problem.

All positionsoffset values are 0 and encoders on my 9401 module entries are tied to the land.

The position value is only written on the fpga, nowhere else.

Anyone have any idea why?

Thank you very much.


Tags: NI Software

Similar Questions

  • read the independent values in a channel

    Hello

    I want to read the value of a chanel.

    I guess that every chanel's store as an array with an index and a value.

    I would like to read a value of a chanel with its index number, then do some calculations, and then write to it.

    For example:

    Chanel 1:
    index value
    1           1
    2           1
    3           1
    4           2
    5           1
    6           1

    start index = 0
    value > 1?
    If no control of the following
    If so do something

    Do you have a sample script to read a unique value in a chanel?

    Kind regards

    Frédéric MANUAL

    OK, so it should work

    Dim oChn, K, value
    "Go to the channel you are interested in.
    Set oChn = data. GetChannel ("Time")

    ' loop through all the values
    For K = 1 To oChn.Size
    Value = oChn (K)
    If (value > 1) then
    "do something
    MsgBox ("value WG 1")
    End If
    Next

  • Read the last value of a large file of PDM

    Hello everyone!

    I hope someone can help out me with this one.

    I try to put in place a program that can read the last value of one of the large channels of different TDMS files but I just can´t find a way to do it.

    I would appreciate help for my little problem.

    Thank you very much in advance for your support.

    Kasim.

    Hello

    You can use the following playback TDMS Set Position feature included in the PDM API.  This function receives a parameter called "(0:start)", which can be set to 1 to go to end of the file.  In this way, you can read the last value written to the PDM file.

    I hope this helps!

    Anuar Rojas

  • Procedure is not reading/returns all values

    The SP below reads in business_date as an input parameter.
    The procedure should calculate this value MAX in a range
    (ln_business_date) and this value must be used throughout the rest of the
    operating mode.
      SELECT MAX(business_date
          INTO ln_business_date
          FROM proof;
    The procedure returns the name of 'missing_tbl_name' of the INTO clause as the OUT parameter
    However, the performance of the SP_MONTHLY_ASSET procedure below I don't get not all values. The procedure
    Compiles without error but I think that my procedure is bad work and not read or return values
    correctly.

    Any help is greatly appreciated.

    CREATE OR REPLACE PROCEDURE SP_MONTHLY_ASSET(
        business_dt_num IN NUMBER DEFAULT NULL, 
        missing_tbl_name OUT NOCOPY VARCHAR2
    )
    IS
       ln_business_dt_num NUMBER;
       bad_date_value EXCEPTION;
    BEGIN
       IF business_dt_num < 0 
       THEN
          RAISE bad_date_value;
       ELSE
        SELECT MAX(business_dt_num)
          INTO ln_business_dt_num 
          FROM sasor.dp_ca_proof@psasr
    
          SELECT data_table_name
          INTO missing_tbl_name 
          FROM ( 
             SELECT whatever 
             FROM tablename
             WHERE some_condition MINUS 
             ( 
             SELECT whatever
             FROM secondtablename
             WHERE business_dt_num = ln_business_dt_num 
              UNION 
             SELECT whatever 
             FROM tablename
             WHERE business_dt_num = to_number( substr('&datenum',1,6) || '01' ) 
             )
               );
       end if;
    EXCEPTION
        WHEN bad_date_value 
       THEN
          raise_application_error ( -10001, 'Incorrect date ...');
    END;

    There is an exception no_data_found because there was no data found. This subquery:

             SELECT UPPER(data_table_name) data_table_name
             FROM filespec
             WHERE data_table_name IN ('SSBBALIN', 'LPLAPRA',
             'DSTASSET', 'EDJBALIN', 'APLASSET', 'HARTFORDDC',
             ' WLFBALIN', ' MSTBALIN', ' STFAPRA', ' RJABALIN',
             ' JYMAPRA', ' RBCBALIN', ' UBSBALIN',
             ' MERRILL_UMA_MAN', ' MERRILL_MAA_MAN') MINUS (
             SELECT UPPER(fus_data_table_name)
             FROM dp
             WHERE business_date = ln_business_date
             AND fus_data_table_name IN (' SSBBALIN',' LPLAPRA',
             ' MGNAPRA', ' DSTASSET', ' EDJBALIN', ' APLASSET',
             ' HARTFORDDC',  ' MSTBALIN', ' STFAPRA',
             ' RJABALIN', ' JYMAPRA', ' RBCBALIN', ' UBSBALIN',
             ' MERRILL_UMA_MAN', ' MERRILL_MAA_MAN')
             GROUP BY UPPER(fus_data_table_name) UNION
             SELECT UPPER(fus_data_table_name)
             FROM dp
             WHERE business_date = to_number( substr('201111',1,6) || '01' )
             AND fus_data_table_name = 'HARTFORDDC'
             GROUP BY UPPER(fus_data_table_name) )
    

    Nothing found. If you want to return just ' lack of support: "If the subquery is empty when what you need is:

    BEGIN
      SELECT 'Missing Load : ' || data_table_name
           INTO missing_tbl_name
          FROM (
             SELECT UPPER(data_table_name) data_table_name
             FROM filespec
             WHERE data_table_name IN ('SSBBALIN', 'LPLAPRA',
             'DSTASSET', 'EDJBALIN', 'APLASSET', 'HARTFORDDC',
             ' WLFBALIN', ' MSTBALIN', ' STFAPRA', ' RJABALIN',
             ' JYMAPRA', ' RBCBALIN', ' UBSBALIN',
             ' MERRILL_UMA_MAN', ' MERRILL_MAA_MAN') MINUS (
             SELECT UPPER(fus_data_table_name)
             FROM dp
             WHERE business_date = ln_business_date
             AND fus_data_table_name IN (' SSBBALIN',' LPLAPRA',
             ' MGNAPRA', ' DSTASSET', ' EDJBALIN', ' APLASSET',
             ' HARTFORDDC',  ' MSTBALIN', ' STFAPRA',
             ' RJABALIN', ' JYMAPRA', ' RBCBALIN', ' UBSBALIN',
             ' MERRILL_UMA_MAN', ' MERRILL_MAA_MAN')
             GROUP BY UPPER(fus_data_table_name) UNION
             SELECT UPPER(fus_data_table_name)
             FROM dp
             WHERE business_date = to_number( substr('201111',1,6) || '01' )
             AND fus_data_table_name = 'HARTFORDDC'
             GROUP BY UPPER(fus_data_table_name) ));
    EXCEPTION
      WHEN no_data_found THEN
        missing_tbl_name := 'Missing Load : ';
    END;
    
  • Read the output values after each step runs in the User Interface of LabVIEW

    Hi all

    Development environment: TestStand 2010 SP1 and LabVIEW 2010 SP1

    Problem: is there a way to run the following steps programmatically and get values out of each of them?

    I have already extended a bit a complete interface IO for TestStand load any sequence, choose among the measures and execute step by step (something as an alternative to the steps run selected). What I'm trying to do is to add some actions between each step and do in the UI (I can't change the sequence!), so I start the NewExecution with some previously configured InteractiveArgsParam and option breakAtFirstStep set to true. Eventually I do just something like step over when debugging the sequence and it works well, but I didn't do well a way yet to read the output values of the place...

    So, if I wait before the end of the run I can read my results by treating the ResultObject, but it works only after the completion of the test sequence. Because I wanted to stop after each step, read the values, do some actions and continue to the next step, I've tried to register a running Trace event reminder View Manager. I see that after each step is executed, this event is fired, but when I try to read that a ResultObject returned in the event data it is not filled with values (ResultList seems to be empty?). Is this a correct behavior or maybe I'm reading the wrong way? (It's the same VI regarding the reading of the ResultObjects after the sequence ends and there it works very well for tables, containers and other types of data).

    As I mentioned I can't change Test sequences, I can not add a UImessages.

    What are my options? If the trace event returns output all the values from each steps or is it just used to check the status? Or maybe there's a completely different approach to this issue?

    Thanks in advance for your suggestions,

    Best regards.

    When you manipulate the UIMessage trace (you need this before the return of the event or you will present the race conditions), download myuimessage. Thread. Then call Thread.GetSequenceContext (0, & Iplease).

    And then on the context of the sequence, either go to PreviousStep.Result if it exists, or watch Locals.ResultList.

    Trace events occur between the steps executed step the more recently is the previous step, but it is also a trace event to the beginning before any measure have run at this time, there will be a previous step.

    Hope this helps,

    -Doug

  • MAX is reading my PLC values as decimal type, but they are BCD

    I have a Koyo sold by Automation direct plc.  All values of the automaton are BCD, but in the measurement and Automation Explorer, they are read as decimal values.  Does anyone know how to convert, OPC server is on the MAX so that I can read my values, because they are?  The database of the Citadel is useless for me without eigenvalues.  Belvedere offers the possibility of advertising ": b ' to your tags to read as BCD.  LabVIEW tools and it offers a similar way?

    Your opc server program should have a specific format for reading the data of the BCD. Here is some info for kepware.

    http://www.KEPware.com/KEP_KB/default.asp?TODO=view&questId=426&CATID=59

    There is an option to specify how the word is interpreted in the kepware opc server program. Here is the info of help files.

    Address of DL - 450

    Data types (default values are shown in bold).

    Type of memory

    Reference

    Types of data

    E/S

    X, Y, GY, GX

    Boolean

    Devices of

    S T, CT, C, MS,

    Boolean

    Data words

    V

    Boolean, short, Word, DWord, Long, LBCD, Float, String,.
    BCD (default for the timers and counters only)

  • Mathmatical function to return the value in injectors

    Hello
    I have obliged. If value for ex Lake 4400000, he should return as 4.4millions even for billions.
    is there an oracle function to return the value in this format. ???

    Hello

    When I want to have a "readable" released in large numbers, I use to do the following:

    Scott@my11g SQL>with t as (
      2  select 3456123456 n from dual
      3  union all select 4567123 from dual
      4  union all select 123465 from dual
      5  )
      6  select n, case when n>1000000000 then trunc(n/1000000000,1)||' Billions'
      7  when n>1000000 then trunc(n/1000000,1)||' Millions'
      8  else to_char(n) end fmtn
      9  from t ;
    
             N FMTN
    ---------- -------------------------------------------------
    3456123456 3.4 Billions
       4567123 4.5 Millions
        123465 123465
    

    ------
    * + [change] + *.
    Moreover, lakh [url http://en.wikipedia.org/wiki/Lakh] has no meaning outside of South Asia.
    Especially for a French man like me, grown with [url http://en.wikipedia.org/wiki/International_System_of_Units] International system of units that is fighting against what I call "funky" measures empirical such miles, yards, feet, inches, just not multiple of 10³
    Same billion mean differ depending on the country (see [url http://en.wikipedia.org/wiki/Long_and_short_scales] long and short scales)

    Just for "fun": [url http://articles.cnn.com/1999-09-30/tech/9909_30_mars.metric.02_1_climate-orbiter-spacecraft-team-metric-system?_s=PM:TECH] this is what can happen when we do not use the same system of units.

  • Creating a function and passing the value of the query

    I have what I thought, it was a pretty easy to resolve the situation: I want to concatenate two fields of the query, if the 2nd is not empty.

    I created a function:

    < name cfargument = "q1" value = "#query.q1 #" / > "
    < name cfargument = "q1a' value =' #query.q1a #" / > "

    < CFSET variables.myPunct = ":" > "
    < cfset variables. ResultVar = "" >

    < cfif QNE Trim (arguments.q1) "" > "".
    < cfset variables. ResultVar =' #arguments.q1 # ">"
    < / cfif >

    < cfif QNE Trim (arguments.q1a) "" > "".
    < cfif variable. ResultVar NEQ "" > "".
    < cfset variables. ResultVar ='#variables. ResultVar & variables.myPunct # ">"
    < / cfif >
    < cfset variables. ResultVar ='#variables. ResultVar & arguments.q1a # ">"
    < / cfif >
    < variable cfreturn. ResultVar >

    It's basically just the example they provide in online education, with the names have been changed.

    In the strip of the details of my report, I have an expression builder containing field: report.mytestfunction)

    When I run the present, I get: Q1 element is not defined in the ARGUMENTS.

    I tried this ninety different ways (literally). It seems very clear to me that the query.q1 (Incidentally, none of the results of the query) are NOT passed to the function. I tried to make the expression: report.mytestfunction (query.q1). I tried to create an input parameter.

    The documentation on this is ridiculously limited, given that the ability to implement conditional logic is entirely dependent on the 'function', I can say. I can in no way to get the function of interface with the query results. If the value fixed values in the service, rather than trying to use query variables, it shows very well.

    Any ideas?

    Have you tried to remove the attribute "value" of your cfargument tag? The way I see it, you should have:


    ... rest of function...

    And then you have to call it with: report.mytestfunction (query.q1, query.q1a)

  • LAG function to get the value of the measurement for parent

    Hello

    I'm interested if there is no function in OLAP DML, which is similar to the function of TROLLING. LAG function returns the measured value for the previous dimension member (or a few members of the back dimension). I would like to know if this function exists which does not return a meaningless measurement for the dimension member value, but the measured value for the parent of the live dimension member.

    Thanks in advance

    Peter

    _parentrel relationship identifies the parent of each Member of the dimension of a hierarchy.

    use:
    the time - dimension
    time_parentrel - Member parent expression
    time_parentrel (time_hierlist 'CALENDAR') - expression for parent along the CALENDAR hierarchy

    Sales - measure
    Sales (Time time_parentrel) - expression returning sales for the parent of the current Member along the existing hierarchy.
    sales (time time_parentrel (time_hierlist 'EXERCISE'))-expression returning the sales for the parent of the current Member along the FISCAL hierarchy.

    You can search the user's Guide the OLAP DML for many examples of the use of the OLAP DML commands/functions/objects in expressions.
    All of these objects are automatically created/maintained while retaining the dimension from the front end (MN).

    For example:
    (11g) OLAP DML users guide notions-> about-> OLAP DML objects given OLAP DML-> objects that support the use of hierarchical Dimensions section.

  • correctly when reading the negative value

    Hi all,

    It's about power meter device. in fact, I've already got the good value here, but I create additional calculations. the situation is:

    When the power reading is positive, I enjoy reading.

    power is negative, I misread (high value). so I need to subtract this value to 2 ^ 32 (or 4294967296).

    is that someone he knows the reason why he needs to happen?

    OK, "registers" are tables of U16. so try to typecast I32. How many elements in the table?

    Somehow, you do everything with tables, but you only display one item. It almost seems to me that everything going primitive "contact numbers" be given ordinary scalars. There are also a lot of duplicate code. You might get away with an instance and a loop FOR, for example.

    Representations of data are a mess with a wild mix of types of data and constraints. The Psum (High value) is I64 without reason (under the constraint of a DBL two values U32 (?) division). I do not understand the function of the Subvi. Can you explain?

    You can place an indicator of one of the 'registers' tables, run the VI so it contains data, then turn the indicator in a constant of schema that contains the typical data (Right-Click... change to constant). Save and attach the VI.

  • Two reading a digital value serial ports

    Hello

    Under VI attached writes a numeric value to a port and reads to another port. But it shows exception of

    ' VISA: (Hex 0xBFFF0015) timeout expired before the operation is complete. "is this the problem due to the conversion of the numeric value to a string? or any other. Please post possible suggestion.


  • How to read an int value to a file

    Hello programmers.

    I am facing a problem no doubt very simple but which has kept me stuck for some time, so I'm now looking for your help.

    int i = 0;

    try {}
    FileConnection fconn = (FileConnection) Connector.open (System.getProperty ("fileconn.dir.photos") + "increment.txt", Connector.READ_WRITE);
    If (fconn.exists ()) {}
    OutputStream os = fconn.openOutputStream ();
    String value = "1";
    OS. Write (value. GetBytes());
    OS. Close();
    InputStream is = fconn.openInputStream ();
    i = Integer.parseInt (is. ToString());
    is. Close();
    }
    If (! fconn.exists ()) {}
    fconn. Create() ;}
    fconn. Close();
    }
    catch (IOException ioe) {}

    I know that the file of the photo isn't the best idea, it's just a test. So, when I go into the increment.txt file, I see that a '1' is written, however, when I try to start it I get a NumberFormatException, do you know why and how I can solve this problem?

    Thank you very much for any help, I won't forget the congratulations...

    Yes indeed you're right, it works!

    Thanks a lot again Simon, you be everhelpfull in my daily programming efforts.

    Here is the final code that worked for me:

    InputStream is = fconn.openInputStream ();
    InputStreamReader isr = new InputStreamReader (is, "UTF8");
    StringBuffer buffer = new StringBuffer();
    int ch;
    While ((ch = isr.read ()) >-1) {}
    buffer. Append ((Char) ch) ;}

    Temp = buffer. ToString();
    Temp.Trim ();
    i = Integer.parseInt (temp);
    is. Close();

    Bravo to you, of course...

  • reading the filter values (unsharp mask) defined in the dialog box

    for my sharpening script, I should be able to store values defined in the dialog for later use unsharp mask. The script calls the dialog box with DialogModes.ALL, then the values are set manually. Is it possible that I can tell the script to read the values defined and store them in variables.

    Can't find a topic referring to this problem.

    Thanks for any help.

    Hans

    2016, use it at your own risk.

    #target photoshop

    try {}

    var idUnsM = charIDToTypeID ("UnsM");

    var theResult is executeAction (idUnsM, undefined, DialogModes.ALL);.

    var theAmount = theResult.getUnitDoubleValue (stringIDToTypeID ("amount"));

    var theRadius = theResult.getUnitDoubleValue (stringIDToTypeID ("radius"));

    var theThreshold = theResult.getInteger (stringIDToTypeID ("threshold"));

    Alert ("amount" + theAmount + ' \nradius ' + theRadius + ' \nthreshold '+ theThreshold ")

    } catch (e) {};

    based on the code of michael l hale.

    function checkDesc2 {(theDesc)

    var c = theDesc.count;

    var str = ";

    for (var i = 0; i)

    Str = str + ' key "+ i +" = "+ typeIDToStringID (theDesc.getKey (i)) + ': ' theDesc.getType (theDesc.getKey (i)) +"\n"+ getValues (theDesc, I) +"\n ";

    };

    Alert ("desc\n\n" + STR);

    };

    check.

    function getValues (theDesc, number) {}

    switch (theDesc.getType (theDesc.getKey (theNumber))) {}

    case DescValueType.ALIASTYPE:

    Return theDesc.getPath (theDesc.getKey (theNumber));

    break;

    case DescValueType.BOOLEANTYPE:

    Return theDesc.getBoolean (theDesc.getKey (theNumber));

    break;

    case DescValueType.CLASSTYPE:

    Return theDesc.getClass (theDesc.getKey (theNumber));

    break;

    case DescValueType.DOUBLETYPE:

    Return theDesc.getDouble (theDesc.getKey (theNumber));

    break;

    case DescValueType.ENUMERATEDTYPE:

    return (typeIDToStringID (theDesc.getEnumerationValue (theDesc.getKey (theNumber))) + '_' + typeIDToStr ingID (theDesc.getEnumerationType (theDesc.getKey (theNumber)));)

    break;

    case DescValueType.INTEGERTYPE:

    Return theDesc.getInteger (theDesc.getKey (theNumber));

    break;

    case DescValueType.LISTTYPE:

    Return theDesc.getList (theDesc.getKey (theNumber));

    break;

    case DescValueType.OBJECTTYPE:

    return (theDesc.getObjectValue (theDesc.getKey (theNumber)) + '_' + typeIDToStringID (theDesc.getObject Type (theDesc.getKey (theNumber)));

    break;

    case DescValueType.RAWTYPE:

    Return theDesc.getReference (theDesc.getData (theNumber));

    break;

    case DescValueType.REFERENCETYPE:

    Return theDesc.getReference (theDesc.getKey (theNumber));

    break;

    case DescValueType.STRINGTYPE:

    Return theDesc.getString (theDesc.getKey (theNumber));

    break;

    case DescValueType.UNITDOUBLE:

    return (theDesc.getUnitDoubleValue (theDesc.getKey (theNumber)) + '_' + typeIDToStringID (theDesc.getUn itDoubleType (theDesc.getKey (theNumber)));

    break;

    by default:

    break;

    };

    };

  • read excel cell value

    I write a procedure to read the values in Excel this procedure is:

    Procedure p30_9i_read_Xls_file_OE_smr
    IS
    -Says handles OLE objects
    request OLE2. OBJ_TYPE;
    workbooks OLE2. OBJ_TYPE;
    workbook OLE2. OBJ_TYPE;
    spreadsheets OLE2. OBJ_TYPE;
    worksheet OLE2. OBJ_TYPE;
    cell OLE2. OBJ_TYPE;
    args OLE2. OBJ_TYPE;

    Check_file text_io.file_type;
    path varchar2 (500);
    Diretory varchar2 (500);
    file_xl varchar2 (500);

    No_File exception;
    PRAGMA exception_INIT (no_file,-302000);
    cell_value varchar2 (5000);
    cell_value1 NUMBER (10.4);
    EOD Boolean: = false;

    l integer: = 1;
    whole lb;
    whole head;

    the integer: = 1;
    lend around;
    whole tail;

    BEGIN
    lb: = 0;
    head: = 0;
    lend: = 0;
    tail: = 0;
    path: = "C:\Climate_File";
    Diretory: = substr (:TRANSFERTS.file_name, 17, 22);
    file_xl: =: TRANSFERS. EXCEL_FILE |'. XLS;
    Check_file: = TEXT_IO. FOPEN(Path ||) '\' || Diretory. '\' || file_xl, 'R');
    TEXT_IO. FCLOSE (Check_file);

    -- -----------------------------------------------------------
    application: = OLE2. CREATE_OBJ ('Excel.Application');
    OLE2.set_property (application, 'Visible ','false ');
    workbooks: = OLE2. GET_OBJ_PROPERTY (application "Filing cabinets");
    args: = OLE2. CREATE_ARGLIST;
    OLE2.add_arg (args, path |) '\' || Diretory. '\' || file_xl);
    workbook: = ole2. GET_OBJ_PROPERTY (Workbooks, 'Open', args);
    OLE2.destroy_arglist (args); -create args an arg list and initiate the arg inside

    worksheets: = ole2. GET_OBJ_PROPERTY (workbook, 'worksheets');
    worksheet: = OLE2. GET_OBJ_PROPERTY (application, 'activesheet');
    OLE2. SET_PROPERTY (spreadsheet, 'Value', 'Sheet1');

    -- -----------------------------------------------------------

    args: = OLE2.create_arglist;
    OLE2.add_arg (args, 2);
    OLE2.add_arg (args, 4);
    cell: = OLE2.get_obj_property (spreadsheet calculation, 'Cells', args);
    OLE2.destroy_arglist (args);
    cell_value: = oLE2.get_char_property (cell, 'Value');
    p05_show_alert_message ("i = cell value ' |") TO_CHAR (cell_value));

    -- -----------------------------------------------------------
    -Release the OLE2 object handles
    OLE2.release_obj (cell);
    OLE2.release_obj (Worksheet);
    OLE2.release_obj (Worksheets);
    OLE2.release_obj (Workbook);
    OLE2.release_obj (Workbooks);

    OLE2. Invoke (application, 'Quit');
    OLE2.release_obj (application);

    -ASSIGNING of VALUE of RETURN of EXCEL to THE text field
    -: PLANETS.pid: = cell_value;

    EXCEPTION
    WHEN no_file THEN
    MESSAGE ("file not found.");
    WHILE OTHERS THEN
    MESSAGE (SQLERRM);
    TAKE A BREAK;
    BECAUSE me in 1... tool_err.nerrors LOOP
    MESSAGE (tool_err.message);
    TAKE A BREAK;
    tool_err.pop;
    END LOOP;


    END;


    -- ****************************************************************
    My excel file also has the following features:
    1 12.9 18.8 10.9 10 10.3 75
    2 14.7 19.4 10.9 10 20.3 63

    -- *****************************************************************

    When I run my procedure to read the value of the cell:
    OLE2.add_arg (args, 2);   -line 2
    OLE2.add_arg (args, 4);  -column 4
    I get 1 instead of 10.9 in output

    OLE2.add_arg (args, 1);   -line 2
    OLE2.add_arg (args, 6);  -column 4
    I get 7 instead of 75 output
    ...

    My problem is: any cell value, I choose to read, I'm just the first digit of the value of the cell.

    any help, I appreciate it
    Thank you.

    software: form [32 bit] Version 9.0.2.9.0, oracle JInitiator: 1.3.1.9, WebUtil 1.0.2 (Beta), window, IE 8

    Do this way:

    args: = OLE2. CREATE_ARGLIST;

    OLE2. ADD_ARG (args, r);

    OLE2. ADD_ARG (args, c);

    cell: = OLE2. GET_OBJ_PROPERTY (spreadsheet calculation, 'Cells', args);

    OLE2.destroy_arglist (args);

    -Returns the value of the cell

    Cell_val (c): is ole2. Get_Num_Property (Cell, 'Value');

    If Cell_val (c) = 0 Then

    Cell_val (c): is ole2. Get_Char_Property (Cell, 'Value');

    End if;

    Still works.

    When you insert dates in the table: to_date (Cell_val (5) + 2415019' I)

    CHEK your desimal separator (, or) is language-dependent.

  • How to read the xml value in plsql store proc

    I need to read the value at the bottom of the xml script in plsql procedure. I do not understand how to write. I'm new in xml, please help me solve this problem.


    <? XML version = "1.0" encoding = "UTF-8"? >
    < PrtyActDtlRequest >
    < AcctInfo >
    < > 84188 PartyID < / PartyID >
    < RelAcctID > 125148 < / RelAcctID >
    < RelAcctID > 251486 < / RelAcctID >
    < RelAcctID > 125147 < / RelAcctID >
    < RelAcctID > 125511 < / RelAcctID >
    < / AcctInfo >
    < / PrtyActDtlRequest >

    Here < AcctId > can be repeted n times (unbouinded), but < PartyID > is set once. This is the script that we will get out of the source system.

    Thanks in advance.

    Roy

    You needn't PL/SQL for it. Just use XMLTABLE:

    with t as)

    Select xmltype (')

    84188

    125148

    251486

    125147

    125511

    double x)

    Select PartyID,

    RelAcctID

    t,.

    XMLTable)

    ' / PrtyActDtlRequest/AcctInfo.

    go x

    columns

    PartyID path number "PartyID,

    Path RelAcctIDXml xmltype "RelAcctID."

    ),

    XMLTable)

    'RelAcctID '.

    by the way RelAcctIDXml

    columns

    RelAcctID path number ' / RelAcctID'

    )

    /

    PARTYID RELACCTID
    ---------- ----------
    84188 125148
    84188 251486
    84188 125147
    84188 125511

    Scott@pdborcl12 >

    SY.

Maybe you are looking for