Null and not null columns

Hi,
I want to specify that if an ID is 0 or null to do something... I am not sure if I am writing the code properly since it does not display anything when the coulmn has data(not null)
<%! int ID=1;%>
<% if ((ID ==0) || (request.getParameter("ID") !=null)){ %>
do something
<%} else {%>
do something else
<%%>
if the ID is has a number greater than 0 then I would like to display information. But my code does not get to the else statement?
Thanks!

Remember the functionality of logical OR operator. IF the first statement evaluated is TRUE, the next are not evaluated.

Similar Messages

  • How to select columns in a table by their column id and not the column name

    Hello,
    How do you select columns from a table based on their column_id.
    I have create a view
    but other than Select * , i cant now select one just one column from it
    the view as follow:
    create view count_student as
    select a.acode "acode",aname "Activity Name",count(ae.acode) "Number of student joined"
    from aenrol ae, activity a
    where a.acode= ae.acode
    group by a.acode,aname;

    The issue is that you have decided to use quoted column names. A pretty horrible idea (mostly for the reasons that you are now finding).
    Re-create the view and get rid of the silly double quotes.

  • Showing description and not key when using check tables in Web UI

    Hi,
    I have added an field using EEWB to Opportunity Item, and connected it to check table CRMC_CUSTGRP1. It shows fine, and we can select from the check table using the web ui.
    However it shows the key column and not description column from the table. Is there a way to make the web ui show description instead of the key?
    Regards
    Mattias

    Hi,
    I debugged GET_V_S_STRUCT, and it tries calling 
    ME->VIEW_DESCRIPTOR->GET_FIELD_GEN_VALUEHELP_DL
    ME-VIEW_DESCRIPTOR is an instance of class CL_BSP_DLC_VIEW_DESCRIPTION, which does not contain the method GET_FIELD_GEN_VALUEHELP_DL, and obviously it throws an CX_SY_DYN_CALL_ILLEGAL_METHOD exception, which leaves the value table empty.
    Do you have any idea why, or have I missed something fundamental?
    Regards
    Mattias
    Edited by: Mattias Johansson on Nov 14, 2008 11:05 AM

  • Oracle BPEL - Does not cater for not null columns and use of "default".

    Oracle BPEL - Does not cater for not null columns and use of "default".
    BPEL fails with message:
    ORA-01400: cannot insert NULL into ("EDDB"."SEISMIC_LINES"."COORD_SYSTEM_ID")
    But SQL*PLUS command works:
    INSERT into EDDB.SEISMIC_LINES
    (etc)
    regards
    Allan Ford
    Analyst / Programmer - IT Application Services, IT Services, Shared Business Services
    Santos Ltd
    Level 4, 91 King William Street, Adelaide SA 5000
    Phone: 08 8224 7944 Fax: 08 8218 5320
    Email: [email protected]

    note: BPEL keeps it's own "offline" copy of table and database items. A column that is marked not null in the database can be marked as nullable in this area. (if you kmow that a trigger is going to cater for this ..)
    One workaround is to use a trigger to provide value rather than use the column default ..

  • ORA-01400 - not null column with default value and item with authorization

    I've searched - I would think someone has run into this. APEX 3.0.0.00.20 - I've created a simple form on a table. One of the column is a not null column with a default value. I have a select list on that item, but it has security on it - authorization scheme. So, it checks the user and if that user isn't of the right role, it will not even display that item. However, APEX appears to still send in the column in its sql! So, the default value is useless, it sends in null each time. Even if I set the default at the Item level, I get null. Argg. That's got to be a bug...
    In debug, I do not see the item listed at all. It's not used. That's fine - but why is it trying to insert the value? I would think it would leave it off??? I think because the item is associated with a database column. But, getting around this is ugly. Having to create a hidden item for each one, and then check to see if I need to take the list value... horrible. Any way to get around this???

    I should add - I guess I can always put my own custom process in to replace the DML. Just seems like a simple thing - if the value doesn't appear on the debug, isn't set with any default value... don't include it in the DML.

  • Order Of Null and Not Null Values while table creation

    We have to create a table with 10 fields .5 of them are Null and Not Null. Now my question what should be the order of fileds??.Means Null Fields will come first or Not Null.

    The only reason I can think of having the NULL columns at the end is storage space.
    To conserve space, a null in a column only stores the column length (zero). Oracle
    does not store data for the null column. Also, for trailing null columns, Oracle does
    not even store the column length.

  • Script or query to generate a report of null or not null columns

    I need a script/query it should pick up all the tables from user_tab_columns and produce a report for all the tables which are the columns are null and not null.

    As long as the columns were defined as NOT NULL on table create, or ALTERed NOT NULL, you can do this:
    SQL> CREATE TABLE t (id NUMBER NOT NULL, descr VARCHAR2(10));
    Table created.
    SQL> SELECT column_name, table_name, nullable
      2  FROM user_tab_columns
      3  WHERE table_name = 'T';
    COLUMN_NAME                    TABLE_NAME                     N
    ID                             T                              N
    DESCR                          T                              Y
    SQL> ALTER TABLE t modify (descr NOT NULL);
    Table altered.
    SQL> SELECT column_name, table_name, nullable
      2  FROM user_tab_columns
      3  WHERE table_name = 'T';
    COLUMN_NAME                    TABLE_NAME                     N
    ID                             T                              N
    DESCR                          T                              NNote that if you do:
    ALTER TABLE t ADD CONSTRAINT id_nn CHECK (id IS NOT NULL);then the nullable column in xxx_tab_columns will remain as Y.
    HTH
    John

  • How can I set my WebI filters to Null and not Null

    Folks,
    I have created a report in WebI and now I am to set up some filters as Null and some Not Null.
    How can I set my WebI filters to Null and not Null?
    Regards,
    Bashir Awan

    Hi,
    As you said you could do it at the report level and also at the universe level.
    One more way is to create the filters in the universe levele and add them in thequery filter.
    Ex: in the filter you need to write :
    Column1 is null and and column 2 is not null etc.
    Hope this will help.
    If this did't  solve your problem then please explain it in detail.
    Cheers,
    Ravichandra K

  • Creating table with null and not null values.

    I have to create a table with 5 Null nd 5 Not Null fields.My questionis which fields are place first?Not or Not Null and why???

    What you mean is: the person who asked you the question thought the order of columns was important, and wanted to see if you agreed. Or maybe they were just asking the question to see whether you thought it was important (as a test of your understanding of the database).
    When I started out in Oracle I was told that it was good practice to have the mandatory columns first and then the optional columns. But if you do some research you find this: the impact of column ordering on space management is: empty nullable columns at the end of the table take up zero bytes whereas empty nullable columns at the middle of the table take up one byte each. I think if that saving really is important to you you need to spring for an additional hard drive.
    Besides, even if you do organise your columns as you suggest, what happens when you add an eleventh NOT NULL column to your table? It gets tacked on to the end of your table. Your whole neat organisation is blown.
    What does still matter is the positioning of large VARCHAR2 columns: they should be the last columns on your table in case they create chaining. Then any query that doesn't need the large columns can be satisfied without reading the chained block, something that can't be guaranteed if you've got columns after a VARCHAR2(4000) column. This doesn't apply to CLOBs, etc. which are stored separately anyway.
    Cheers, APC

  • Do we have a function in oracle to select not null columns at the begining

    Hi,
    I have 8 columns. Some of them might be null.
    I want to display all 8 columns in my result. Not null columns will be first and null at the end.
    Here is a sample data :
    Employee table :
    Employee_id   Emp_fname  emp_lname  emp_mname  dept salary emp_height  emp_weight
       1               aaa        ddd                d1   100      6           180
       2               bbb                ccc             120                 169
       3               dfe                           d2            5.9         223The expected result is :
    result1 result2   result3 result4  result5  result6 result7 result8
    1        aaa        ddd     d1       100     6        180
    2        bbb        ccc     120      169
    3        dfe        d2      5.9      223Thanks.
    Edited by: BluShadow on 12-Jul-2012 16:12
    added {noformat}{noformat} tags for readability.  Please read {message:id=9360002} and do this yourself in future.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    The requirement doesn't make a lot of sense and tends to imply that you have an incorrect data model. If that's the case, you'd be much better off fixing the data model than in trying to write this sort of query (particularly since a poor data model is going to force you to write a bunch of creative SQL).
    If you define a type and a function
    CREATE TYPE num_tbl AS TABLE OF NUMBER;
    create or replace function count_null( l_nums in num_tbl )
      return number
    is
      l_cnt integer := 0;
    begin
      for i in 1..l_nums.count
      loop
        if( l_nums(i) is null )
        then
          l_cnt := l_cnt + 1;
        end if;
      end loop;
      return l_cnt;
    end;Then you can do something like this
    SQL> ed
    Wrote file afiedt.buf
      1  select product,
      2         coalesce( q1, q2, q3, q4 ) col1,
      3         (case when count_null( num_tbl( q1 ) ) = 0
      4               then coalesce( q2, q3, q4 )
      5               when count_null( num_tbl( q1, q2 ) ) = 1
      6               then coalesce( q3, q4 )
      7               when count_null( num_tbl( q1, q2, q3 ) ) = 1
      8               then q4
      9               else null
    10           end) col2,
    11         (case when count_null( num_tbl( q1, q2 ) ) = 0
    12               then coalesce( q3, q4 )
    13               when count_null( num_tbl(q1, q2, q3) ) = 1
    14               then q4
    15               else null
    16           end) col3,
    17         (case when count_null( num_tbl( q1, q2, q3 ) ) = 0
    18               then q4
    19               else null
    20           end) col4
    21*   from saleshist
    SQL> /
    PRODUCT                              COL1       COL2       COL3       COL4
    Oracle EE                             100        123        128
    Partitioning                          100        130        128Justin

  • Using NULL and NOT NULL in prompted filters

    Dear all,
    While trying to grap the concept of prompted filters in sap bo web intelligence, I had a question whether why we cannot use NULL and NOT NULL while creating a prompted filters in our report.

    HI,
    'Is Null' and 'Not Null' are the predefined functions in webi which only eliminate the null values or considering only null values.
    'Is Null' and 'Not Null' are itself predefined functions that why you are not getting  prompts.
    Null values are standard across the databases so this is defined  as a function in webi to specific eliminate the null values.
    If something is not standard then there is option in the webi to use different operator with static values or with prompts.
    More more information on Null see the Null wiki page.
    Null (SQL) - Wikipedia, the free encyclopedia
    Amit

  • Script to add not null columns to all tables in database

    Hello,
    I need to add 5 not null columns to my existing database (all tables).
    The problem is that i do not want to loose the current data.
    I need a script so that i need not do this manually for each table.
    Can u suggest?
    Vishal

    Hello,
    I need to add 5 not null columns to my existing database (all tables).
    The problem is that i do not want to loose the current data.
    I need a script so that i need not do this manually for each table.
    Can u suggest?
    Vishal I always follow this step
    1) Alter table <<tablename>> add(<<columnname>> <<datatype>>)
    2) Update <<tablename>> set <<columnname>>=<<anyvalue>>
    3) Alter table <<tablename>> modify(<<columnname>> <<datatype>> not null)
    else
    1) rename <<tablename>> to <<tablenamebk>>
    2) drop table <<tablename>>
    3) Alter table <<tablenamebk>> add(<<columnname>> <<datatype>>)
    4) update <<tablenamebk>> set <<columnname>>=<<anyvalue>>
    5) create table <<tablename>> (with additional columns with not null)
    6) insert into <<tablename>> select * from <<tablenamebk>>

  • How to handle trailing Null columns in a Batch file when ESB reads the file

    Dear All,
    How can I handle trailing Null columns in a batch file (csv file) that is been used by an ESB FTP adapter for batch file processing.
    Since ESB is some times taking up the whole next record as the last column data..
    Please update
    many thanks...

    If your file is not designed to be amazingly large, then you don't need to use a temporary file -- you can just read the data into memory and manipulate it there. (Like, into a Document object or something.)
    But if you are dealing with really large files, you might want to consider using a database back end instead of a text file, which is a completely different approach I know but... well, that's why databases were invented.

  • Interactive Report with Null Columns

    I've got a user who wants to export an interactive report, and he needs certain columns to appear on the export for him to fill the data in later (this is an intermediate step, while we work on getting all the data he needs in to the database). I've created the report query, and there are a handful of null/empty columns (to preserve the correct order for the export). When I try to add this query to APEX in an interactive report, I get a "ORA-00001: unique constraint (APEX_040000.WWV_FLOW_WORKSHEET_COLUMNS_UK2) violated" error.
    Googling around shows me that this happens because of similarly-named columns, and the solution is to provide aliases to all columns. My report has aliases on all columns, but I still cannot create an interactive report. I've tried changing the null columns to empty strings, as well as enclosing the aliases in double-quotes, but nothing works. I can however use my original query to create a standard report, but due to the export requirement, this isn't ideal.
    I was able to create the interactive report with one null column, and then edited the report source to add in the others. This had to be done one at a time, since trying to add multiple null columns at the same time gives the same error again. Unfortunately, when I try and run the page, I get an "ORA-20001: get_dbms_sql_cursor error ORA-00918: column ambiguously defined" error.
    My original query:
    select customer.customer_name as customer,
           project.name as project_name,       
           trunc(project.estimated_end_dt) as due_date,
           project_status.project_status_desc as status,
           null as revenue,
           project.baseline_effort as baseline_hours,
           null as projected_cost,
           null as est_gain_loss,
           project.actual_hours as actual_hours,
           project.estimated_hours as projected_hours,
           null as projected_cost,
           null as projected_gain_loss,
           null as roi      
        from project,
             customer
      where customer.customer_id = project.customer_id
      and project.inactive_ind = 0
      and project.customer_id is not null
      and project.estimated_end_dt >= :DTP_P50_STARTDT
      and project.estimated_end_dt <= :DTP_P50_ENDDT
    order by customer.customer_name,
             project.estimated_end_dt;             Can someone tell me a way to create an interactive report with multiple null columns?

    Hi shimmoril,
    The problem is likely that you have two columns aliased as "projected_cost" (7th column and 11th column).
    Hope this helps,
    John
    If you find this information useful, please mark the post "helpful" or "correct" so that others may benefit as well.*

  • SOLVED !!! Import Excel Null column problem

    Hi all,
    Import data from Excel is fine as long as there's is no column in target table that
    is Varchar2(1) and Null allowable.
    If there's the above type, the DML for the insert always replace the null column with
    'NULL' resulting in SQL Error:ORA-12899: value too large for column (actual: 4, maximum: 1).
    Had check preferences setup and could not find option relating to this.
    Btw, am using Verion 1.1.1.25, on Windows XP, 10GR2 database also on same PC.
    Had use the Export Data to export above table's data and
    had checked the XLS file in Excel and the null column is indeed display as blank and use the Import Data-Excel, to import same XLS file back to database.
    Pls advise and thanks in advance.
    Zack [ /pre]
    Message was edited by:
    Zack.L
    SOLVED !!! Using Version 1.1.3 Build Main-27.66
    A MILLION THANKS !!!
    Best Regards
    Zack
    Message was edited by:
    Zack.L

    Hi Barry,
       That's GREAT NEWS !!!.
       Yes, in the Excel sheet, the column is null and when
    doing import, the SQL command use 'NULL' instead of NULL
    resulting in the string 'NULL' to be inserted.
       So, i just update current release 1.1.2.25 to 1.1.2.25.79 ?
    Thanks for the great work.
    Zack
    Message was edited by:
            Zack.L                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • How to make sqlldr handle mutliple NULL columns

    I am using TRAILING NULL COLS in the control file to tell SQL*Loader to treat any relatively positioned columns that are not present in the record as null columns.
    But the problem is occuring when there are multiple NULL columns one after the other. In that case SQL*Loader is treating continuous null column as 1 NULL column and then I am getting following message:
    ORA-12899: value too large for column
    And reason being wrong value is being tried to inserted in wrong column.
    How can I stop SQL*Loader from combining multiple and continuous NULL columns and basically to make it treat each of them separately.

    I have been able to take care of the issue using the NULLIF attribute. Here is how my control file looks now:
    LOAD DATA
    INFILE 'tab_sal_ldr.tab'
    INSERT INTO TABLE SQL_TAB_LDR
    REPLACE
    FIELDS TERMINATED BY "\t"
    TRAILING NULLCOLS
    (COL1 CHAR,
    COL2 INTEGER EXTERNAL NULLIF COL2=BLANKS,
    COL3 FLOAT EXTERNAL NULLIF COL3=BLANKS,
    COL4 DATE EXTERNAL NULLIF COL4=BLANKS)
    However it is rejecting the rows having all NULLs. Is it possible to upload rows having all column values as NULL.
    Following is the snippet from the log:
    2 Rows not loaded because all fields were null.
    Edited by: Parag Kalra on May 4, 2010 3:31 AM

Maybe you are looking for

  • How can I delete un lite apps from my I pad

    How can I delete un lite apps from my I pad,I just upgraded my I pad 2 to ios7, now I have so many non working apps I try to delete them but they don't go away someone please help me?

  • FRF Problem about amplitudes of two sine signals

    Hi everyone, I'm carrying out a FRF operation between two acquised signals, so I decided to simulate it simply first.I created two dummy sine signals with 50 Hz frequency value and "1" amplitude level for both.And I divide the second signal with a in

  • Need to know the System ID of the R/3 System in ABAP

    Hi, I would like to know the System ID of the ABAP R/3 system in the ABAP code. Is there a parameter to get this requirement. Best Regards Sid

  • How to convert ALAC to 256kbps for ipod when syncing?

    I have a large library of apple ALAC files ripped from CD into itunes and I want to have an easy way of converting to a lessor quality version for syncing with the  ipod.  The problem i don't want duplicates and I want higher than 128 so the check bo

  • Duet server installation error

    My  dear  duets , please request you all from the bottom of the Duet heart  : seggestion below is th java logs . pelase reply if your nto busy  it`s urgent ...... Please wait... Client log: <!LOGHEADER[START]/> <!HELP[Manual modification of the heade