Range Partitioniung problems

Hi All,
I created a table as follows and wanted to test how a partition by range works.
CREATE TABLE test_partition
( emp_id NUMBER,
  time_period_from DATE,
  time_period_to DATE,
  time_period_desc VARCHAR(10),
  empfigure NUMBER, CONSTRAINT pk_test PRIMARY KEY (emp_id,time_period_from,time_period_to,time_period_desc)
  PARTITION BY RANGE(time_period_from)
  (PARTITION jan2009 VALUES LESS THAN ('01-Feb-2009') TABLESPACE tbl1,
   PARTITION feb2009 VALUES LESS THAN ('01-Mar-2009') TABLESPACE tbl1,
   PARTITION oth VALUES LESS THAN (MAXVALUE) TABLESPACE tbl1
   )I inserted the data as follows:
1000    2/1/2009    2/28/2009    'Month'    6000
1000    2/15/2009    2/15/2009    'Day'    4000
1000    2/16/2009    2/16/2009    'Day'    2000
1000    3/1/2009    3/31/2009    'Month'    10000
1000    3/15/2009    3/15/2009    'Day'    5000
1000    3/16/2009    3/16/2009    'Day'    5000
2000    2/1/2009    2/28/2009    'Month'    6000
2000    2/15/2009    2/15/2009    'Day'    4000
2000    2/16/2009    2/16/2009    'Day'    2000
2000    3/1/2009    3/31/2009    'Month'    10000
2000    3/15/2009    3/15/2009    'Day'    5000
2000    3/16/2009    3/16/2009    'Day'    5000Following are my Questions:
1)     How does partition help in this case when I do a select query,
Select * from test_partition where to_date(time_period_from) > ’01-Feb-2009’
and to_date(time_period_to) < ’01-Mar-2009’??
I could see from the plan table that all the partitions are scanned…
Then what is the use of partitions exactly?
2)     Is it that I need to force the user to use the partition explicitly in the select queries? If that is the case when there is an application where a user can select a date range in the front-end, then how do I dynamically determine which partition to use? Any samples for that?
3)     The most worrying part:
SELECT table_name, partition_name,num_rows
FROM user_tab_partitions
WHERE lower(table_name) = 'test_partition';
TABLE_NAME             PARTITION_NAME     NUM_ROWS
'TEST_PARTITION'     'FEB2009'     
'TEST_PARTITION'     'JAN2009'     
'TEST_PARTITION'     'OTH'    There are no rows inserted in partitions??? (Since num_rows is null in each case)

