Use cast('12345' as tab.col%type) as a substr - PLS-00220

Hello,
I like to make sure that my constructed string fits into my variable, in a flexible way.
The variable is like
declare  t_comment tab.col%type; -- tab.col%type = varchar2(4)
and in the PLSQL I would like to do concat a string and make sure it fits in my variable, just cut the right end if it is too long. I want it to be dynamic, so NOT
t_comment := substr('1234567', 1, 4)
CAST () works like a substring operator if casting to a smaller data type, but also leads to hardcoding.
t_comment := cast ('1234567' as varchar2(4))
But I want
t_comment := cast ('1234567' as tab.col%type)
But that gives me a
PLS-00220: simple name required in this context.
And when I define a subtype
subtype comment_type is tab.col%type;
t_comment := cast ('1234567' as comment_type)
gives me a 
PLS-00382: expression is of wrong type
The documentation is also clear:
CAST converts one built-in datatype or collection-typed value into another built-in datatype or collection-typed value.
But it would be so nice to prevent hardcoding, to the varchar2(4) datatype in this case.
Any suggestions on how to make this flexible?

Hello,
you can read the column length from the data dictionary and then use it in your SUBSTR instead of the hard coded value:
SELECT data_length
INTO v_length
FROM user_tab_cols
WHERE table_name = 'TAB'
AND column_name = 'COL';
t_comment := SUBSTR('1234567', 1, v_length);
Not as simple as a %TYPE, but just as flexible.
Regards
Marcus

