Bynary number table

Hello

I'm developing a program that read the port series, capture packets, extract payload, convert the data in the payload and display. Now, everything up to that the last steps works very well. The problem is with the conversion of an array of bytes to be the number. In serial communication, packages are unsigned 16-bit integers (which means basically a 2-byte in the payload). Now the problem is how to convert these two bytes to an integer unsigned 16-bit in LabView. If I just try to convert the byte array using converter U16, it generates a table 1 d of 16-bit integers, unsigned while I need one. Is it possible to do this?

For example, if I have two bytes 0 x 02 and 0x8C and try to convert them into a 16-bit unsigned integer using the U16 converter, it generates a table [2, 140] while I need to be converted into just 652.

Table of index allows to remove the two bytes (it can be extended by dragging the bottm up to get two outputs).

The thread of these two bytes to the join and you're ready to go.

There are other ways, but I'll let others speak.

Ben

Tags: NI Software

Similar Questions

  • convert hex number to binary number table

    Hello

    I need to convert hexadecimal number in binary number table.

    Can someone show me how?

    For example,.

    NUM1 = 0xFA

    I need to put in binary table,

    0 1 2 3 4 5 6 7 index

    value (LSB) 0 1 0 1 1 1 1 1 (MSB)

    Thank you.

    Guru,

    You generate a string instead of a number array array as the op asked and your table is backwards.

    What srikrishnaNF and smercurio_fc are descibing is this simple code.

  • Why the coldfusion costs number tables and dates from 1

    Why is coldfusion number tables and other structures of 1. Its pretty exasperating when the rest of the world for the most starts at 0?

    Zero base tables are a legacy from the time of the system who need to work on the address offset base memory table is stored to locate the starting address of each element.  So it makes a little sense that the first element is offset from the base address by a factor of zero.

    There are languages that predate C (where the C++ germinated some sort of horrible nightmare) that using 1 that the marketing of the index... it is just C has been reduced to minimize the translation of C code machine, and in this case 0 is more logical.  And other languages 'hug' just copied.  It is - in the modern era in which the source language is usually so far away from the machine language - illogical to persist with this kind of approach for one good reason other than to copy makes another language.

    On the human level, there is not a zero element in a collection, and because it is not really a treatment save one more just to start the table to a position more respectful man, why not?

    I mean... How confusing is really remember what language is that?

    --

    Adam

  • Power of function with a very large number & table HEX

    Hello

    I have 3 problems and I would be grateful if anyone can help. I have attached

    (1) I need to calculate 982451653 ^ 15. I used the "Power of X" function but her resut I receive is incorrect.

    is there a way to get the correct result?

    (2) after that I need to calculate result, but I get nothing? I use the function «Quotient & reminder»

    (3) I need to convert the number to HEX 982451653--> 3A8F05C5 and send it to table by two gruped back as shown below:

    3A8F05C5--> [3A] [8F] [05] [C5] and write on the Board by behind.

    Table should be:

    .. .and for hex 3A8F05C56 number--> [03] [A8] [F0] [5 C] [56]

    Table:

    Help, please!


  • Paging a number table of the ADF

    Hi all

    If you attempt to insert a character or a value of "0" in the number of paging of a component in the table, you get a double mistake, and if you keep trying to insert a wrong value, the errors continue to reproduce (as you can see in the page http://jdevadf.oracle.com/adf-richclient-demo/faces/components/table/pagingTable.jspx)

    Can anyone tell me the reason? Is this a bug?

    Thank you in advance for the answer.

    Davide

    Looks like a bug to me.

    There is no option for the value of the intercept originally entered, so your only option is to create the Service Request(if you have support account) or just skip this question.

    Dario

  • Insert the ROWNUM in a column of data type of NUMBER table

    Hello

    I have a table that has a column named "rank" of the NUMBER data type. Basically, I want to make an analysis of top-n and insert the ROWNUM with other columns in the table.

    Definition of table1:

    CREATE TABLE

    (

    col1 VARCHAR2 (10),

    Col2 NUMBER,

    NUMBER of col3,

    rank NUMBER

    );

    INSERT INTO table1

    SELECT col1, col2, col3, rownum

    DE)

    SELECT col1, col2, col3

    FROM table2

    ORDER BY DESC of col3

    )

    WHERE rownum < = 5;

    I get an error ORA-01722: invalid number. I think the mistake is virtual ROWNUM is not data type of NUMBER, so I tried to cast as CAST (ROWNUM AS NUMBER), but it does not work, same error. Can can you please shed some light on how to convert a ROWNUM number or if the issue is something else.

    you're right, your example worked. It is an example of table I just created just to illustrate the problem, but my real table was always showing the same problem. Weird, isn't? However when I added the column names after that insert the question but statement I resolved. Adding code

    INSERT INTO TABLE1

    (col1, col2, col3, rank) - added

    SELECT col1, col2, col3, rownum

    DE)

    SELECT col1, col2, col3

    FROM table2

    ORDER BY DESC of col3

    )

    WHERE rownum<=>

    So that means ROWNUM returns number; and another confusion: why the inclusion of the column has solved my problem when it is not necessary for your example. in any case thank you.

  • Number tables display both

    I have a MacBook El Capitan years running. I click the icon of numbers and choose the sheet for calculation/table I want to watch. Is it then possible to pull up a second table and do it on the same screen display? And if so, how?

    Hi Doug,.

    You can have two (or more) numbers of documents open at the same time. Resizing the windows of numbers and hanging out by the title bars, you can have by-side on your screen. Capture screen of Document 1 and 2 of the Document.

    Or one single document above the other

    Is that what you are looking for?

    Kind regards

    Ian.

  • SQL * Loader - rejected records - error on table ORA-01722: invalid number

    Get the following errors:

    Please tell me where I'm wrong?
    The log file and extracts the data file with the control file is attached.
    Also guide me please how I can download 4900 files at once?

    -------------------------------------
    SQL * Loader: release 11.1.0.7.0 - Production on Fri 14 Oct 03:06:06 2011

    Copyright (c) 1982, 2007, Oracle. All rights reserved.

    Control file: sample.ctl
    Data file: Cities.csv
    Bad leadership: Cities.bad
    Discard File: none is specified

    (Allow all releases)

    Number of loading: ALL
    Number of jump: 0
    Authorized errors: 50
    Link table: 64 lines, maximum of 256000 bytes
    Continuation of the debate: none is specified
    Path used: classics

    Table CITY, loaded from every logical record.
    Insert the option in effect for this table: INSERT

    Column Position Len term Encl. Datatype name
    ------------------------------ ---------- ----- ---- ---- ---------------------
    FIRST ID *, CHARACTER
    35. ACCORDING TO NAME, ' CHARACTER
    COUNTRYCODE 3, ' CHARACTER
    THE NEXT POPULATION * CHARACTER WHT

    Sheet 1: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Sheet 2: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Sheet 3: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Folder 4: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Sheet 5: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Sheet 6: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Sheet 7: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Sheet 8: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    File 9: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Case 10: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Factsheet 11: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Sheet 12: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    File 13: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Fact sheet 14: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Fact sheet 15: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Sheet 16: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    File 17: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Sheet 18: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    File 19: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Sheet 20: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Sheet 21: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Account 22: rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Sheet 23: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Record number of 24: rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Sheet 25: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Fact sheet 26: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Fact sheet 27: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Record 28: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Record 29: rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Record 30: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Record of 31: rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    • Statement 32: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Record 33: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Page 34: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Record 35: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Record 36: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Record 37: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Record 38: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Sheet 39: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Record 40: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Sheet 41: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Page 42: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Record 43: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Sheet 44: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Record 45: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    • Statement 46: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Record 47: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Record 48: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Record 49: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Page 50: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number

    Record 51: Rejected - error on the table CITY, POPULATION column.
    ORA-01722: invalid number


    NUMBER of MAXIMUM ERRORS EXCEEDED - above the statistics reflect partial performance.

    CITY table:
    0 rows successfully loaded.
    51 lines not filled due to data errors.
    0 rows not loading because all WHEN clauses were failed.
    0 rows not populated because all fields are null.


    The space allocated to bind table: 35840 bytes (64 lines)
    Bytes of read buffer: 1048576

    Total logical records ignored: 0
    Total logical records read: 64
    Total rejected logical records: 51
    Total logical records ignored: 0

    Run started on Fri 14 Oct 03:06:06 2011
    Run finished Fri Oct 14 03:06:12 2011

    Time was: 00:00:06.18
    Time processor was: 00:00:00.03



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

    my control file (sample.ctl):

    Load data infile 'Cities.csv '.
    in the town of table
    fields completed by «,»
    (external id integer,
    char (35) name box by ' ', '
    CountryCode tank (3) box by ' ', '
    external population integer terminated by '\n '.
    )

    my data (Cities.csv) file (it contains 4900 documents, but I show here just 4 records for ease)

    3830, "Virginia Beach", "USA", 425257
    3831, 'Atlanta', 'USA', 416474
    3832, "Sacramento", "USA", 407018
    3833, 'Oakland', 'USA', 399484


    Thanks in advance!

    Watch when I have a little change your database as follows

    1,'Kabul','AFG',1780000
    2,'Qandahar','AFG','237500'
    3,'Herat','AFG','186800'  
    

    I got the same error (last 2 rows rejected for the same number invalid error)

    mhouri > select * from cities;
    
            ID NAME                                COU POPULATION
    ---------- ----------------------------------- --- ----------
             1 Kabul                               AFG    1780000
    
    SQL*Loader: Release 10.2.0.3.0 - Production on Fri Oct 14 10:38:06 2011
    
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    
    Control File:   cities.ctl
    Data File:      cities.dat
      Bad File:     cities.bad
      Discard File:  none specified
    
     (Allow all discards)
    
    Number to load: ALL
    Number to skip: 0
    Errors allowed: 50
    Bind array:     64 rows, maximum of 256000 bytes
    Continuation:    none specified
    Path used:      Conventional
    
    Table CITIES, loaded from every logical record.
    Insert option in effect for this table: INSERT
    
       Column Name                  Position   Len  Term Encl Datatype
    ------------------------------ ---------- ----- ---- ---- ---------------------
    ID                                  FIRST     *   ,       CHARACTER
    NAME                                 NEXT    35   ,    '  CHARACTER
    COUNTRYCODE                          NEXT     3   ,    '  CHARACTER
    POPULATION                           NEXT     *  WHT      CHARACTER            
    
    Record 4: Rejected - Error on table CITIES, column ID.
    Column not found before end of logical record (use TRAILING NULLCOLS)
    Record 2: Rejected - Error on table CITIES, column POPULATION.
    ORA-01722: invalid number
    
    Record 3: Rejected - Error on table CITIES, column POPULATION.
    ORA-01722: invalid number
    
    Table CITIES:
      1 Row successfully loaded.
      3 Rows not loaded due to data errors.
      0 Rows not loaded because all WHEN clauses were failed.
      0 Rows not loaded because all fields were null.
    
    Space allocated for bind array:                  35840 bytes(64 rows)
    Read   buffer bytes: 1048576
    
    Total logical records skipped:          0
    Total logical records read:             4
    Total logical records rejected:         3
    Total logical records discarded:        0
    
    Run began on Fri Oct 14 10:38:06 2011
    Run ended on Fri Oct 14 10:38:06 2011
    
    Elapsed time was:     00:00:00.23
    CPU time was:         00:00:00.09
    

    Value of the population within the data file must be a number

    Best regards

    Mohamed Houri

  • Help formula: count the number of whites in a column "up to the...» »

    name string metric
    Matthew 5
    brand 1
    brand optimusPrime
    brand
    Luke 2
    Matthew jamesLikesSteak
    John 3
    Luke lukingGood
    Matthew
    Luke
    John johnnyPop
    John

    Hey guys - so I do business with a bit of a problem in number. I have a number table - the table above is a simplified representation of the corresponding parts of the table. The left column 'name' is a series of 12 names repeated and 0 missing values. The "string" middle column is a column that has a lot of missing values by a formula based on another column that is not relevant to this problem. Who is not missing is all strings. The problem I have is in the 'metric ': right column

    I am trying to create a dynamic formula which will result in the numbers and blanks, exactly as above. My goal is to create a formula that, for each line, account the number of whites in the column 'chain' until we reach an empty 'string' which occurs next to "namesake" as in the line of housing the formula - and if there is no such a situation, so that it is empty. For example, if the second row (including header row) bears the name of "Matthew". The next time that a white 'string' occurs next to the name "matthew" is tenth. The number of whites that occur between the second row, and the ninth is 5 (lines 2, 3, 5, 6 and 8). I manually coded a small part of the table to use something like this (which would be installed in cell C2 in this example):

    = IF (B2 = "", COUNTBLANK(B2:B9), "")

    This formula produces the correct number for the first row of data (5), but it does not dynamically fulfill what I'm trying to do this since I am currently having the formula to find the next blank 'chain' that occur next to "name" in the formula line.

    I hope that someone has encountered anything like this before. I tried to go through all the functions and numbers from formulas, but so far I have not found much success.

    Hi BaronDe,

    I need to ask, "why you try to do this? So what you want is possible it will be a complex solution. It may be much easier to get your information in a different way. Indicate these blanks?

    You should know that COUNTBLANK() will not count a cell with a formula, even if this formula resolves to «»

    Quinn

  • Fill a Table using XML?

    Hello

    Can read XML and the insertion/upgrade to update / delete any table?

    Assumes that the XML is stored in a column

    Is there something similar loan?


    With the help of:

    Oracle Database 11 g Enterprise Edition Release 11.2.0.4.0 - 64 bit Production
    PL/SQL Release 11.2.0.4.0 - Production
    CORE Production 11.2.0.4.0
    AMT for Linux: Version 11.2.0.4.0 - Production
    NLSRTL Version 11.2.0.4.0 - Production







    A few ideas, using DBMS_XMLSTORE:

    SQL> create table table2 (code varchar2(30) primary key, dt_ini date, aliq_pis number);
    
    Table created.
    
    SQL>
    SQL> create or replace procedure merge_record (p_rec in xmltype)
      2  is
      3
      4    cursor c_tab_cols (p_table_name in varchar2)
      5    is
      6      with pk_cols (column_name) as (
      7        select column_name
      8        from user_cons_columns
      9        where constraint_name = (
     10          select constraint_name
     11          from user_constraints
     12          where table_name = p_table_name
     13          and constraint_type = 'P'
     14        )
     15      )
     16      select tc.column_name
     17           , nvl2(cc.column_name, 'Y', 'N') as is_pk
     18      from user_tab_cols tc
     19           left outer join pk_cols cc on cc.column_name = tc.column_name
     20      where tc.table_name = p_table_name
     21      and tc.virtual_column = 'NO' ;
     22
     23    tab_name  user_tables.table_name%type;
     24    ctx       dbms_xmlstore.ctxHandle;
     25    numrows   number;
     26
     27  begin
     28
     29    -- get embedded table name
     30    select xmlcast(xmlquery('/TABLE/@tableName' passing p_rec returning content) as varchar2(30))
     31    into tab_name
     32    from dual;
     33
     34    -- set target table
     35    ctx := dbms_xmlstore.newContext(tab_name);
     36    -- and row tag name
     37    dbms_xmlstore.setRowTag(ctx, 'TABLE');
     38
     39    -- set columns to update
     40    for r in c_tab_cols (tab_name) loop
     41      dbms_xmlstore.setUpdateColumn(ctx, r.column_name);
     42      if r.is_pk = 'Y' then
     43        dbms_xmlstore.setKeyColumn(ctx, r.column_name);
     44      end if;
     45    end loop;
     46
     47    -- set date format
     48    execute immediate 'alter session set nls_date_format = "YYYY-MM-DD"';
     49
     50    -- update
     51    numrows := dbms_xmlstore.updateXML(ctx, p_rec);
     52
     53    -- if no row updated, try insert
     54    if numrows = 0 then
     55      dbms_xmlstore.clearKeyColumnList(ctx);
     56      numrows := dbms_xmlstore.insertXML(ctx, p_rec);
     57    end if;
     58
     59    dbms_xmlstore.closeContext(ctx);
     60
     61  end;
     62  /
    
    Procedure created.
    
    SQL>
    SQL>
    SQL> exec merge_record(xmltype('2009.70.012007-01-013
    ')) PL/SQL procedure successfully completed. SQL> select * from table2; CODE DT_INI ALIQ_PIS ------------------------------ ----------- ---------- 2009.70.01 01/01/2007 3 SQL> exec merge_record(xmltype('2009.70.012007-01-011
    ')) PL/SQL procedure successfully completed. SQL> exec merge_record(xmltype('2009.70.022007-01-011
    ')) PL/SQL procedure successfully completed. SQL> select * from table2; CODE DT_INI ALIQ_PIS ------------------------------ ----------- ---------- 2009.70.01 01/01/2007 1 2009.70.02 01/01/2007 1
  • Campus solution 9.0: engine Application parallel treatment of the Instances of the temporary Table

    People,


    Hello. I'm working on 9.0 Solution on a University Campus. I'm working on the module of Community Campus. I face a problem like below:


    Campus Community > personal information > add/update a person


    I can type in all the information for a person successfully and save it with success. But what research, it does not return anything to PS user
    This is because the security of access to demographic data is not granted to the user. So, I put security as below:


    Step 1:

    Set Up AWAR > Security > Secure Student Administration > permissions list > access to demographic data: I have select permission list HCPPALL and EOEI9200 for the PS user

    Step 2:

    Set Up SACRED > Security > Secure Student Administration > process > access to demographics: the process to initialize the authorization indicates to the user PS process program is the Application Engine. The process name is MSK_CFG. The process is not successful and returns an error as below:

    Table or view does not exist. Has no SQL statement: Truncate Table USER.PS_MSK_CFG_TAO4.


    The above error is that of the motor parallel processing Application on instances of the temporary table. There are 2 modes: online and batch. I run it in 2 modes as below:

    Online mode:

    Step 1: Navigator PeopleTools > Public Services > Administration > PeopleTools Options: I change 3 to 4 for the Instance of the Temp Table total and online.
    Step 2: Create a new control ID Temp1 and execute processes on Navigator SetUp > Security > Secure Student Administration > process > process of demographic data. The MSK_CFG process runs successfully, but the output file contains the message:

    ATTENTION: Application request engine is not active! Suspended treatment!


    So I run of steps 3, 4 and 5 in Batch mode as below:

    Step 3: Navigator PeopleTools > Application Engine > application Application Engine > engine Application request Page > add a new control ID Temp1.
    Step 4: Run the MSK_CFG with Temp1 process again and get the error:

    Table or view does not exist: Truncate table USER.PS_MSK_CFG_TAO5.

    Step 5: I change 4 to 5 navigator PeopleTools > Public Services > Administration > page PeopleTools Option for the Instance of the Temp Table total and online.

    Re-run the MSK_CFG process and get the error:

    Table or view does not exist: Truncate table USER.PS_MSK_CFG_TAO6.

    I have increase by 5-6 for the temporary Table instance and re-run the MSK_CFG process and get the same error with incremental number:
    Table or view does not exist: Truncate table USER.PS_MSK_CFG_TAO7.

    I have increase by 6 to 7 and re-run the MSK_CFG process and get the same error:
    Table or view does not exist: Truncate table USER.PS_MSK_CFG_TAO8.

    The maximum is 99, I continue to adding 1 to the Temp table instances and run the MSK_CFG process. But get the same error with differentials 1 as below:

    Table or view does not exist: Truncate table USER.PS_MSK_CFG_TAO9.
    Table or view does not exist: Truncate table USER.PS_MSK_CFG_TAO10.
    ... ...

    Table or view does not exist: Truncate table USER.PS_MSK_CFG_TAO99
    Table or view does not exist: Truncate table USER.PS_MSK_CFG_TAO.

    My question is:

    Because the engine of the application is not active with a new control ID Temp1 in online mode, I add the new control ID Temp1 in the Application engine page request but get the error above.  How to solve the error above to begin the process of MSK_CFG?

    Thanks in advance.

    People,

    Hello. The problem is solved by myself.

    The thing is that we need to open the MSK_CFG_TAO of the temporary Table in the application designer and build. After construction, the table PS_MSK_CFG_TAO and PS_MSK_CFG_TAO1 come in the database.

    MSK_CFG process runs correctly now. Personal information of search returns data successfully. Thank you.

  • Trigger on a table

    Hello

    I need help on this topic


    I insert a line in a table T1 with null in a column c1 of this table.
    Should what trigger I use to create lines in another table

    This trigger starts only when the c1 column is filled with null value differet value and the previous value of this column c1 is null

    Time t1
    
    id       c0        c1
    1        xx        NULL
    
    time t2 (I popolated C1
    1        xx        ValueNOTNULL
    
    At time t2 fire the trigger of kind the following:
    
    
    CREATE TRIGGER T_t1  AFTER update
                      OF c1 ON t1
    FOR EACH ROW
            WHEN  (NEW.c1 IS NOT NULL and old.c1 is null)
    is it good?

    Thanks in advance

    There's no work... Just tested for you... ;)

    SQL> create table test1(c1 number);
    
    Table created.
    
    SQL> create table test2(c1 number);
    
    Table created.
    
    SQL> create or replace trigger test_trig1 after update on test1
      2   for each row
      3   when (old.c1 is null and new.c1 is not null)
      4  begin
      5   insert into test2 values(:new.c1);
      6  end;
      7  /
    
    Trigger created.
    
    SQL> insert into test1 values(1);
    
    1 row created.
    
    SQL> update test1 set c1=2;
    
    1 row updated.
    
    SQL> insert into test1 values(null);
    
    1 row created.
    
    SQL> update test1 set c1=3 where c1 is null;
    
    1 row updated.
    
    SQL> select *
      2  from test2;
    
            C1
    ----------
             3
    
  • Table of data in column

    Hi all

    I was asked by an interviewer,

    I have a table with 10 columns. in this 10 columns, I have data in a single column. Is it possible to know that the name of the column in which the data are with the help of any view data dictionary.

    Sorry if I ask a stupid question.

    Thank you

    Collect statistics of the table and use USER_TAB_COLUMNS view datadictionary (or one of the related views)
    http://docs.Oracle.com/CD/E11882_01/server.112/e25513/statviews_5465.htm#REFRN26276

    SQL> create table t
      2  (c1 number,c2 number,c3 number,c4 number,c5 number,c6 number,c7 number,c8 number,c9 number,c10
    number);
    
    Table created.
    
    SQL> insert into t (c7) values (42);
    
    1 row created.
    
    SQL> begin
      2    dbms_stats.gather_table_stats(user, 'T');
      3  end;
      4  /
    
    PL/SQL procedure successfully completed.
    
    SQL> select * from t;
    
            C1         C2         C3         C4         C5         C6         C7
    ---------- ---------- ---------- ---------- ---------- ---------- ----------
            C8         C9        C10
    ---------- ---------- ----------
                                                                              42
    
    1 row selected.
    
    SQL> select table_name
      2  ,      column_name
      3  from   user_tab_columns
      4  where  table_name = 'T'
      5  and    num_nulls = 0;
    
    TABLE_NAME                     COLUMN_NAME
    ------------------------------ ------------------------------
    T                              C7
    
    1 row selected.
    
  • The assignment of values of Table type error

    Hello

    I'm trying to insert values for a Collection type, while doing that I am faced with an error.
    " PLS-00306: wrong number or types of arguments in call to
     'XXSCP_AVL_CSP_SQR_O_TP' "
    My statement of collection type PFB and and assignment.

    Object type:
    TYPE XXSCP_AVL_CSP_SQR_O_TP AS                  
    OBJECT  (                                       
                PLAN_ID             NUMBER,         
                SR_INSTANCE_ID      NUMBER,         
                INVENTORY_ITEM_ID   NUMBER,         
                BASE_ITEM_ID        NUMBER,              
                 ITEM_NAME           VARCHAR2(50),       
                 SUPPLIER_ID         NUMBER,             
                SUPPLIER_SITE_ID    NUMBER,         
                NORMAL_BUY_USAGE    VARCHAR2(5),    
                AVAILABLE_QUANTITY  NUMBER ,        
                SPL_PEG_FLAG        VARCHAR2(10),   
                SQR_LINE_ID         VARCHAR2(2000), 
                SQR_NUMBER          VARCHAR2(2000), 
                SQR_MOQ             NUMBER,         
                BPA_PO_LINE_ID      NUMBER,         
                SUGG_BPA_NUMBER     VARCHAR2(30),   
                BPA_BUY_PRICE_BASIS VARCHAR2(10),   
                BPA_LINE_NUM        NUMBER,         
                BPA_PO_LINE_LOC_ID  NUMBER,         
                BPA_CURRENCY_CODE   VARCHAR2(10),   
                BPA_PRICE           NUMBER,         
                BPA_PO_HEADER_ID    NUMBER,         
                BPA_EXPIRATION_DATE DATE,           
                BPA_QUANTITY        NUMBER,         
                ORIG_AVAILABLE_QTY  NUMBER          
            );        
    
    Table type :
    
    TYPE XXSCP_AVL_CSP_SQR_C_TP AS TABLE OF XXSCP_AVL_CSP_SQR_O_TP;
    Statement:
     l_tab_avl_csp_sqr   XXSCP_AVL_CSP_SQR_C_TP := XXSCP_AVL_CSP_SQR_C_TP();
    Assignment to the body:
    l_tab_avl_csp_sqr.EXTEND(1);
    l_tab_avl_csp_sqr(l_tab_avl_csp_sqr.COUNT) := XXSCP_AVL_CSP_SQR_O_TP();
    l_tab_avl_csp_sqr(l_tab_avl_csp_sqr.COUNT).plan_id           := l_tab_planorders (i).l_num_plan_id;
    l_tab_avl_csp_sqr(l_tab_avl_csp_sqr.COUNT).sr_instance_id    := l_tab_planorders (i).l_num_sr_instance_id;
    l_tab_avl_csp_sqr(l_tab_avl_csp_sqr.COUNT).inventory_item_id := l_tab_planorders (i).l_num_inventory_item_id;
    l_tab_avl_csp_sqr(l_tab_avl_csp_sqr.COUNT).base_item_id      := l_tab_planorders (i).l_num_base_item_id;
    l_tab_avl_csp_sqr(l_tab_avl_csp_sqr.COUNT).item_name         := l_tab_planorders (i).l_chr_item_name;
    l_tab_avl_csp_sqr(l_tab_avl_csp_sqr.COUNT).supplier_id       := l_tab_planorders (i).l_num_supplier_id;
    l_tab_avl_csp_sqr(l_tab_avl_csp_sqr.COUNT).supplier_site_id  := l_tab_planorders (i).l_num_supplier_site_id;
    l_tab_avl_csp_sqr(l_tab_avl_csp_sqr.COUNT).available_quantity := l_rec_pegged_list (j).remaining_aval_qty;
    l_tab_avl_csp_sqr(l_tab_avl_csp_sqr.COUNT).spl_peg_flag       := 'Y';
    l_tab_avl_csp_sqr(l_tab_avl_csp_sqr.COUNT).sqr_line_id        := l_rec_pegged_list (j).sqr_line_id;
    l_tab_avl_csp_sqr(l_tab_avl_csp_sqr.COUNT).sqr_number         := l_rec_pegged_list (j).sqr_number;
    l_tab_avl_csp_sqr(l_tab_avl_csp_sqr.COUNT).sqr_moq            := l_rec_pegged_list (j).sqr_moq;
    l_tab_avl_csp_sqr(l_tab_avl_csp_sqr.COUNT).bpa_po_line_id     := l_rec_pegged_list (j).bpa_po_line_id;
    l_tab_avl_csp_sqr(l_tab_avl_csp_sqr.COUNT).sugg_bpa_number    := l_rec_pegged_list (j).bpa_number;
    l_tab_avl_csp_sqr(l_tab_avl_csp_sqr.COUNT).bpa_buy_price_basis := l_rec_pegged_list (j).bpb_type;
    l_tab_avl_csp_sqr(l_tab_avl_csp_sqr.COUNT).bpa_line_num        := l_rec_pegged_list (j).bpa_line_num;
    l_tab_avl_csp_sqr(l_tab_avl_csp_sqr.COUNT).bpa_po_line_loc_id  := l_rec_pegged_list (j).bpa_lloc_id;
    l_tab_avl_csp_sqr(l_tab_avl_csp_sqr.COUNT).bpa_currency_code   := l_rec_pegged_list (j).bpa_curr_code;
    l_tab_avl_csp_sqr(l_tab_avl_csp_sqr.COUNT).bpa_price           := l_rec_pegged_list (j).bpa_price;
    l_tab_avl_csp_sqr(l_tab_avl_csp_sqr.COUNT).bpa_expiration_date := l_rec_pegged_list (j).bpa_expiration_date ;
    l_tab_avl_csp_sqr(l_tab_avl_csp_sqr.COUNT).bpa_quantity        := l_rec_pegged_list (j).bpa_quantity ;
    l_tab_avl_csp_sqr(l_tab_avl_csp_sqr.COUNT).orig_available_qty  := l_rec_pegged_list (j).remaining_aval_qty ;
    Can anyone help with this.

    Thanks in advance,
    Rakesh

    Published by: Vincent Rakesh on April 24, 2013 12:18 AM

    You must add a vacuum-arg set constructor to your type to use, user l_tab_avl_csp_sqr (l_tab_avl_csp_sqr. "COUNTY): = XXSCP_AVL_CSP_SQR_O_TP();

    create or replace
    TYPE XXSCP_AVL_CSP_SQR_O_TP AS
    OBJECT  (
                PLAN_ID             NUMBER,
                SR_INSTANCE_ID      NUMBER,
                INVENTORY_ITEM_ID   NUMBER,
                BASE_ITEM_ID        NUMBER,
                 ITEM_NAME           VARCHAR2(50),
                 SUPPLIER_ID         NUMBER,
                SUPPLIER_SITE_ID    NUMBER,
                NORMAL_BUY_USAGE    VARCHAR2(5),
                AVAILABLE_QUANTITY  NUMBER ,
                SPL_PEG_FLAG        VARCHAR2(10),
                SQR_LINE_ID         VARCHAR2(2000),
                SQR_NUMBER          VARCHAR2(2000),
                SQR_MOQ             NUMBER,
                BPA_PO_LINE_ID      NUMBER,
                SUGG_BPA_NUMBER     VARCHAR2(30),
                BPA_BUY_PRICE_BASIS VARCHAR2(10),
                BPA_LINE_NUM        NUMBER,
                BPA_PO_LINE_LOC_ID  NUMBER,
                BPA_CURRENCY_CODE   VARCHAR2(10),
                BPA_PRICE           NUMBER,
                BPA_PO_HEADER_ID    NUMBER,
                BPA_EXPIRATION_DATE DATE,
                BPA_QUANTITY        NUMBER,
                ORIG_AVAILABLE_QTY  NUMBER,
    /*
    Constructor
    */
                constructor function XXSCP_AVL_CSP_SQR_O_TP return self as result
            );        
    
    create or replace
    TYPE body XXSCP_AVL_CSP_SQR_O_TP AS
    /*
    Constructor
    */
                constructor function XXSCP_AVL_CSP_SQR_O_TP return self as result
                is
                begin
                  return;
                end;
    end;        
    

    You can also assign your attributes that you construct your instance:

    l_tab_avl_csp_sqr.EXTEND(1);
    l_tab_avl_csp_sqr(l_tab_avl_csp_sqr.COUNT) := new XXSCP_AVL_CSP_SQR_O_TP(
      l_tab_planorders (i).l_num_plan_id,
      l_tab_planorders (i).l_num_sr_instance_id.
      l_tab_planorders (i).l_num_inventory_item_id,
      l_tab_planorders (i).l_num_base_item_id,
      l_tab_planorders (i).l_chr_item_name,
      l_tab_planorders (i).l_num_supplier_id,
      l_tab_planorders (i).l_num_supplier_site_id,
      l_rec_pegged_list (j).remaining_aval_qty,
      'Y',
      l_rec_pegged_list (j).sqr_line_id,
      l_rec_pegged_list (j).sqr_number,
      l_rec_pegged_list (j).sqr_moq,
      l_rec_pegged_list (j).bpa_po_line_id,
      l_rec_pegged_list (j).bpa_number,
      l_rec_pegged_list (j).bpb_type,
      l_rec_pegged_list (j).bpa_line_num,
      l_rec_pegged_list (j).bpa_lloc_id,
      l_rec_pegged_list (j).bpa_curr_code,
      l_rec_pegged_list (j).bpa_price,
      l_rec_pegged_list (j).bpa_expiration_date,
      l_rec_pegged_list (j).bpa_quantity,
      l_rec_pegged_list (j).remaining_aval_qty );
    

    Gerard

    Published by: gaverill on April 23, 2013 12:12

  • Detroit SQL of the query in writing: analysis of the GAPS in order of Row_Wid in a Table

    I am writing a query that scans a product Dimension Row_Wid, notes the gaps in the sequence and generates the missing Row_Wids. It loads these 'missing Feds"in a sequence of wid created table to reuse by Informatica transformation of research without bond during the subsequent data loads. Yes, I expect many people asking why I do this. The simple reason is that Informatica has a limit of 2 147 sequence generator 483 647'. I arrived at this upper limit, but my table contains only 2.2 million lines of actual data. I'm trying to reuse these Row_Wids now 'not used '.

    I have a job with success the query to find the first ditch and fill some of that gap. Now my next problem is to figure out how to get my request to move away from the next. I can't use the PL/SQL in the query. My client does not allow its use.

    I'll paste the code I have now. I need to evolve to the next gap. Suggestions? Help? Ideas?



    The Version of database: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi

    The table I'm inserting: CREATE GLOBAL TEMPORARY TABLE "OLAP". "" ROWWIDVAL "("ROWWID"NUMBER (10.0), NUMBER (10,0)"EXTRAVAL") ON COMMIT PRESERVE ROWS;
    A note: the Temp Table to test this point, I've created is "RowWidVal" and it has two columns.

    -Updated Code collaboration-
    Insert Into RowWidVal(
    SELECT
         CASE
              WHEN NumGen <= GapSize+2 THEN (P2.MinGapStart-1)+NG.NumGen
         END RowWid, 0
    FROM
         (SELECT MIN(T4.GapStart) MinGapStart, MIN(T4.GapStop) MinGapStop, (MIN(T4.GapStop) - MIN(T4.GapStart)) GapSize
              FROM
                   (SELECT T2.row_wid + 1 GapStart,
                        (SELECT MIN(T1.row_wid) - 1 FROM w_product_d_test T1 WHERE T1.row_wid > T2.row_wid) GapStop
                        FROM w_product_d_test T2
                        LEFT OUTER JOIN w_product_d_test T3 ON T2.row_wid = T3.row_wid - 1
                   WHERE T3.row_wid IS NULL
                   ) T4
         WHERE T4.GapStop IS NOT NULL
      ) P2,
         (SELECT LEVEL NumGen
          FROM dual
          CONNECT BY LEVEL <= (SELECT ((Min(GapStop) - Min(T4.GapStart)) +1) GapSize
                                   FROM
                                       (SELECT T2.row_wid + 1 GapStart,
                                            (SELECT MIN(T1.row_wid) - 1 FROM w_product_d_test T1 WHERE T1.row_wid > T2.row_wid) GapStop
                                            FROM w_product_d_test T2
                                            LEFT OUTER JOIN w_product_d_test T3 ON T2.row_wid = T3.row_wid - 1
                                            WHERE T3.row_wid IS NULL
                                       ) T4
                                        WHERE T4.GapStop IS NOT NULL)
         ) NG
    WHERE P2.MinGapStart < P2.MinGapStart+(GapSize+2));
    Published by: user1002601 on 16 January 2013 08:33

    Published by: user1002601 on 16 January 2013 08:39

    How about this?

    Sample data:

    SQL> create table w_product_d_test (row_wid number);
    
    Table created
    
    SQL>
    SQL> insert into w_product_d_test (row_wid)
      2  select column_value
      3  from table(sys.odcinumberlist(1,2,3,4,5,11,12,13,31,32,33,34));
    
    12 rows inserted
    
    SQL> select * from w_product_d_test;
    
       ROW_WID
    ----------
             1
             2
             3
             4
             5
            11
            12
            13
            31
            32
            33
            34
    
    12 rows selected
     
    

    Generate sequence available numbers:

    SQL> with gaps as (
      2    select rw, gapsize
      3    from (
      4      select row_wid as rw
      5           , row_wid - lag(row_wid,1,0) over(order by row_wid) - 1 as gapsize
      6      from w_product_d_test
      7    )
      8    where gapsize > 0
      9  )
     10  select g.rw - t.column_value as available_rw
     11  from gaps g
     12     , table(
     13         cast(
     14           multiset( select level from dual connect by level <= g.gapsize )
     15           as sys.odcinumberlist
     16         )
     17       ) t
     18  ;
    
    AVAILABLE_RW
    ------------
              10
               9
               8
               7
               6
              30
              29
              28
              27
              26
              25
              24
              23
              22
              21
              20
              19
              18
              17
              16
              15
              14
    
    22 rows selected
     
    

Maybe you are looking for

  • Adding redundancy backup with time Capsules

    Are there problems associated with adding a second time Capsule to my system in order to add additional redundancy and safety of my backup options? I have a MacBook Pro and a single Capsule of 3 TB. I am looking for a non-Cloud option add extra secur

  • What happened to HP?

    After 10 years with my previous HP desktop computer, I decided its time to buy a new one. I bought a H8 - 1360t. I was more than a little upset to see him showing pickup FedEx Tracker location was: Chihuahua, Mexico. After childbirth, I couldn't beli

  • If, else statements for a c# Console text adventure game

    I need help for a small project. I'm learning a bit of code before going to College in the fall, so I have some experience. I am using Visual c# Express 2010. I'm debut with console applications. Basically, I was looking for websites and YouTube vide

  • BlackBerry phone Q10 automatically answers call

    I have a flip case for my phone. When the phone rings and I open flip answer the call automatically which removes the option to not take the call. It starts only yestrerday who happens, before I could open the suitcase and answer calls normally. No i

  • BBM's temporary server error

    I hv just update my BBM to 2.4.0.8 on my lenovo s930, then temporary BBM Server error. Please fix it, thank you