Ok just got into the concept of partitions.........
So this is what i did for the testing.... Still not able to get the concpet
(1)
/* Formatted on 2008/08/15 12:40 (Formatter Plus v4.8.8) */
CREATE TABLE test_partition
( emp_id VARCHAR2(30),
  time_period_from DATE,
  time_period_to DATE,
  time_period_desc VARCHAR(10),
  empfig NUMBER
  PARTITION BY RANGE(time_period_from)
  (PARTITION jan2008 VALUES LESS THAN( TO_DATE('01-Feb-2008','dd-mon-yyyy')) TABLESPACE esmdata,
   PARTITION feb2008 VALUES LESS THAN (TO_DATE('01-Mar-2008','dd-mon-yyyy') )TABLESPACE esmdata,
   PARTITION mar2008 VALUES LESS THAN (TO_DATE('01-Apr-2008','dd-mon-yyyy') )TABLESPACE esmdata,
   PARTITION oth VALUES LESS THAN (MAXVALUE) TABLESPACE esmdata
(2)
INSERT /*+ APPEND */ INTO  test_partition
   SELECT eid,
          time_period_from,
          time_period_to,
          time_period_desc,
          nof_disp_complete
     FROM emp_tab
    WHERE time_period_from BETWEEN to_date('01-jan-2008','dd-mon-yyyy') AND to_date('30-Apr-2008','dd-mon-yyyy')
(3)
analyze table TEST_PARTITION compute statistics;
(4)
SELECT *
    FROM test_partition
   WHERE time_period_from = '01-Mar-2008'
ORDER BY emp_id,
         time_period_from
toad  plan
Time     Plan
     SELECT STATEMENT               
3           3 PARTITION RANGE SINGLEPartition #: 1  Partitions accessed #3          
2                2 SORT ORDER BY     
1                     1 TABLE ACCESS FULL TABLEPartition #: 3  Partitions accessed #3
(5)
SELECT *
    FROM test_partition
   WHERE trunc(time_period_from) = '01-Mar-2008'
ORDER BY emp_id,
         time_period_from
toad plan
Time     Plan
     SELECT STATEMENT               
3           3 SORT ORDER BY          
2                2 PARTITION RANGE ALLPartition #: 2  Partitions accessed #1 - #4     
1                     1 TABLE ACCESS FULL TABLEPartition #: 2  Partitions accessed #1 - #4Not sure why all the partitions are scanned in the last case........... eventhough the data has been partitioned according to the date.....
Can you folks help me... Because I have queries which always has to go to the first of the months and select one months worth of data and hence using trunc('MM') and also last_day() fucntion in oracle..... Just wanted to check how to use the partitions in this case....
Also just to mention , there are nearly 1 million record in this table
regds,
Saff
Message was edited by:
saffron

Similar Messages

  • I updated my IPhone 3GS to the new 5.1 operating system and have since had a range of problems with not only my phone but also my IPad.

    I updated my IPhone 3GS to the new 5.1 operating system and have since had a range of problems with not only my phone but also my IPad.
    Programs (Safari, mail, messages) keep crashing, mail will not delete properly (some will keep popping into my inbox again for no reason!!!), slow, settings lock up etc. etc.
    This only seemed to become an issue once I updated to ios 5.1 and funnily also affected my Ipad even though i hadn't updated the software yet. I have since updated the software on my ipad thinking it might help too but that only made things worse!! So I am not sure if it's an ICloud issue, but when i try to disable ICloud my devices lock up as well.
    The battery life is also shocking!!
    I have hard reset both devices, restored both devices, reset the setting and tried a whole host of other suggestions (like closing background programs) on this forum buit nothing works and i am tearing my hair out.
    I looked in the phone and ipad log and there do seem to be low memory reports though i don't know why these are occuring now when they never have before??
    I don't know if I can restore the old operating system (If I can please let me know how). The phone or ipad are not jailbroken.

    but you should have a backup in itunes.
    Every time you sync your iOS device iTunes creates a backup. go check if its there, iTunes Preferences >Devices. and there you should see if you have a backup, and in case from which date the backup is.
    And ofcourse you can get your icloud data back by just logging in with your Appleid under icloud in settings on the iphone.
    But anyway, if the iPhone works when you restor it as new: try adding your backup, and see if the issue comes back. And experiment with your backup and try to work out what is causing the issue, my guess is that its some app!   Good Luck!

  • MIRO document Number range buffering problem

    Dear all,
    My MIRO document number is not following the sequence. if my first 5 numbers come in a sequence, then the next 5 numbers are not coming in between. Instead, the next 5 numbers are coming. It might be due to number range buffering problem. How to find the number range object  for  MIRO document number range?
    How to solve this?
    Please suggest.
    I will award full points.
    Thanks & Regards,
    AR

    Hii,
    You can search the Number Range object in T-Code: SNRO
    The Number Range object for Invoice document is RE_BELEG
    Go the Change Mode of the Number Range Object in SNRO, remove the No of Numbers of Buffers (by default it will be 10).
    This will resolve your issue.
    Regards,
    Kumar

  • Date range query  problem  in report

    Hi all,
    I have created a report based on query and i want to put date range selection but query giving problem.
    If i am creating select list selection then it is working fine means it will display all records on the particular date.
    But what i need is that user will enter date range as creation_date1,creation_date2 and query should return all the records between these date range. i want to pass it by creating items, i created two items and passing creation_date range to display all records but not displaying and if not passing date then should take null as default and display all records
    Here is the query:
    /* Formatted on 2006/12/10 20:01 (Formatter Plus v4.8.0) */
    SELECT tsh."SR_HEADER_ID", tsh."SALES_DEPT_NUMBER", tsh."COUNTRY",
    tsh."LOCAL_REPORT_NUMBER", tsh."ISSUE_DATE", tsh."SUBJECT",
    tsh."MACHINE_SERIAL_NUMBER", tsh."MACHINE_TYPE", tsh."MACHINE_HOURS",
    tsh."STATUS"
    FROM "TRX_SR_HEADERS" tsh, "TRX_SR_PARTS" tsp
    WHERE (tsh.status LIKE :p23_status_sp OR tsh.status IS NULL)
    AND (tsh.machine_type LIKE :p23_machine_type_sp)
    AND ( tsh.machine_serial_number LIKE
    TO_CHAR (:p23_machine_serial_number_sp)
    OR tsh.machine_serial_number IS NULL
    AND ( TO_CHAR (tsh.failure_date, 'DD-MON-YY') LIKE
    TO_CHAR (:p23_failure_date_sp)
    OR TO_CHAR (tsh.failure_date, 'DD-MON-YY') IS NULL
    AND ( TO_CHAR (tsh.creation_date, 'DD-MON-YY')
    BETWEEN TO_CHAR (:p23_creation_date_sp)
    AND TO_CHAR (:p23_creation_date_sp1)
    OR TO_CHAR (tsh.creation_date, 'DD-MON-YY') IS NULL
    AND (tsh.issue_date LIKE :p23_date_of_issue_sp OR tsh.issue_date IS NULL)
    AND (tsh.country LIKE :p23_country_sp OR tsh.country IS NULL)
    AND ( tsh.local_report_number LIKE TO_CHAR (:p23_local_rep_num_sp)
    OR tsh.local_report_number IS NULL
    AND ( tsp.part_number LIKE TO_CHAR (:p23_part_number_sp)
    OR tsp.part_number IS NULL
    AND tsh.machine_type IN (
    SELECT DISTINCT machine_type
    FROM trx_sales_dept_machine_list
    WHERE sales_department_id IN (
    SELECT DISTINCT sales_department_id
    FROM trx_user_sales_department
    WHERE UPPER (user_name) =
    UPPER ('&APP_USER.'))
    AND SYSDATE >= valid_from)
    AND tsh.sr_header_id = tsp.sr_header_id
    can any one tell me wat is wroung in this query.
    Any other way to write this?
    Thank You,
    Amit

    Hi User....
    Here is some date range SQL that my teams uses with some success:
    For date columns that do not contain NULL values, try this (note the TRUNC, it might help with your "today" problem).
    The hard coded dates allow users to leave the FROM and TO dates blank and still get sensible results (ie a blank TO date field asks for all dates in the future.
    AND TRUNC(DATE_IN_DATABASE)
    BETWEEN
    decode( :P1_DATE_FROM,
    TO_DATE('01-JAN-1900'),
    :P1_DATE_FROM)
    AND
    decode( :P1_DATE_TO,
    TO_DATE('31-DEC-3000'),:
    :P1_DATE_TO)
    For date columns that contain NULL values, try this (a little bit trickier):
    AND nvl(TRUNC(DATE_IN_DATABASE),
    decode( :P1_DATE_FROM,
    decode( :P1_DATE_TO,
    TO_DATE('30-DEC-3000'),
    NULL),
    NULL)
    BETWEEN
    decode( :P1_DATE_FROM,
    TO_DATE('01-JAN-1900'),
    :P1_DATE_FROM)
    AND
    decode( :P1_DATE_TO,
    TO_DATE('31-DEC-3000'),
    :P1_DATE_TO)
    Note the 30-DEC-3000 versus 31-DEC-3000. This trick returns the NULL dates when the FROM and TO date range items are both blank.
    I hope this helps.
    By the way, does anyone have a better way of doing this? The requirement is given a date column in a database and a FROM and a TO date item on a page,
    find all of the dates in the database between the FROM and TO dates. If the FROM date is blank, assume the user want all dates in the past (excluding NULL dates). If the TO date is blank, assume that the user wants all of the dates in the future (excluding NULL dates). If both FROM and TO dates are blank, return all of the dates in the databse (including NULL dates).
    Cheers,
    Patrick

  • For all Enteries in & Ranges Performance Problem

    Is there any soln of For all enteries in & Ranges as
    If i use for all enteries in my report, it becomes slow .
    and if i use Ranges , if no. of record exceeds system will throw dump.
    Since long i couldnt find any good soln for this problem , can anyone guide me
    how to solve this problem.
    Thanks

    Hi All
    I am pasting down query for more expert optimzation comments of the current probs
    SELECT zsd_weigh_bridg1~weight_no zsd_weigh_bridg1~challn_no
               likp~vbeln AS likp_vbeln likp~lfdat
               lips~vgbel
               vbfa~vbeln AS vbfa_vbeln vbfa~vbtyp_n
               mkpf~budat
    *         vtfa~vbeln AS vtfa_vbeln
               ekko~knumv AS ekko_knumv
               ekpo~inco1 ekpo~werks
               APPENDING CORRESPONDING FIELDS OF TABLE lit_in
          FROM zsd_weigh_bridg1
               INNER JOIN likp ON likp~traid = zsd_weigh_bridg1~weight_no
               INNER JOIN lips ON lips~vbeln = likp~vbeln
               INNER JOIN vbfa ON vbfa~vbelv = likp~vbeln
               LEFT OUTER JOIN mkpf ON mkpf~mblnr = vbfa~vbeln
               LEFT OUTER JOIN vtfa ON vtfa~vbelv = vbfa~vbeln
               INNER JOIN ekko ON ekko~ebeln = lips~vgbel
               INNER JOIN ekpo ON ekpo~ebeln = ekko~ebeln
    *           FOR ALL ENTRIES IN git_bridge
          WHERE zsd_weigh_bridg1~weight_no  in r_weight." git_bridge-weight_no ." r_weight.
      ENDIF.
      lit_in_tmp[] = lit_in[].
      DELETE lit_in_tmp  WHERE vbtyp_n NE '8'.
      IF lit_in_tmp[] IS NOT INITIAL.
        SELECT mandt knumv kposn vbeln netwr netpr INTO TABLE lit_vfsi
          FROM vfsi FOR ALL ENTRIES IN lit_in
         WHERE vbeln EQ lit_in-likp_vbeln.
        SELECT mandt tknum vbelv posnv vbtyp_v vbeln posnn vbtyp_n
               INTO TABLE lit_vtfa
          FROM vtfa FOR ALL ENTRIES IN lit_in
         WHERE vbelv EQ lit_in-vbfa_vbeln.
        IF lit_vtfa[] IS NOT INITIAL.
          SELECT mandt fknum fkpos knumv
            FROM vfkp INTO CORRESPONDING FIELDS OF TABLE lit_vfkp
                 FOR ALL ENTRIES IN lit_vtfa
           WHERE fknum EQ lit_vtfa-vbeln.
        ENDIF.
      ENDIF.

  • SNRO - Creation of Number range object problem

    Hi Experts,
    i wanted to create a number range object thru SNRO.
    The creation was successful in DEV system.
    when i tried to create the same number range object in QA server, i am getting the following error
    "Changes to Repository or cross-client Customizing are not permitted - Choose 'Display object' or 'Cancel'."
    this is a Znumber range used to generate sequential numbers using FM NUMBER_GET_NEXT
    What could be the problem. how to over come this?
    Is it the missing authorizations? if so what could be the authorization object (SU53 shows nothing)
    Appreciate any help in this regard.
    Thanks
    Simha

    Hi All,
    I am confused with the conflicting answers for my problem. But anyways i could transport the number range object and could create a number range interval in QAS.
    Thanks a lot for all your valuable inputs.
    But i am still not out of this so called misconception - Are number range objects to be transported to QA or to be created afresh in QA/PRD?
    Earlier some one told to be created but now i see they can be transported.
    I was not ready to edit the options in SCC4 for the client to enable object creation.
    Thanks again,
    Simha

  • RANGE + INTERVA + Null in range key problem

    Hello All:
    I have problem when A1 table has null value in Start_Date field or in the future when the user will not enter any value to Start_date field. It gave me error message "ORA-14400:
    inserted partition key does not map to any partition". How can I solve null value in the partition range interval key.
    CREATE TABLE A2
    PARTITION BY RANGE (Start_Date) INTERVAL (NUMTOYMINTERVAL(1,'YEAR'))
    (     PARTITION ACTION1_OLDER VALUES LESS THAN (TO_DATE('01/01/2008','MM/DD/YYYY')) ,
         PARTITION ACTION1_2008 VALUES LESS THAN (TO_DATE('01/01/2009','MM/DD/YYYY'))
    PARALLEL NOLOGGING AS SELECT * FROM A1;
    Thanks,
    Mohammed Alsabie

    "ORA-14400: inserted partition key does not map to any partition
    Cause: An attempt was made to insert a record into, a Range or Composite Range object, with a concatenated partition key that is beyond the concatenated partition bound list of the last partition -OR- An attempt was made to insert a record into a List object with a partition key that did not match the literal values specified for any of the partitions.
    Action: Do not insert the key. Or, add a partition capable of accepting the key, Or add values matching the key to a partition specification"
    http://docs.oracle.com/cd/E11882_01/server.112/e17766/e12700.htm#sthref4775
    Can't you possibly add a so called 'JUNK'-partition?
    Or see/search: http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:1392403659992#1044263100346496877

  • Number Range Maintain Problem

    Hi to ALL PP Gurus
    I am new to this site
    My issue is inFBN1 i was try to matin nuber range for goods recipt i.e. for 50 siries
    like from 5000000000 to 5099999999 but system show "define number range without overlap"
    how to main tain numbers
    and how to reward point for reply, how to close Thread
      Regards
    DEV

    Dev
    1)The OVER LAP Means some of the numbers between your Number Ranges Specified was already declared in that FBN1, so you have to start and end with Numbers not assigned in the Number Range
    For Eg if you are in Ides means that Number ranges has already available for the year 9999 in FBN1 Transaction , that's why it is througing error.
    2) Rewarding Point
    You can see in the left side of the reply of thread points like 6 , 4 and 2 with respect to completely solved the problem, ...etc, you have to just click that Bullet is enough for rewarding
    3) Closing of thread
    In the top area of your thread you can find ANSWERD , if you click, that thread will closed

  • WRT160n Port Range forwarding problem

    I have a WRT160n that I am trying to forward some ports on for some DVR equipment. When I use the single port forwarding and enter each port separately it works fine. But I have 2 DVR's and they use a bunch of ports each so I want to use the port range forwarding because there are not enough spots in the single port forwarding section. The ports I am trying to forward are 8000-8004 for one IP address and 8005-8009 for a second IP address. I have entered it into the port range forwarding section but I can not connect from outside my network. As I said if I enter them in the single port section seperately as 8000,8001,8002,8003,8004 then I can connect fine outside my network. Any idea's what the problem is?

    chuckb223 wrote:
    jaymay wrote:
    How about you isolate it first by forwarding the ports for one DVR. Forward them one by one on the Port Forwarding Range page then see if it works on one DVR. If it will, try to do the same thing for the other DVR.
    Yes I already tried this with no luck. I tried just opening one port in the port forwarding for 1 DVR and it did not work, Opening this same port in the single port forwarding did work.
    Is your router a version 1,2, or 3? Your router probably needs to be updated (firmware).
    Firmware
    11/08/2010
    Ver.1.02.11
    Download
    3.15 MB
    Firmware
    11/15/2010
    Ver.2.0.03 Build 9
    Download
    3.25 MB
    Firmware
    07/12/2010
    Ver.3.0.03 Build 3
    Download
    3.31 MB
    And then reset and reconfigure your router again for internet connection and try the port range forward again and see if you can both DVRs working properly.

  • Range selection Problem

    Hi , I am having a small problem
    I have used PL/SQL block to solve this but eager to know if it can be done by single SQL query
    Test Case
    create table test_dev (Identifier varchar2(50), ID_val number);
    insert into test_dev (identifier, id_val) values ('a',1);
    insert into test_dev (identifier, id_val) values ('a',2);
    insert into test_dev (identifier, id_val) values ('a',3);
    insert into test_dev (identifier, id_val) values ('a',5);
    insert into test_dev (identifier, id_val) values ('b',6);
    insert into test_dev (identifier, id_val) values ('b',7);
    insert into test_dev (identifier, id_val) values ('b',8);
    commit;
    select * from test_dev ;
    identifier id_val
    a 1
    a 2
    a 3
    a 5
    b 6
    b 7
    b 8
    I need out put as
    identifier id_min_val id_max_val
    a 1 3
    a 5 5
    b 6 8
    Range is selected as id_val column does not have consecutive value (e.g.. id_val column values 1,2,3 after that 4 is missing again starts from 5, hence forming a range from 1 to 3)
    Please let me if it can be done in one SQL query (May be with analytical fountains)
    Edited by: user1535868 on Jan 19, 2009 5:55 AM

    And the proof:
    SQL> select identifier, min(id_val), max(id_val)
      2  from (select distinct identifier, id_val from test_dev)
      3  group by identifier, id_val-rownum
      4  /
    IDENTIFIER                                         MIN(ID_VAL) MAX(ID_VAL)
    b                                                            8           8
    a                                                            5           5
    a                                                            3           3
    a                                                            2           2
    a                                                            1           1
    b                                                            6           6
    b                                                            7           7
    7 rows selected.
    SQL> explain plan for
      2  select identifier, min(id_val), max(id_val)
      3  from (select distinct identifier, id_val from test_dev)
      4  group by identifier, id_val-rownum
      5  /
    Explained.
    SQL> @?\rdbms\admin\utlxpls
    PLAN_TABLE_OUTPUT
    Plan hash value: 2826075366
    | Id  | Operation             | Name     | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT      |          |     7 |   280 |     5  (40)| 00:00:01 |
    |   1 |  HASH GROUP BY        |          |     7 |   280 |     5  (40)| 00:00:01 |
    |   2 |   COUNT               |          |       |       |            |          |
    |   3 |    VIEW               |          |     7 |   280 |     4  (25)| 00:00:01 |
    |   4 |     HASH UNIQUE       |          |     7 |   280 |     4  (25)| 00:00:01 |
    |   5 |      TABLE ACCESS FULL| TEST_DEV |     7 |   280 |     3   (0)| 00:00:01 |
    PLAN_TABLE_OUTPUT
    Note
       - dynamic sampling used for this statement
    16 rows selected.
    SQL> As you can see, in newer versions distinct can be acomplished via HASH UNIQUE.
    SY.

  • Range expander problem

    hi
    i have a problem with the range expander
    i have linksys wireless router WAG54G V.2
    and i bought the range expander from linksys but when ever i turn the range expander on i can not use the internet. it becomes a local network only
    when i turn the range expander off everything goes to normal
     i am using both the range expander and the router as i bought them without any updates
    i do not have much information about this stuff so please if you are goig to help me explain in details
    thank you

    so it is useless? and i wasted my money !!

  • Ene cir receiver I/O Range Conflict Problem

    Hi everyone,
    I have a problem which is "Input/Output Range 0380 - 0383 used by: Motherboard resources" problem under conflicting device list under ENE CIR Recevir. My machine is dv7-2133et and I have win7 32bit ultimate. Please help..
    Thanks in advance..

    Hi,
    I have a Pavilion DV6-1245dx, and the same problem with "ENE CIR Receiver",
    Input/Output Range 0380 - 0383 used by:
      Motherboard resources
    I have Windows 7 HomePremium x64, and it's after a clean install(I tried clean installs with different order to how I install drivers), and it happens no matter the order in which I install the drivers. I have the latest driver(tried older ones too) for ENE CIR Receiver, I tried the solution with PCI Lock, but no succes, the remote control still doesn't work(meaning the laptop doesn't receive the signal, but the remote is functional).
    Any news about this problem and how to fix it???
    Thanks!!!

  • Port Range Forwarding Problem for E3000 and Iomega HMNHD Cloud

    I'm trying to set up an Iomega Home Media Network Cloud NAS and I'm having problems with opening ports 50500-50599.  I have opened port 80 and 443 successfully and included the above port range above as well, but when I check it on www.yougetsignal.com the ports 50500-50599 are still closed.  I even tried to split the range in two parts, and still no success.  I have been in contact with my ISP and confirmed they do not block any ports in the 50500-50599 range and that the cable modem (a Motorola SBV5120) is operating in Bridge Mode.
    I am operating under an older firmware and hope that is not the cause of this problem.  Also, using Win7 and Vista (tried and failed on 2 laptops).
    Did I forget anything?  Any suggestions/solutions?  Thanks.

    You may want to check out the list of tested hard drives to work with this router first. The link is E3000 and E2100L hard disk compatibility list. Based on the list, your iomega home media is not included. On the link for the tested hard drives to work with E3000, it is indicated that if your hard drive is not on the list, it may or may not work. With your case, since it is not working it may be due to compatibility issue.

  • GetBytes:range buffer problem

    Hi to all...here comes another problem.
    Then...i read the data ready in the socket, with [socket readData], ad store the data in a NSData object called header. Then, i need to controll the first two byte of my 'header' object and then compare them with a unsigned short number (something like 0x...) ...i suppose i need to use the method getBytes:range (i use range because after that, i will read the second four bytes, and then the third two bytes)...but now: the sintax is (void)getBytes:(void *) buffer range:(NSRange) range:
    buffer is the buffer into which to copy data... but, how do i initialize this buffer? How if i have to compare the content of the buffer with an unsigned short?
    Thank you!

    unsigned short magicNumber = 0xFFFF; // Or whatever your number is/should be.
    unsigned short buffer;
    [data getBytes: & buffer range: NSMakeRange(0, 2)];
    Now, before you can compare, you need to decide on a very important plot point. What is the endian format of the number in the stream? What is the endian format of the machine you are on? You will probably have to use one of the htons functions.

  • Number range transport problem in Internal orders

    Hi,
    I created new internal order type in KOT2_OPA t. code and at the time of saving it is asking number range. so i assigned one number range interval to the order type and saved the application in development server and noted down the request number. i released the request to the Testing and Quality server. in that it is not showing the number range in quality server. What i have to do. Does i have to do any configuration for the moving of number ranges to testing from development. please guide me deeply it is very urgent for me.

    Hi,
    Number range objects can be saved in workbench requests & transported manually.
    Thanks
    Kishore

Maybe you are looking for