Rnumber in ddi_regs_map_setup

Hi All,
I have a doubt on ddi_regs_map_setup fn call.
In the ddi_regs_map_setup the explanation for
rnumber is.
rnumber - Index number to the register address
space set.
How do we know whether the address space is I/O
or memory address space.
Is there any documentation on this rnumber it would
be of great help.
Regards,
Sumanth

Hi,
Check the following document:
"Writinng Solaris PCI Device Drivers" (page: 9)
at:
http://soldc.sun.com/developer/support/driver/docs/docs.html
which explains this in detail.
HTH
Gopinath.
Sun - Developer Technical Support.

Similar Messages

  • Ddi_regs_map_setup rnumber parameter

    Can anyone expand on the explanation of rnumber in the
    man page for ddi_regs_map_setup ? I am confused about
    what value I need to supply. What is the register address
    space set it refers to?
    rnumber Index number to the register address space set.

    The register information can be found from the reg property (see "prtconf -vp"). The format of this property is bus dependant and can be found in the man pages for isa(4), pci(4) and sbus(4).
    Hope this helps.

  • Need guidance on using ddi_regs_map_setup solaris system call

    Hi all,
    Am a beginner in using Sun Solaris.
    I am working on porting our source code from linux to solaris.
    In Linux we are using inb/outb to read/write to keyboard data port(0x60) .
    I know that there is an equivalent system call for inb/outb in solaris. But in man page(of sun os) it is mentioned that inb/ outb are obsolete. It was mentioned that we can use ddi_get8/ddi_put8 functions respectively.
    ddi_get8 call requires ddi_acc_handle_t as a parameter which we can get it from ddi_regs_map_setup system call.
    Syntax for this call is:
    int ddi_regs_map_setup(dev_info_t *dip, uint_t rnumber,
    caddr_t *addrp, offset_t offset, offset_t len,
    ddi_device_acc_attr_t accattrp, ddi_acc_handle_t handlep);
    Please let me know where does the 0x60 port number fits in the above system call and what does these parameters rnumber, offset, len corresponds to ?

    Hi,
    The Fault_PC 0x13575e8 tells you exactly where you
    die. I assume you have used this in mdb on
    the core file to find you are dying in the ddi_get8 call?
    Are you checking return value of ddi_regs_map_setup?
    Are you sure the register you are accessing is in register set 1?
    Are there other places prior to the panic where
    the ddi_get/ddi_put routines work correctly? A bus error
    here generally means the location you are trying to access
    does not exist on the device. (It could also be alignment,
    but not with ddi_get8). The address
    looks like 1fe.02001400, which looks like a possibly
    valid address in I/O space.
    I would print the value of wc->ioaddr to make sure
    it is a valid virtual address.
    Hi,
    I'm in the middle of porting a device driver for a
    PCI card from linux to solaris (it's wcfxo from
    zaptel - part of asterisk).
    >
    WARNING: [AFT1] Bus Error on System Bus in privileged
    mode from CPU0 Data access at TL=0, errID
    0x0000000b.985ccf88
    AFSR 0x00000000.84000000<PRIV,BERR> AFAR
    AFAR 0x000001fe.02001400
    AFSR.PSYND 0x0000(Score 05) AFSR.ETS 0x00
    0x00 Fault_PC 0x13575e8
    UDBH 0x0000 UDBH.ESYND 0x00 UDBL 0x0000
    0000 UDBL.ESYND 0x00
    panic[cpu0]/thread=2a10007dd40: [AFT1] errID
    0x0000000b.985ccf88 BERR Error(s)
    See previous message(s) for detailsThe actual code which seems to cause the panic is:
    #define inb(a)          ddi_get8(wc->devhandle, a)
    ints = inb(wc->ioaddr + WC_INTSTAT);where there initialisation includes:
    static struct ddi_device_acc_attr dev_attr = {
    DDI_DEVICE_ATTR_V0,
    DDI_STRUCTURE_LE_ACC,
    DDI_STRICTORDER_ACC
    ddi_regs_map_setup(wc->dip, 1, &wc->ioaddr, 0, 255,
    &dev_attr,
    &dev_attr, &wc->devhandle);I've tested the same card in a linux x86 box, and it
    works fine, so I'm happy it's not a hardware
    problem.
    Any suggestions on what might be causing this?
    Thanks,
    Simon

  • Ddi_regs_map_setup fails

    Hi all,
    I have a device as for which I am trying to do a IO_MAPPED driver.
    I am doing on my Ultra60 the following code:
    size_t memory_size;
    for( i=0; i<6; i++ )
    ddi_dev_regsize(dip, i, &memory_size);
    result = ddi_regs_map_setup(dip, i,
    &drx->ioBase.address, 0, mem_size,
    &devAttr, &drx->ioBase.handle);
    printf("ddi_regs_map_setup(,%d,,,0x%X,,)
    returned %d\n", i, mem_size, result );
    if (result == DDI_SUCCESS)
    ddi_regs_map_free(&drx->ioBase.handle);
    On the Ultra60, the reg sizes are:
    ddi_regs_map_setup(,0,,,0x0,,) returned 0
    ddi_regs_map_setup(,1,,,0x100,,) returned 0
    ddi_regs_map_setup(,2,,,0x1000,,) returned -7
    ddi_regs_map_setup(,3,,,0x100,,) returned 0
    ddi_regs_map_setup(,4,,,0x1000,,) returned -7
    ddi_regs_map_setup(,5,,,0x0,,) returned -6
    My question is, if I want to map more than 0x200 sized device memory, how do i do it? Because rnumber 1 & 3 will allow me to map registers of sizes 0x100 each only!
    or am i understanding this wrong?
    any help appreciated!
    Thanks!

    each of the registers covers an area of pci bus address space supplied by the card
    why don't you print out the return value from ddi_dev_regsize() as that will tell you
    how much space the card is exporting for each of the registers .
    tim

  • Ddi_regs_map_setup fails in solaris 11

    Hi
    I have a driver (parent=isa) in x86 that ioremaps (ddi_regs_map_setup) a physical address range between 0xE0000 and 0xF0000.
    This is a device memory mapped region.
    The ddi_regs_map_setup was successful in solaris 10 (32 bit and 64 bit) but fails in solaris 11.
    The warning message
    WARNING: isa_apply_range: Out of range base <base> size <size>
    The ddi_regs_map_setup goes through for the same region if driver made as parent=pci instead of parent=isa.
    Would be helpful if someone could point out why this happens in solaris 11?
    cheers

    each of the registers covers an area of pci bus address space supplied by the card
    why don't you print out the return value from ddi_dev_regsize() as that will tell you
    how much space the card is exporting for each of the registers .
    tim

  • Getting compilation error while writing standalone for ddi_get8

    Hi All,
    I have already posted a thread regarding ddi_regs_map_setup solaris system call guidance.
    [Previous Query|https://forums.oracle.com/forums/thread.jspa?threadID=2314211&tstart=0]
    I am writing a standalone to use this system call.
    Below is my partial standalone where i have only the declaration part:
    #include <stdio.h>
    #include <sys/dditypes.h>
    #include <sys/conf.h>
    #include <sys/ddi.h>
    #include <sys/sunddi.h>
    int main()
    dev_info_t *dip;
    uint_t rnumber;
    ushort_t *dev_addr;
    offset_t offset;
    offset_t len;
    ushort_t dev_command;
    ddi_device_acc_attr_t dev_attr;
    ddi_acc_handle_t handle;
    dev_attr.devacc_attr_version = DDI_DEVICE_ATTR_V0;
    dev_attr.devacc_attr_endian_flags = DDI_STRUCTURE_LE_ACC;
    dev_attr.devacc_attr_dataorder = DDI_STRICTORDER_ACC;
    return 0;
    The standalone give the following compilation errors:
    ddiSystemcall.c: In function `main':
    ddiSystemcall.c:15: error: `ddi_device_acc_attr_t' undeclared (first use in this function)
    ddiSystemcall.c:15: error: (Each undeclared identifier is reported only once
    ddiSystemcall.c:15: error: for each function it appears in.)
    ddiSystemcall.c:15: error: syntax error before "dev_attr"
    ddiSystemcall.c:16: error: `ddi_acc_handle_t' undeclared (first use in this function)
    ddiSystemcall.c:17: error: `dev_attr' undeclared (first use in this function)
    ddiSystemcall.c:17: error: `DDI_DEVICE_ATTR_V0' undeclared (first use in this function)
    ddiSystemcall.c:18: error: `DDI_STRUCTURE_LE_ACC' undeclared (first use in this function)
    ddiSystemcall.c:19: error: `DDI_STRICTORDER_ACC' undeclared (first use in this function)
    Please let me know where am i going wrong.
    Thanks in advance.

    Hi,
    there is a WebCenter forum for WebCenter releated questions: WebCenter Portal
    Frank

  • Specific code for device- kernel mem mapping

    I would like to see an example of device memory to kernel memory mapping code.
    Yes, there is a section in WDD about memory mapping, but it is geared towards device<->USER-memory mapping.
    or kernel<-> user-memory mapping.
    Could someone please point me towards a specific example of doing device<->kernelspace memory mapping?

    I would like to see an example of device memory to
    kernel memory mapping code.[CUT]
    Could someone please point me towards a specific
    example of doing device<->kernelspace memory
    mapping?look at the ddi_regs_map_setup(9F) man page. Devices have register
    blocks. Assuming this is a PCI card, the pci config registers will be
    rnumber=0, device specific registers are usually rnumber=1,
    and some device have more after that (i.e. if they have on board memory,
    it could be mapped in rnumber=1 or rnumber=2 or even have
    a way to access it through config space.
    MRJ

  • PCI register mapping

    Hi all,
    I have a device as for which I am trying to do a IO_MAPPED driver.
    I am doing on my Ultra60 the following code:
    size_t memory_size;
    for( i=0; i<6; i++ )
    ddi_dev_regsize(dip, i, &memory_size);
    result = ddi_regs_map_setup(dip, i,
    &drx->ioBase.address, 0, mem_size,
    &devAttr, &drx->ioBase.handle);
    printf("ddi_regs_map_setup(,%d,,,0x%X,,)
    returned %d\n", i, mem_size, result );
    if (result == DDI_SUCCESS)
    ddi_regs_map_free(&drx->ioBase.handle);
    On the Ultra60, the reg sizes are:
    ddi_regs_map_setup(,0,,,0x0,,) returned 0
    ddi_regs_map_setup(,1,,,0x100,,) returned 0
    ddi_regs_map_setup(,2,,,0x1000,,) returned -7
    ddi_regs_map_setup(,3,,,0x100,,) returned 0
    ddi_regs_map_setup(,4,,,0x1000,,) returned -7
    ddi_regs_map_setup(,5,,,0x0,,) returned -6
    My question is, if I want to map more than 0x200 sized device memory, how do i do it? Because rnumber 1 & 3 will allow me to map registers of sizes 0x100 each only!
    or am i understanding this wrong?
    any help appreciated!
    Thanks!

    Hi,
    to be a bit more specific:
    you shouldnt have to do any direct mapping of addresses yourself. both the register space, AND the io space of a PCI card should be accessible through
    ddi_regs_map_setup.
    If you download my PCIbase.tar from
    http://www.bolthole.com/solaris/#drivers
    it will give you a helper script called printregs,
    which will show you which register set gets mapped to which address space.
    It's always the same,for the same card. So if printregs says that the iospace memory you care about is in register set 3, then you can pretty much always use
    ddi_regs_map_setup(dip, 3, ....) to map in that space.

  • Report Generation using Citadel & Excel in VB

    I want to generate report using citadel sql server, i,am using excel for report viewing. I have written a Visual Basic code for fetching data from srq to excel. The problem is when i fetch all the fields from sql it generate report, but when i gave a single variable name like Mycomputername/process/pot1@value it give a error column:Mycomputer not exsist.
    Given below is the code wriiten to get the value.Please suggest ASAP
    '****** GET HEPTANE RECORDS ******
    Sub GetHEPTANERecords(ByVal rNumber As Integer, ByVal dDate As Date, ByVal sTime As Date, ByVal eTime As Date)
        Dim ReadHEPTANE As ADODB.Recordset
        Set ReadHEPTANE = GetConnection.Execute("SELECT TRANSTECH34/SRS/LVL_GALL_TK1  FROM IntData WHERE [LOCALTIME] BETWEEN '" &
    sTime & "' AND '" & eTime & "'")
    Thanks & regards
    Mantosh

    Mantosh,
    Have you seen this developer zone article which details accessing Citadel Data using COM+ and ADO?
    http://zone.ni.com/devzone/conceptd.nsf/webmain/725A6C3843F13C8786256EA600633724#6
    Also, this KB article provides more detail on how to access Citadel data using SQL commands and I think will help answer your question:
    http://digital.ni.com/public.nsf/websearch/C7D32F9A59D4637086256A7200692F30?OpenDocument
    --Paul Mandeltort
    Automotive and Industrial Communications Product Marketing

  • Questions on list

    I have a java bean
    and i got data from my db and when to add into my bean so I have the code like
    while(rs.next()){   
                           hallA myselect= new hallA();
                           myselect.setName(rs.getString("name"));
                           myselect.setGender(rs.getString("gender"));
                           myselect.setHall(rs.getString("hall"));   
                           myselect.setRnumber(rs.getString("rNumber"));               
                           myselect.setCurricumlum(rs.getString("curricumlum"));
                           myselect.setYear(rs.getString("year"));
                           myselect.setMobilNo(rs.getString("mobilNo"));
                           myselect.setEmail(rs.getString("email"));
                           myselect.setStatue(rs.getString("statue"));
                           myselect.setFinalYear(rs.getString("finalYear"));
                           myselect.setPeriodOne(rs.getString("periodOne"));
                           myselect.setPeriodTwo(rs.getString("periodTwo"));               
                          myselect.setUniversityN(rs.getString("universityN"));
                           rowCount++;                      
                           *allFound.add(myselect);*
                      }// end while *1 what type I should give to my list List allFound = new ArrayList();*
    2. if I want to pass the object allFound to display in jsp what can I do?

    thank you , got first one
    is the other way to display the value in allFound in 25 row per page?

  • Problem in BAPI_GOODSMVT_CREATE

    Hi,
      I am using BAPI_GOODSMVT_CREATE  for creating GR against production order ,
    GOODSMVT_CODE  : 02
    MVT_IND  : F
    and other required data i have pass properly  like orde rnumber, material, quantity, UOM, serial number  also test RUN is space,  but after execute of RFC system issue the document number, but actual document not posted in the system, when i check that document number it is not present in the system means it is just doing as test run  but test rub field is blank.
    regards,
    zafar

    Hi,
      Problem solve, after the BAPI_GOODSMVT_CREATE  the other BAPI,   BAPI_TRANSACTION_COMMIT is required to be call i was testing in se37 with  BAPI_GOODSMVT_CREATE  only after create new bapi by adding of commit bapi  problem solve.
    regards,
    zafar

  • How to solve the "Method invocation failed" error in script?

    Hello,
    I'm trying to modify the script that enumerates all the txt (csv) files on folder and deletes empty columns, but with no luck. The script is working when I execute it on single csv file. But when I put script on loop, it generates errors:
    Method invocation failed because [System.Management.Automation.PSCustomObject] does not contain a method named 'split'.
    At C:\scripts\populate.ps1:25 char:1
    + $b = $line.split(",")
    + ~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidOperation: (split:String) [], RuntimeException
        + FullyQualifiedErrorId : MethodNotFound
    The script looks the following:
    $files = Get-ChildItem C:\scripts\Results\csv\* -include *.txt
    #Process files by performing a search and replace
    foreach ($infile in $files)
    $infilen = 'C:\scripts\Results\csv\'+[io.path]::GetFileName($infile)
    $infile = import-csv $infilen
    ##remove blank coloumns##
    $cStore = @() # array to store used column numbers
    $rNumber = 0
    foreach ($line in $infile)
    if ($rNumber -eq 0)
    {# ignore header
    else
    $b = $line.split(",")
    $fieldNum = 0
    foreach ($field in $b)
    if ($field -ne '')
    if ($cStore -notcontains $fieldNum) {$cStore += $fieldNum}
    $fieldNum += 1
    $rNumber +=1
    # array $cStore now contains column numbers with values
    $cStore = $cStore | sort
    foreach ($line in $infile)
    $nLine = ""
    $c = $line.split(",")
    foreach ($ar in $cStore)
    $nLine += $c[$ar]+","
    # remove trailing ,
    $nLine = $nLine.Substring(0, $nLine.Length-1)
    $fnFriendly = [io.path]::GetFileNameWithoutExtension($infile)
    $result=$fnFriendly+'cl.txt'
    Write-Output $nLine >> $result
    Also I have found the explanation on this error on this
    link but it seems this is not the case.  Can you help to solve this?
    Thanks!

    You are importing a CSV file which implies that you are creating an object (pscustomobject) and each item in that object is represented by $line. The issue is that this $line has multiple properties (for each column of the CSV) that you need to decide
    on which one to split:
    $c = $line.propertyname.split(",")
    I'm not sure, but it seems that if you are trying to split by a comma, then maybe you are assuming that you did something similar to a
    get-content on the file in which the original approach that you have done would work.
    Boe Prox
    Blog |
    Twitter
    PoshWSUS |
    PoshPAIG | PoshChat |
    PoshEventUI
    PowerShell Deep Dives Book

  • Help in compiling/linking a DEVICE DRIVER in SOLARIS10 x86

    hello!
    PROBLEM:
    ++++++++++++++++++++++++++++++++++
    i need assistance in compiling/linking a video capture
    driver (bt848x) (http://bt848x.sourceforge.net/) for
    solaris 10 x86.
    the driver uses the /usr/lib/libc.a (specifically the _xtoll.o)
    which, if im not mistaken, is not available in solaris 10
    anymore. so how am i going to compile it?
    BACKGROUND:
    ++++++++++++++++++++++++++++++++++
    the original compile/link code in the makefile is:
    /usr/ccs/bin/ld -o bt848x -r bt848-cards.o bt848-driver.o
    bt848-kern.o i2c.o tuner.o sound-tda9875.o
    sound-msp3400.o _xtoll.o
    i modified it to:
    /usr/ccs/bin/ld -o bt848x bt848-cards.o bt848-driver.o
    bt848-kern.o i2c.o tuner.o sound-tda9875.o
    sound-msp3400.o -L/usr/lib -lc
    (NOTE: i removed the -r and _xtoll.o; and added
    -L/usr/lib -lc)
    the output was:
    Undefined ____________ first referenced
    symbol ______________ in file
    mod_install bt848-kern.o
    delay bt848-cards.o
    ddi_get_instance bt848-kern.o
    nodev bt848-kern.o
    ddi_create_minor_node bt848-kern.o
    ddi_regs_map_free bt848-kern.o
    pci_config_getw bt848-driver.o
    pci_config_getb bt848-driver.o
    ddi_soft_state_zalloc bt848-kern.o
    ddi_dma_unbind_handle bt848-kern.o
    kmem_alloc i2c.o
    cv_broadcast bt848-driver.o
    ddi_remove_intr bt848-kern.o
    ddi_get_soft_state bt848-kern.o
    mod_driverops bt848-kern.o
    ddi_get_lbolt bt848-cards.o
    mutex_tryenter bt848-kern.o
    ddi_get_iblock_cookie bt848-kern.o
    nochpoll bt848-kern.o
    ddi_copyin bt848-kern.o
    mod_info bt848-kern.o
    ddi_remove_minor_node bt848-kern.o
    nulldev bt848-kern.o
    ddi_dma_sync bt848-driver.o
    ddi_dma_addr_bind_handle bt848-kern.o
    mod_remove bt848-kern.o
    ddi_prop_lookup_int_array bt848-cards.o
    _pagesize                           bt848-driver.o
    ddi_prop_op bt848-kern.o
    ddi_dma_free_handle bt848-kern.o
    ddi_set_driver_private bt848-kern.o
    cv_wait_sig bt848-kern.o
    ddi_intr_hilevel bt848-kern.o
    ddi_regs_map_setup bt848-kern.o
    pci_config_teardown bt848-driver.o
    ddi_dma_mem_alloc bt848-kern.o
    ddi_copyout bt848-kern.o
    cmn_err bt848-cards.o
    ddi_dma_alloc_handle bt848-kern.o
    ddi_prop_exists bt848-cards.o
    cv_init bt848-kern.o
    pci_config_setup bt848-driver.o
    cv_destroy bt848-kern.o
    timeout sound-msp3400.o
    untimeout sound-msp3400.o
    devmap_umem_setup bt848-kern.o
    ddi_prop_get_int bt848-kern.o
    uiomove bt848-kern.o
    kmem_free i2c.o
    ddi_add_intr bt848-kern.o
    ddi_report_dev bt848-kern.o
    getminor bt848-kern.o
    mutex_exit bt848-driver.o
    ddi_prop_free bt848-cards.o
    ddi_soft_state_fini bt848-kern.o
    ddi_soft_state_free bt848-kern.o
    ddi_soft_state_init bt848-kern.o
    mutex_enter bt848-driver.o
    ddi_mem_putl bt848-cards.o
    ddi_mem_getl bt848-cards.o
    drv_usecwait bt848-cards.o
    drv_usectohz bt848-cards.o
    ddi_dma_mem_free bt848-kern.o
    ld: fatal: Symbol referencing errors. No output written to bt848x
    QUESTIONS:
    ++++++++++++++++++++++++++++++++++
    1.) What other libraries do i need to include so that
    there would no more "symbol referencing errors" ???
    2.) Is my linking code correct?
    /usr/ccs/bin/ld -o bt848x bt848-cards.o bt848-driver.o
    bt848-kern.o i2c.o tuner.o sound-tda9875.o
    sound-msp3400.o -L/usr/lib -lc
    i mean, is it ok to build a driver with dynamic libraries?
    or the device driver should always be statically linked?
    COMPUTER SPECS:
    ++++++++++++++++++++++++++++++++++
    Solaris 10 (6/06 release)
    SunOS 5.10 Generic_118844-26 i86pc i386 i86pc
    Pentium 4 - 1.4GHz
    1GB RDRAM
    32 BIT
    Video Capture Card: PixelView PV-BT878P+FM.RC (rev.9F)
    thanks!!!
    -kllc

    i think i already found the answers to my questions
    (i partially read SUN docs WRITING DEVICE DRIVER in
    http://docs.sun.com/app/docs/doc/816-4854 specifically
    the BUILDING A DEVICE DRIVER) =)
    i used:
    /usr/ccs/bin/ld -o bt848x -dy -r bt848-cards.o bt848-driver.o
    bt848-kern.o i2c.o tuner.o sound-tda9875.o sound-msp3400.o
    -L/usr/lib -lc
    (NOTE: i used the flags -dy -r -L/usr/lib -lc)
    so far, the TV-TUNER is working hehehehe!!
    any comments/suggestions/tips from other people are still welcome!
    thanks!!
    -kllc

  • FRM-40831 : Truncation occured: value too long for filed MAST_EMP_NAME

    Hi
    I'm using Forms 5 and getting following error.
    FRM-40831 : Truncation occured: value too long for filed MAST_EMP_NAME.
    When i checked in the column Mast_emp_name, all the values are with in the limit.
    Table contains some 9 lacs record.
    Please help me. this is very urgent

    check the maximum length - property of all those 5 columns in your form. They have to be as long as in the database. Except number. They have to be 1 char longer than in the db.
    Forms-Online-Help says:
    This property can potentially limit the amount of data that an item is allowed to contain internally (in the Forms server) when it's in native format. It can also potentially limit the number of character (or bytes) displayed or entered by the end user. That is, it can specify a data limit and/or a user interface (UI) limit. The exact effect depends upon several factors, including the item's Data type, Data Length Semantics, and Format Mask properties. For a character item (datatypes CHAR, ALPHA, LONG), the Maximum Length property specifies a data limit. The property value specifies either the maximum number of bytes or else the maximum number of characters, depending upon the value of the Data Length Semantics property. Within a group of character mirror items, the Maximum Length property is always taken from the master mirror item. A compiler (generator) warning is issued if a non-zero non-default value is specified in a subordinate mirror item. If a character item has no format mask (the Format Mask property is null), then the Maximum Length property (taken from the master mirror item) also specifies a UI limit. When the Forms server is using the UTF8 character set , this UI limit has the same semantics (byte versus character) as the data limit. When the Forms server is using a multi-byte character set other than UTF8, and the Data Length Semantics property specifies byte semantics, Forms cannot prevent the end user from typing in too many bytes. Instead, it uses character semantics for the UI limit. In such a case, the end user is allowed to type in too many bytes. When the end user attempts to navigate out of the current validation unit, one of two things will happen. If the application property FLAG_USER_VALUE_TOO_LONG is set, an error will be flagged and the excess characters on the right will be selected. If this application property is not set, the excess characters will be quietly truncated, and the navigation will succeed. If a character item has a format mask, then the item's UI limit is derived from the format mask. This limit is always a character limit. For a number item (datatypes NUMBER, INT, MONEY, RNUMBER, RINT, RMONEY), the Maximum Length property specifies a user interface limit. This limit is always a character limit. There is no data limit. The data item can always internally hold up to 23 bytes (which is the maximum size of an Oracle number in native format), regardless of the value of the Maximum Length property. For a date or time item (datatypes DATETIME, DATE, TIME, JDATE, EDATE), the Maximum Length property specified in Forms Builder has almost no effect (See the Query Length property for a discussion of the only effect). As with "number" items, there is no data limit. For DATE and DATETIME items, the internal value is 7 bytes long, and for TIME, JDATE and EDATE items, the internal value is 4 bytes long . The user interface limit is derived from the format mask. This limit is always a character limit which is what is returned by GET_ITEM_PROPERTY(item, MAX_LENGTH).

  • Leading Zeroes are lost when convert from string to int

    What I'm trying to do is simple yet the solution has seemed difficult to find.
    I have a system that requires 4 digit numbers as "requisitionNo". The system uses JSPs and accepts the 4 digit number that the user inputs (fyi - duplicate handling is already managed). The input number (rNumber) is of STRING type and in the action (using struts) is converted to an int:
    int requisitionNo = Integer.parseInt(rNumber);At that very line the issue is that when the user inputs a number with leading zeros such as: "0001" the 3 leading zeros are chopped off in the INT conversion. The application validation kicks in and says: "A 4 digit number is required" which is by design. The work around has been that the user has been putting in number that start with 9's or something like that, but this isn't how the system was intended to be used.
    How do I keep the leading zeroes from being lost instead of saving a number "1" to the database how do I keep it saving "0001" to the database? Would I just change everything to STRING on down to the database? or is there another number type that I can be using that will not chop off the leading zeroes? Please provide short code references or examples to be more helpful.

    Yeah, I have to agree here that leading zeroes make no sense. I figured that out when I started to look into this problem. The only requirement that exists is that the user wants it to be a 4 digit number due to some other requirement they have themselves.
    So what I'm gathering from what I've read in the responses thus far is that I should change the validation a bit to look at the STRING for the 4 required digits (which are really 4 characters; maybe I should add CLIENT side numeric validation; currently its doing server side numeric/integer validation; or maybe change up the server side validation instead???) and if they are ALL GOOD then let the application save the int type as it wants to. IE: Let it save "0001" as just "1" and when I come back to DISPLAY this saved number to the user I should append the string of "000" in front of the 1 for display purposes only? Am I understanding everyone correctly?

Maybe you are looking for