Similar Messages

  • When using more than one tab, once I have opened a pdf using firefox my laptop will not allow me to type or click in another tab unless I drag the pdf into it's own window?

    when using more than one tab, once I have opened a .pdf using firefox my laptop will not allow me to type or click in another tab unless I drag the .pdf into it's own window? not a major problem just irritating.

    I found the cause but no solution, it's actually a plugin that does that: divx plus weblpayer (it gets installed when you install DivX on your system), if you disable it and restart firefox it all works again. But I want that plugin... so DivX need to fix this, unless it is a Firefox bug in its own core... anyway these two together creates the problem.
    (I'm running Firefox 9.x on OSX Lion)
    I also wish firefox tab tear out tab worked more like chrome's tab tear out, much friendlier...

  • What type of form need to be using to get Display tab on the Section Properties of my Optional Section?

    What type of form need to be  using to get Display tab on the Section Properties of my Optional Section?
    CRISTINA&amp MICROSOFT Forum

    Hi perezco,
    Are you using SharePoint?
    Please provide more information and screenshots about this issue.
    Thanks,
    Wendy
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Wendy Li
    TechNet Community Support

  • Unexpected "numeric or value error" when using CAST COLLECT

    I am having trouble with string aggregation using CAST / COLLECT and the to_string function described on various sites around the net including AskTom and http://www.oracle-developer.net/display.php?id=306.
    I am getting "numeric or value error: character string buffer too small" but cannot see which limit I am exceeding.
    I have put together a simple test case to highlight this problem which I have pasted below.
    The error does not seem to be coming from the to_string function itself (else I expect we would see "TO_STRING raised an exception" in the returned error message).
    Any thoughts much appreciated,
    Thanks, Andy
    SQL*Plus: Release 10.1.0.4.2 - Production on Tue Jun 15 09:56:53 2010
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL> CREATE TYPE table_of_varchar2 AS TABLE OF VARCHAR2(32000);
      2  /
    Type created.
    SQL> CREATE OR REPLACE FUNCTION to_string (
      2              nt_in IN   table_of_varchar2
      3      ,       delimiter_in    IN VARCHAR2 DEFAULT ',')
      4      RETURN VARCHAR2
      5      IS
      6          l_idx   PLS_INTEGER;
      7          l_str   VARCHAR2(32767);
      8          l_dlm   VARCHAR2(10);
      9
    10      BEGIN
    11
    12          l_idx := nt_in.FIRST;
    13          WHILE l_idx IS NOT NULL LOOP
    14              l_str := l_str || l_dlm || nt_in(l_idx);
    15              l_dlm := delimiter_in;
    16              l_idx := nt_in.NEXT(l_idx);
    17          END LOOP;
    18
    19          RETURN l_str;
    20      EXCEPTION
    21          WHEN OTHERS THEN
    22              raise_application_error(-20000
    23                                  ,   'TO_STRING raised an exception. '||
    24                                      'The reported error was: '||sqlerrm);
    25     END to_string;
    26  /
    Function created.
    SQL> DECLARE
      2      l_longstring varchar2(32000);
      3  BEGIN
      4      SELECT  to_string(CAST( COLLECT( substr(object_name,1,1) ) AS table_of_varchar2 ) )
      5      INTO    l_longstring
      6      FROM    all_objects
      7      WHERE   rownum < 2001;
      8
      9  EXCEPTION
    10      WHEN OTHERS THEN
    11          raise_application_error(-20001
    12                ,   'The anonymous block raised an exception: '||
    13                    sqlerrm||'. '||DBMS_UTILITY.format_error_backtrace);
    14  END;
    15  /
    PL/SQL procedure successfully completed.
    SQL> DECLARE
      2      l_longstring varchar2(32000);
      3  BEGIN
      4      SELECT  to_string(CAST( COLLECT( substr(object_name,1,1) ) AS table_of_varchar2 ) )
      5      INTO    l_longstring
      6      FROM    all_objects
      7      WHERE   rownum < 2002;
      8
      9  EXCEPTION
    10      WHEN OTHERS THEN
    11          raise_application_error(-20001
    12                ,   'The anonymous block raised an exception: '||
    13                    sqlerrm||'. '||DBMS_UTILITY.format_error_backtrace);
    14  END;
    15  /
    DECLARE
    ERROR at line 1:
    ORA-20001: The anonymous block raised an exception: ORA-06502: PL/SQL: numeric
    or value error: character string buffer too small
    ORA-06512: at line 1. ORA-06512: at line 1
    ORA-06512: at line 4
    ORA-06512: at line 11

    Aha, of course.
    I was aware of the 4000 character SQL VARCHAR2 limit but didn't think it would apply here since we are calling a PLSQL function and trying to assign the value it returns into a PLSQL varchar2(32000) variable. BUT... we are of course doing this via a SELECT statement and hence via SQL. Therefore the SQL 4000 limit applies.
    With this in mind, I changed the RETURN type of the to_string function to be CLOB. This solved the problem.
    Thank you,
    Andy

  • Export image to tif using cast image

    I have written a vi that currently acquires data from a camera. The
    image steams in continuously in 16bit. I have a case structure that
    snaps the image and exports a single frame of the streaming image to a
    tif format using "IMAQ Write TIFF file". The tif file that results
    however is extremely low contrast. I am guessing that I need a
    conversion before exporting to tif, but I am unsure how to implement
    that. I am considering using "IMAQ Cast Image". Is there a better
    way? I don't necessarily need to use tif, so if there is another
    better method, I would be open to suggestions. If I do need to use
    cast image does anyone have recommendations for "# shifts" or "image
    type" that would work well for tiff?

    Hi vwkafer
    look at this vi, which might exactly be what you want:
    http://zone.ni.com/devzone/cda/epd/p/id/1455
    it takes a 2D array (transform first your imaq into 2D array), then you have a color master table that you can choose or update (create your own), to set variable contrast ratio and flas color imaging.
    after that, you can just transfer this data into a jpg with the created color table.
    Does it help?
    ... And here's where I keep assorted lengths of wires...

  • Error when using cast and convert to datetime

    I run a stored procedure
    usp_ABC
    as
    begin
    delete from #temp1 
    where #temp1.ResID not in 
    ( select Col1 
    from TableA 
    where ( @I_vId = -1 or Doc_Field_ID = @I_vId)
    and ColA1 = 2  and FieldValue !=''
    and cast ( FieldValue as DATETIME ) = cast (@strvalue_index as DATETIME)
    and ResID = #temp1.ResID
    and TypesId = @I_vTypeId
    end
    But return message "Conversion failed when converting date and/or time from character string.'
    Format of Column FieldValue is nvarchar(400)
    @strvalue_index = '05/05/2013'
    So I see in article http://technet.microsoft.com/en-us/library/ms174450.aspx MS say about MS SQL Server and SQL Server Compact.
    Then I re-write proc:
    delete from #temp1 
    where #temp1.ResID not in 
    ( select Col1 
    from TableA 
    where ( @I_vId = -1 or Doc_Field_ID = @I_vId)
    and ColA1 = 2  and FieldValue !=''
    and cast ( cast(FieldValue as nvarchar(200)) as DATETIME ) = cast (@strvalue_index as DATETIME)
    and ResID = #temp1.ResID
    and TypesId = @I_vTypeId
    so stored run success.
    I don't understand how?
    When i run only statement in MS SQL Studio Management, the statement run success.
    Thanks all,

    No bad dates in my data.
    Apparently you have. Or, as Johnny Bell pointed out, there is a clash with date formats. Did you try the query with isdate()?
    For SQL 2008, you need
      CASE WHEN isdate(FieldValue) = 1
           THEN CAST (FieldValue AS datetime)
      END =
      CASE WHEN isdate(@strvalue_index) = 1
           THEN CAST (@strvalue_index AS datetime)
      END
    Erland Sommarskog, SQL Server MVP, [email protected]
    I think date formats is OK. So when I re-write stored:
    and cast ( FieldValue as DATETIME ) = cast (@strvalue_index as DATETIME)
    =>
    and cast ( cast(FieldValue as varchar(200)) as DATETIME ) = cast (@strvalue_index as DATETIME)
    the stored procedure will run success. I see in http://technet.microsoft.com/en-us/library/ms174450.aspx MS
    has an IMPORTANT:
     Important
    When using CAST or CONVERT for nchar, nvarchar, binary, and varbinary,
    SQL Server truncates values to maximum of 30 characters. SQL Server Compact allows 4000 for nchar and nvarchar, and 8000 for binary and varbinary. Due
    to this, results generated by querying SQL Server and SQL Server Compact are different. In cases where the size of the data types is specified such as nchar(200), nvarchar(200), binary(400), varbinary(400), the results are consistent across SQL Server and
    SQL Server Compact.
    I can't explain it in this case

  • I can not use the tab key to move to the next field or use the shift and tab to move to the prior field in forms.

    After updating to 7.0.1 I can not always use the tab key to move to the next field or use the shift and tab to move to the prior field in forms. This always worked in previous versions and it's much needed for my type of work. Does anyone know of a setting to activate this? If not can the Firefox developers work on this issue (please). I love Firefox but desperately need this feature to work correctly. Thanks!

    I tried in safe mode and the tab key worked just fine. I'm not sure about all web forms I've only recently updated to 7.0. The wen form I was using was for appraisal purposes and it has multiple data fields to fill in and also drop down menus to select from. Might I always have to use Firefox in safe mode to be able to utilize the tab between field feature? Thanks for your help!

  • DEFAULT Constraint using CAST is changed to CONVERT

    I am wondering if anyone knows why it happens that if you create a DEFAULT constraint with CAST in the DDL, the next time you script the DEFAULT constraint, the CAST is changed to CONVERT? I know that is really doesn't matter, except for when trying to do
    schema comparisons.
    Here is a trivial example.
    ALTER TABLE [X] ADD CONSTRAINT [DF_Y] DEFAULT (CAST '12345' AS int) FOR [z];goEXEC sp_helptext DF_Y; --The result is--(CONVERT([int],'12345',0))
    I realize that internally, calls to CAST are calls to CONVERT, but I am mystified why the DDL would be changed to use CONVERT.

    Constraints and computed-column expressions are not stored as is, but they are stored in a normalised form.
    I guess that CAST is changed to CONVERT, since CONVERT is the more versatile of them and accept an extra argument to afect the conversion.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • ORA-00902: invalid datatype comile error while using CAST function

    Hi everyone,
    I'm getting ORA-00902: invalid datatype compilation error while using CAST function.
    open ref_cursor_list for select empName from TABLE(CAST(part_t AS partnumberlist));
    The partnumberlist and ref_cursor_list is declared in the Package spec as given below.
    TYPE ref_cursor_list IS REF CURSOR;
    TYPE partnumberlist IS TABLE OF emp.empName%TYPE;
    The error points the partnumberlist as invalid datatype in TOAD because of this i'm unable to compile the package.
    Any suggestion
    Thanks and regards
    Sathish Gopal

    Here is my code for
    package Spec
    CREATE OR REPLACE PACKAGE "HISTORICAL_COMMENTZ" AS
    TYPE prior_part_data_record IS RECORD (
    prior_part_row_id PGM_RPLCMNT_PART.PR_PART_ROW_S_ID%TYPE,
    prior_pgm_chng_s_id PGM_RPLCMNT_PART.PR_PGM_CHNG_S_ID%TYPE
    TYPE parts_list IS TABLE OF prior_part_data_record;
    --TYPE parts_list IS TABLE OF NUMBER;
    TYPE partnumberlist IS TABLE OF PGM_RPLCMNT_PART.PR_PART_ROW_S_ID%TYPE;
    TYPE partnumber_cursor IS REF CURSOR;
    TYPE comment_record IS RECORD (
    pgm_s_id                     PGM_PART_CMNT.PGM_S_ID%TYPE,
    part_row_s_id                PGM_PART_CMNT.PART_ROW_S_ID%TYPE,
    pgm_chng_s_id                PGM_PART_CMNT.PGM_CHNG_S_ID%TYPE,
    cmnt_txt                     PGM_PART_CMNT.CMNT_TXT%TYPE,
    cmnt_dt                     PGM_PART_CMNT.CMNT_DT%TYPE,
    updt_rsrc_id                PGM_PART_CMNT.UPDT_RSRC_ID%TYPE
    TYPE comment_list IS TABLE OF comment_record;
    global_pgm_s_id INTEGER := 0;
    global_part_row_s_id INTEGER := 0;
    err_num NUMBER := 999999;
    err_msg VARCHAR2 (250);
    PROCEDURE getComments (
    pgm_s_id IN NUMBER,
    part_row_s_id IN NUMBER,
    partnumber_cursorlist out partnumber_cursor);
    END;
    Package Body
    CREATE OR REPLACE PACKAGE BODY HISTORICAL_COMMENTZ
    AS
    FUNCTION getPriorPart
    (param_prior_pgm_chng_s_id IN PGM_RPLCMNT_PART.PR_PGM_CHNG_S_ID%TYPE,
    return_prior_part_data_record IN OUT prior_part_data_record
    RETURN INTEGER
    IS
    retVal INTEGER;
    prior_part_row_id INTEGER;
    prior_pgm_chng_s_id INTEGER;
    local_prior_part_data_record prior_part_data_record;
    BEGIN
    SELECT PR_PART_ROW_S_ID AS prior_part_row_id, PR_PGM_CHNG_S_ID AS prior_pgm_chng_s_id
    INTO local_prior_part_data_record
    --SELECT PR_PART_ROW_S_ID INTO retVal
    FROM PGM_RPLCMNT_PART
    WHERE PGM_S_ID = global_pgm_s_id AND CUR_PGM_CHNG_S_ID = param_prior_pgm_chng_s_id;
    return_prior_part_data_record := local_prior_part_data_record;
    retVal := 0;
    RETURN retVal;
    EXCEPTION
    WHEN NO_DATA_FOUND
    THEN
    err_num := SQLCODE;
    err_msg := 'SQL Error ' || SUBSTR (SQLERRM, 1, 250);
    DBMS_OUTPUT.put_line ('SQLERROR = ' || err_msg);
    retVal := -1;
    RETURN retVal;
    WHEN OTHERS
    THEN
    err_num := SQLCODE;
    err_msg := 'SQL Error ' || SUBSTR (SQLERRM, 1, 250);
    DBMS_OUTPUT.put_line ('SQLERROR = ' || err_msg);
    retVal := -1;
    RETURN retVal;
    END getPriorPart;
    FUNCTION getComment (found_parts_list IN parts_list, comments OUT comment_list)
    RETURN INTEGER
    IS
    CURSOR init_cursor
    IS
    SELECT PGM_S_ID,PART_ROW_S_ID,PGM_CHNG_S_ID,CMNT_TXT,CMNT_DT,UPDT_RSRC_ID
    FROM PGM_PART_CMNT WHERE 1 = 2;
    retVal INTEGER;
    indexNum PLS_INTEGER;
    local_part_record prior_part_data_record;
    local_comment_record comment_record;
    local_part_row_s_id NUMBER;
    i PLS_INTEGER;
    BEGIN
    OPEN init_cursor;
    FETCH init_cursor
    BULK COLLECT INTO comments;
    i := 0;
    indexNum := found_parts_list.FIRST;
    WHILE indexNum IS NOT NULL
    LOOP
    local_part_record := found_parts_list(indexnum);
    local_part_row_s_id := local_part_record.prior_part_row_id;
    SELECT PGM_S_ID,PART_ROW_S_ID,PGM_CHNG_S_ID,CMNT_TXT,CMNT_DT,UPDT_RSRC_ID
    INTO local_comment_record FROM PGM_PART_CMNT
    WHERE PGM_S_ID = global_pgm_s_id
    AND PART_ROW_S_ID = local_part_row_s_id;
    comments(i) := local_comment_record;
    i := i + 1;
    END LOOP;
    RETURN retval;
    EXCEPTION
    WHEN NO_DATA_FOUND
    THEN
    err_num := SQLCODE;
    err_msg := 'SQL Error ' || SUBSTR (SQLERRM, 1, 250);
    DBMS_OUTPUT.put_line ('SQLERROR = ' || err_msg);
    RETURN retval;
    WHEN OTHERS
    THEN
    err_num := SQLCODE;
    err_msg := 'SQL Error ' || SUBSTR (SQLERRM, 1, 250);
    DBMS_OUTPUT.put_line ('SQLERROR = ' || err_msg);
    RETURN retval;
    END getComment;
    PROCEDURE getComments
    pgm_s_id IN NUMBER,
    part_row_s_id IN NUMBER,
    partnumber_cursorlist OUT partnumber_cursor)
    IS
    comment_recordlist comment_record;
    retPartnumberlist partnumberlist;
    found_parts_list parts_list;
    local_part_record prior_part_data_record;
    is_more_parts BOOLEAN;
    driver_chng_s_id NUMBER;
    num_parts NUMBER;
    retVal NUMBER;
    comments comment_list;
    returnPartnumberlist partnumberlist;
    iloopCounter PLS_INTEGER;
    inx1 PLS_INTEGER;
    part_t partnumberlist :=partnumberlist(100,200,300);
    CURSOR part_list_init_cursor
    IS
    SELECT PR_PART_ROW_S_ID,PR_PGM_CHNG_S_ID FROM PGM_RPLCMNT_PART WHERE 1 = 2;
    CURSOR inIt_cursor
    IS
    SELECT 0 FROM DUAL WHERE 1 = 2;
    BEGIN
    DBMS_OUTPUT.ENABLE (5000000);
    global_pgm_s_id := pgm_s_id;
    global_part_row_s_id := part_row_s_id;
    SELECT PART_ROW_S_ID AS prior_part_row_id, PR_PGM_CHNG_S_ID AS prior_pgm_chng_s_id
    INTO local_part_record
    FROM PGM_RPLCMNT_PART
    WHERE PGM_S_ID = global_pgm_s_id AND PART_ROW_S_ID = global_part_row_s_id AND
    CUR_PGM_CHNG_S_ID IN (SELECT MAX(CUR_PGM_CHNG_S_ID) FROM PGM_RPLCMNT_PART WHERE
    PGM_S_ID = global_pgm_s_id AND PART_ROW_S_ID = global_part_row_s_id
    GROUP BY PART_ROW_S_ID);
    OPEN part_list_init_cursor;
    FETCH part_list_init_cursor
    BULK COLLECT INTO found_parts_list;
    -- Add the existing part to the found list
    found_parts_list.EXTEND;
    found_parts_list(1) := local_part_record;
    driver_chng_s_id := local_part_record.prior_pgm_chng_s_id;
    num_parts := 1;
    is_more_parts := TRUE;
    WHILE (is_more_parts) LOOP
    retVal := getPriorPart(driver_chng_s_id,local_part_record);
    IF (retVal != -1) THEN
    found_parts_list.EXTEND;
    num_parts := num_parts + 1;
    found_parts_list(num_parts) := local_part_record;
    driver_chng_s_id := local_part_record.prior_pgm_chng_s_id;
    ELSE
    is_more_parts := FALSE;
    END IF;
    END LOOP;
    --num_parts := getComment(found_parts_list,comments);
    OPEN init_cursor;
    FETCH init_cursor
    BULK COLLECT INTO returnPartnumberlist;
    num_parts := found_parts_list.COUNT;
    FOR iloopCounter IN 1 .. num_parts
    LOOP
    returnPartnumberlist.EXTEND;
    returnPartnumberlist(iloopCounter) := found_parts_list(iloopCounter).prior_part_row_id;
    END LOOP;
    retPartnumberlist := returnPartnumberlist;
    open
    *          partnumber_cursorlist for select PR_PART_ROW_S_ID from TABLE(CAST(retPartnumberlist AS historical_commentz.partnumberlist));*                              
    DBMS_OUTPUT.put_line('Done....!');
    EXCEPTION
    some code..............................
    END getComments;
    END HISTORICAL_COMMENTZ;
    /

  • Is there a limit to no. of summary fields that can be used in a cross tab?

    Hi,
    While creating a cross tab is there a limitation to number of summarized fields that can be used?
    - The cross tab when uses 184 fields as summary fields leads to Crystal report application to crash at the time of export to excel.
    - Tried with two Datasources: XML and excel
    - If we reduce the number of summary fields used to 102 exactly, export works fine in excel.
    - If 2 cross tabs are used each containing 92 summary fields(in order to show 184) export to excel works fine.
    Please let me know if there is any such limitation which leads to CR application to crash when exporting in excel?
    Thanks
    Regards,
    Nidhi

    I suggest you purchase a case and have a dedicated support engineer work with you directly:
    http://www.sdn.sap.com/irj/boc/gettingstarted
    Or
    http://store.businessobjects.com/store/bobjects/Content/pbPage.CSC_map_countyselector/pgm.67024400?resid=jFmmLgoBAlcAAALO-iYAAAAP&rests=1278687224728
    If this is a bug you'll get a refund, if not post your enhancement request in the Idea Place. Or the Rep will suggest a better way to create your report.

  • I used to open many tabs in the same page and i move from one to other by mouse but since3 two days the tabs open in the same page normaly but i can't move from one to other when i clik with mouse on any tab it don't open/ do u have any solve for this?

    i used to open many tabs in the same page and i move from one to other by mouse but since3 two days the tabs open in the same page normaly but i can't move from one to other when i clik with mouse on any tab it don't open/ do u have any solve for this

    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance).
    *Do not click the Reset button on the Safe mode start window or otherwise make changes.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • I am losing my carriage returns when sending emails. How to keep? uses SMTP Email MIME Text Content-Type.vi

    I am losing my carriage returns when sending emails using the Internet email vi's.
    All carriage returns are stripped out and I get one long word wrapped paragraph.
    I want to avoid html.
    Ideally, using the vi's for rich text would be perfect, but a simple text message with carriage returns and line feeds in any font ok. 
    uses SMTP Email MIME Text Content-Type.vi
    i have tried text/plain, text/html, and mixed yada something

    You need to use Line feed constant and then use concatenate function.See the screen shot.
    Naqqash
    Attachments:
    Using Line feed.png ‏15 KB

  • How can I use jbo:InputSelect for a char type filed?

    How can I use <jbo:InputSelect for a char type filed?
    I have two tables. One is room (primary key is room(type is char)), another table is responsibility (foreign ker is room(type is char)). Both tables have same length for room column.
    There is a problem:
    If I use (in the "DataEditComponent.jsp" file)
    <jbo:InputSelect multiple="false" datasource="dsEdit" displaydatasource="roomData" displaydataitem="ROOM" displayvaluedataitem="ROOM" ></jbo:InputSelect>
    to get the room input for responsibility from combobox(Datasource roomData is from room table). In the form the room field cannot bind the data in combobox, alway select the first item. And if I select one item and click the update button.There is an error message:
    Error Message: JBO-27010: Attribute set with value H409 for Room in Responsibility has invalid precision/scale
    I found If I changed the field type from char to varchar2 in database also change the entity objects, it works well. I wonder if there are any diffrence using <jbo:InputSelect tag in char and varchar2 type. How can I use <jbo:InputSelect for a char type filed as i don't want to change my datatype in database at this stage.
    I try this in JDeveloper 9.03, 9.034, 9.04. The result is the same.

    If I were in your shoes, here's how I would do it:
    <%-- Assuming you have dsRoom and dsResponsibility --%>
    <%-- Select is an HTML tag --%>
    <select name="ROOM" size="1">
    <% char roomID =""; // Init your character var
    // Open a rowsetIterator to get the records and add them to the LOV
    <jbo:RowsetIterate datasource="dsResponsibility" changecurrentrow="true" >
    <% roomID = (char)dsResponsibility.getRowSet().getCurrentRow().getAttribute("ROOM"); // Grab the char value
    // add the value to the LOV
    %>
    <option value="<%=roomID%>"><%=roomID%></option>
    </jbo:RowsetIterate>
    </select>
    If you are using this as part of an edit page you may want to utilize the "selected" option of the <option> tag. In one instance I am doing this on an edit page because the use may open an existing record. If I don't account for it, then it will change the DB to contain the first value from the list! You can do a simple check like:
    //Set the current record's char
    char curRecord = (char)rowEdit.getAttribute("ROOM");
    // inside the iterate:
    if (curRecord == roomID) {
    <option value="<%=roomID%>" selected><%=roomID%></option>
    } else {
    <option value="<%=roomID%>" ><%=roomID%></option>
    Hope that helps!

  • I cannot find all my installed apps on the "use cellular data for" tab on the settings menu.

    I have a new iphone 5s and on the first day I've received it, I updated to IOS 8.0.2.
    Today, I've decided to turn my cellular data on and, in order to consume less data, I thought I would disable some of the apps. However, only a few were available/visible on the "use cellular data for" tab. However, when, with the cellular data turned on, I opened a missing app on the phone, it would start to appear on the list (where it wasn't previously). Also, when I go to the app on the settings menu, it would not have shown the option, "use cellular data" before I've opened the app and now it does. Do I need to turn on every single app before I can select my cellular data preferences? I know people with the same phone and their apps appear all, as expected.
    I don't know if this is a problem of my own carrier but I don't think so, because the people I mentioned earlier have the same carrier.
    Any help would be appreciated.
    Thank you.

    Did you try to reset the phone by holding the sleep and home button for about 10sec, until the Appel logo comes back again? You will not lose data by resetting.
    If this does not work, did you try to switch off Cellular Data, restart the phone and switch it back on again?

  • I need to pass data from an Access database to Teststand by using the built in Data step types(open data

    base /open SQL Statement etc) the first time i defined the system everything was fine but when i changed the Database (using M.S.Access) the " open SQL Statement" it would show the tables but not thier columns ,I"m using win98 sec edition / Teststand 1.0.1i need to pass data from an Access database to Teststand by using the built in Data step types(open database /open SQL Statement etc) the first time i defined the system everything was fine but when i changed the Database (using M.S.Access) the " open SQL Statement" it would show the tables but not thier columns ,I"m using win98 sec edition / Teststand 1.0.1
    When I tried the same thing on another cmputer the same thing
    happend
    appreiciate u"r help

    base /open SQL Statement etc) the first time i defined the system everything was fine but when i changed the Database (using M.S.Access) the " open SQL Statement" it would show the tables but not thier columns ,I"m using win98 sec edition / Teststand 1.0.1Hello Kitty -
    Certainly it is unusual that you can still see the tables available in your MS Access database but cannot see the columns? I am assuming you are configuring an Open Statement step and are trying to use the ring-control to select columns from your table?
    Can you tell me more about the changes you made to your file when you 'changed' it with MS Access? What version of Access are you using? What happens if you try and manually type in an 'Open Statement Dialog's SQL string such as...
    "SELECT UUT_RESULT.TEST_SOCKET_INDEX, UUT_RESULT.UUT_STATUS, UUT_RESULT.START_DATE_TIME FROM UUT_RESULT"
    Is it able to find the columns even if it can't display them? I am worried that maybe you are using a version of MS Access that is too new for the version of TestSt
    and you are running. Has anything else changed aside from the file you are editing?
    Regards,
    -Elaine R.
    National Instruments
    http://www.ni.com/ask

Maybe you are looking for

  • New Movies feature in Garageband 11- how to export?

    I work at a school and would like to be able to import editable videos from Discovery Education United Streaming into the new Movies feature in Garageband. The thought is to have them remove the audio and then create their own on top of the video.  S

  • Dump in Production due to CALL_FUNCTION_OPEN_ERROR???

    Hi all, I am getting lot of dumps in Production with following details What happened? Error in ABAP application program. The current ABAP program "SAPLOLEA" had to be terminated because one of the statements could not be executed. This is probably du

  • Target JDK version?

    Hi, I'm trying to get a string out of a database via JDBC. When I compile my code with "1.3.0" as target JDK version in the project properties settings, the java.sql.ResultSetMetaData().getColumnType(int column) method says my string is of type OTHER

  • New video cannot be found after saving

    I wanted to make a 1080p video into a 720p video so I opened it up into quicktime x and went save as and 720p HD, I put it in its own folder on the desktop so I wouldn't lose it but 4 hours later after converting nothing was there. It has taken HDD s

  • [svn:bz-trunk] 9368: exclude test for bug blz-408

    Revision: 9368 Author:   [email protected] Date:     2009-08-18 10:39:47 -0700 (Tue, 18 Aug 2009) Log Message: exclude test for bug blz-408 Ticket Links:     http://bugs.adobe.com/jira/browse/blz-408 Modified Paths:     blazeds/trunk/qa/features/excl