NULL and default!!
hi,
I have created a table as below.
CREATE TABLE student
( Rollno CHAR(8),
Name VARCHAR2(20),
Fees DECIMAL(12,2) DEFAULT 100.00
can someone please explain the effects of the following insert statements.
a] insert into student values('c123','Patrick');
b] insert into student values('c123','Patrick',NULL);
Will both of them have different effects on the values entered into the table? And what will be entered into the columns in both the cases.
Message was edited by:
user593212
Message was edited by:
user593212
SQL> CREATE TABLE student
2 ( Rollno CHAR(8),
3 Name VARCHAR2(20),
4 Fees DECIMAL(12,2) DEFAULT 100.00
5 );
Table created.
SQL> insert into student(rollno,name) values('c123','Patrick');
1 row created.
SQL> select * from student;
ROLLNO NAME FEES
c123 Patrick 100
Similar Messages
-
Hiding Entire Row having Null and default valu in SSRS Using Expression
Hi,
In my reports having number of rows and three columns.The first columns value will be different for each and every row and it will be hard corded to the text box. My question is how to hide the particular row second and third column suppose
to be null or empty data and each and every row had Hide is true.Please provide me the solution if anybody known.
Regards,
HariKan
HariKanHi Qiuyun Yn,
Thanks for your reply.
If i use Not Null in my query in where
condition then i have to add 30 fields in my where condition, and i guess it will not give proper output why because i have 30 columns.
So could you please give me in report level solution. I am struggling past 10 days for this issue.
Regards,
Hari
HariKan -
Default Value , Not Null and EJB2.1
Hi ,
Am using Weblogic10.3 + Oracle Db + EJB2.1 Local Entity Beans .
The issue is that one of the table has createdDt which is not null and is defualt is set to Sysdate. When I try to create this Entity with createdDt null , I get an exception like below , But since I have mentioned default value , I shouldnt be getting this. Have I missed something ?
Code is quite straighforward
Organisation org = organisationHome.create();
....org.setter methods..
java.sql.SQLException: [BEA][Oracle JDBC Driver][Oracle]ORA-01400: cannot insert NULL into ("XXX"."ORGANISATION_T"."CREATEDDT_F")
ErrorCode=1400 SQLState=23000
java.sql.SQLException: [BEA][Oracle JDBC Driver][Oracle]ORA-01400: cannot insert NULL into ("XXX"."ORGANISATION_T"."CREATEDDT_F")
at weblogic.jdbc.base.BaseExceptions.createException(Unknown Source)
at weblogic.jdbc.base.BaseExceptions.getException(Unknown Source)
at weblogic.jdbc.oracle.OracleImplStatement.execute(Unknown Source)
at weblogic.jdbc.base.BaseStatement.commonExecute(Unknown Source)
at weblogic.jdbc.base.BaseStatement.executeUpdateInternal(Unknown Source)
at weblogic.jdbc.base.BasePreparedStatement.executeUpdate(Unknown Source)
at weblogic.jdbcspy.SpyPreparedStatement.executeUpdate(Unknown Source)
at weblogic.jdbc.wrapper.PreparedStatement.executeUpdate(PreparedStatement.java:159)
at weblogic.ejb.container.manager.BaseEntityManager.executeInsertStmt(BaseEntityManager.java:763)
at weblogic.ejb.container.internal.TxManager$TxListener.executeInsert(TxManager.java:900)
at weblogic.ejb.container.internal.TxManager$TxListener.executeDBOperations(TxManager.java:831)
at weblogic.ejb.container.internal.TxManager$TxListener.beforeCompletion(TxManager.java:1054)
at weblogic.transaction.internal.ServerSCInfo.doBeforeCompletion(ServerSCInfo.java:1217)
at weblogic.transaction.internal.ServerSCInfo.callBeforeCompletions(ServerSCInfo.java:1195)
at weblogic.transaction.internal.ServerSCInfo.startPrePrepareAndChain(ServerSCInfo.java:118)
at weblogic.transaction.internal.ServerTransactionImpl.localPrePrepareAndChain(ServerTransactionImpl.java:1302)
at weblogic.transaction.internal.ServerTransactionImpl.globalPrePrepare(ServerTransactionImpl.java:2114)
at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:263)
at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:230)
at weblogic.ejb.container.internal.BaseRemoteObject.postInvoke1(BaseRemoteObject.java:621)
at weblogic.ejb.container.internal.StatelessRemoteObject.postInvoke1(StatelessRemoteObject.java:60)
at weblogic.ejb.container.internal.BaseRemoteObject.postInvokeTxRetry(BaseRemoteObject.java:441)
at com.tieto.tix.core.domain.DomainServices_7p8lqs_EOImpl.createOrganisation(DomainServices_7p8lqs_EOImpl.java:7717)
at com.tieto.tix.core.domain.DomainServices_7p8lqs_EOImpl_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:589)
at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:230)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:477)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
at weblogic.security.service.SecurityManager.runAs(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:473)
at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)parmTest( , "param2") is syntactically incorrect, so there can be no "workaround".
In addition to solutions offered by SwapnilVJ and Saransoft84, you could also use a rest parameter:
function parmTest(... args)
// set up default values
var val1:Boolean=true;
var val2:String="";
switch(args.length)
case 0:break;
case 1:
if(args[0] is String){val2=args[0] as String;}
else{val1=args[0] as Boolean;}
break;
case 2:
default:
val1=args[0] as Boolean;
val2=args[1] as String;
break;
trace(val1 + " " +val2);
parmTest();
parmTest("hello");
parmTest(null,"hello");
parmTest("hello",null); -
MS ACCESS, NULL, and '%'
I am using a prepared statement to query my access database which contains personal data first name, last name, address, city, state, etc.... I allow the user to search the database by any of these fields (or any combination of them) by making the default values for any empty fields '%'. Here's my select statement.
stmt =conn.prepareStatement("SELECT * FROM Data1 WHERE first_name LIKE ? AND last_name LIKE ? AND city LIKE ? ....");
stmt.setString(1, firstNameField.getText()+"%");
stmt.setString(2, lastNameField.getText()+"%");
stmt.setString(3, cityField.getText()+"%");
This worked but didn't return a record if ANY of their values are NULL. So I changed my select statement to allow for NULL values.
stmt =conn.prepareStatement("SELECT * FROM Data1 WHERE (first_name LIKE ? OR first_name IS NULL) AND (last_name LIKE ? OR last_name IS NULL) AND (city LIKE ? OR city IS NULL) ....");
stmt.setString(1, firstNameField.getText()+"%");
stmt.setString(2, lastNameField.getText()+"%");
stmt.setString(3, cityField.getText()+"%");
This fixed that problem, but now it ALWAYS returns the records with NULL fields. I want it to only match NULL fields if the coressponding JTextField is left blank. Can anyone tell me a good way to do this?How can I create it dynamically and still keep the
speed of a prepared statement??Unless you are doing block inserts in a loop you are probably not going to see any speed improvement anyways.
But as I said you can simply create all the combinations and then use an array to keep track of them. -
More Fun with NULLs and Empty Strings
Greetings,
I ran across this behavior recently and thought I'd share with the forum. I'm running 10.2.0.2. Note the difference in behavior between passing and explicit NULL in the parameter vice passing an empty string (''):
CREATE OR REPLACE PROCEDURE NULL_ES_TEST(PARAM1 IN VARCHAR2) IS
VAR1 CHAR(1);
BEGIN
IF PARAM1 IS NULL THEN
DBMS_OUTPUT.PUT_LINE('PARAM1 IS NULL');
END IF;
VAR1 := PARAM1;
IF VAR1 IS NULL THEN
DBMS_OUTPUT.PUT_LINE('VAR1 IS NULL');
ELSE
DBMS_OUTPUT.PUT_LINE('VAR1 IS NOT NULL');
END IF;
DBMS_OUTPUT.PUT_LINE('THE LENGTH OF VAR1 IS '||TO_CHAR(LENGTH(VAR1)));
END NULL_ES_TEST;
EXEC NULL_ES_TEST(PARAM1 => '');
PARAM1 IS NULL
VAR1 IS NOT NULL
THE LENGTH OF VAR1 IS 1
(var1 now holds a single space)
EXEC NULL_ES_TEST(PARAM1 => NULL);
PARAM1 IS NULL
VAR1 IS NULL
THE LENGTH OF VAR1 IS
Any Comments or Insights are welcome.
Sincerely,
Dale WardWell somethings not as expected (tested on 10.2.0.3)
Even if you default the parameter to '', it treats null and '' differently.
SQL> ed
Wrote file afiedt.buf
1 CREATE OR REPLACE PROCEDURE NULL_ES_TEST(PARAM1 IN VARCHAR2 := '') IS
2 VAR1 CHAR(1);
3 BEGIN
4 IF PARAM1 IS NULL THEN
5 DBMS_OUTPUT.PUT_LINE('PARAM1 IS NULL');
6 END IF;
7 VAR1 := PARAM1;
8 IF VAR1 IS NULL THEN
9 DBMS_OUTPUT.PUT_LINE('VAR1 IS NULL');
10 ELSE
11 DBMS_OUTPUT.PUT_LINE('VAR1 IS NOT NULL');
12 END IF;
13 DBMS_OUTPUT.PUT_LINE('THE LENGTH OF VAR1 IS '||TO_CHAR(LENGTH(VAR1)));
14* END NULL_ES_TEST;
SQL> /
Procedure created.
SQL> exec null_es_test(null);
PARAM1 IS NULL
VAR1 IS NULL
THE LENGTH OF VAR1 IS
PL/SQL procedure successfully completed.
SQL> exec null_es_test('');
PARAM1 IS NULL
VAR1 IS NOT NULL
THE LENGTH OF VAR1 IS 1
PL/SQL procedure successfully completed.
SQL> -
Oracle evolution suggestion : NULL and Index
Hello,
As you know in most of case NULL values are not indexed and then not searchable using index.
Then when you do where MyField is null, you have the risk of doing a full table scan
However most of people don't know that, and then doesn't care of this possible issue and of possible solution (bitmap or including a not null column)
SQL Server, MySQL and probably some others DB don't have the same behavior as they indexes NULL
I know this caveat can be used to have partial indexing by nulling non interesting values and then can't be removed
Then I would suggest to enhance the create index command to allow to index also null with something like that
Create index MyIndex on MyTable(MyColumn including nulls )
As you make this change, perhaps it would be geat to change the behavior documented bellow as it looks more as an old heritage too by adding keyword like "allow null duplicate" and "constraint on null duplicate"
Ascending unique indexes allow multiple NULL values. However, in descending unique indexes, multiple NULL values are treated as duplicate values and therefore are not permitted.
LaurentHello,
Thanks, for the links it cover mains solutions to index null values, there's also the usage of bitmap index.
All of them are not very intuitive for an non expert.
But the purpose of my message was mainly to higlight this complexity for a quite basic stuff, as I think that the default solution should be to index nulls and eventually allow to do not index them.
As I said this is the behavior on sql server and mysql. That why i suggest to enhance index behavior to allow to index nulls easily and not by using stange tips like indexing a blank space or a not null column.
This solutions are from my viewpoint workaround, helpfull workaround but still workaround, Oracle database team have the power to change this root cause without breaking ascending compatibility, here is the sense of my message, just hopping they can hear me...
Laurent -
I have an ODBC application whose backend has been changed from Access to Oracle. There is one particular query that is causing problems. The query contains a where clause with something like "field = ''" in it. This query is intended to pick up records where field is null. If the query was modified to "field is null," it would work. However, I cannot change the application.
Is there any way to configure the ODBC driver or something so that this query would work properly? I've tried defaulting the field to '', but Oracle is still treating it as null.
(What is really frustrating is that the application NEVER populates this field!)Actually, Oracle is very consistent in that it requires you to use ternary logic when dealing with null values. NULL is never equal to a value, NULL is never not equal to a value.
select * from someTable where column <> 'value'
will show you only those rows in someTable where column is non-NULL and where its value is not 'value'
select count(*) from someTable !=
select count(*) from someTable where column <> 'value' +
select count(*) from someTable where column = 'value'
select count(*) from someTable =
select count(*) from someTable where column <> 'value' +
select count(*) from someTable where column = 'value' +
select count(*) from someTable where column IS NULL
There are plenty of discussions in Oracle texts and in Oracle newsgroups that go into much greater detail about the how's & why's of this.
Justin -
Interactive report and default-filter
ahoj!
i have a question regarding interactive reports and default-filter for a date: is it possible to use the current date for the default-filter? apex need 'dd.MM.yyyy' for the filter... already tried to_date(sysdate, 'dd.MM.yyyy')
thx in advance,
christianHi,
I've just been trying the "in the last" option and had no problems for any number that I entered. Are you just entering 1 into the box? What error do you get?
I've loaded the page with Debug switched on, and get:
select
null as apxws_row_pk,
"DATE_ID",
"ATD_DATE",
"CHECK",
count(*) over () as apxws_row_cnt
from (
select * from (
select
apex_item.checkbox(1, DATE_ID) "CHECK",
"DATE_ID",
"ATD_DATE"
from "#OWNER#"."ATD_DATES"
) r
where ("ATD_DATE" between systimestamp - (1 * :APXWS_EXPR_1) and systimestamp)
) r where rownum <= to_number(:APXWS_MAX_ROW_CNT):APXWS_EXPR_1 would contain the value 1 as that is what I've entered for the filter. My report's sql statement is just the innermost nested select statement, the rest has been added by the IR functionality and the filter.
Andy -
Unable to open file "NULL\.EXT" - default sizes assumed for initial extents
Dear Friends i am trying to install IDES 4.6C on Windows 2000 Advance server + MSSQL2000 this error i am facing during installation all of the installation files are on my D:\ drive following is the structure.
D:\DBExport\DB
D:\DBExport\Data
D:\DBExport\LABEL.ASC
and kernal also on D:\ drive.
this is the error number one which i got
Error: DBR3LOADEXEC_NT_MSS R3loadPrepare 2 722
Child exited with error: rc = 2
child_pid = 1
See logfile SAPAPPL2.log for further information
and here is the associated log file.
#START OF LOG: 20060123112519
R3load version @(#) $Id: //bas/46D/src/ins/R3load/R3load.c#12 $ SAP
R3load -fast -i SAP0000.cmd -p SAP0000.log
start of syntax check ###
end of syntax check ###
#START: 20060123112520
error message: No such file or directory
(GOS) WARNING: Unable to open file "NULL\.EXT" - default sizes assumed for initial extents
(OLD) ERROR: CREATE statement failed for object "D010L"
(CREATE TABLE "D010L" ( "PROG" VARCHAR(40) NOT NULL ,
"R3STATE" VARCHAR(1) NOT NULL , "R3MODE" VARCHAR(1) NOT NULL ,
"R3VERSION" VARCHAR(4) NOT NULL , "MACH" SMALLINT NOT NULL ,
"BLOCKNR" TINYINT NOT NULL , "BLOCKLG" DECIMAL(5,0) NOT NULL ,
"BLOCK" IMAGE NULL )
exec sp_bindefault 'str_default','D010L.PROG'
exec sp_bindefault 'str_default','D010L.R3STATE'
exec sp_bindefault 'str_default','D010L.R3MODE'
exec sp_bindefault 'str_default','D010L.R3VERSION'
exec sp_bindefault 'num_default','D010L.MACH'
exec sp_bindefault 'num_default','D010L.BLOCKNR'
exec sp_bindefault 'num_default','D010L.BLOCKLG'
DbSlExecute: rc = 106
(SQL error 2714)
error message returned by DbSl:
There is already an object named 'D010L' in the database.
#STOP: 20060123112520
#START OF LOG: 20060123152536
R3load version @(#) $Id: //bas/46D/src/ins/R3load/R3load.c#12 $ SAP
R3load -fast -i SAP0000.cmd -p SAP0000.log -r
start of syntax check ###
end of syntax check ###
trying to restart import ###
(RIM) INFO: table "D010L" dropped
restart finished ###
#START: 20060123152552
error message: No such file or directory
(GOS) WARNING: Unable to open file "NULL\.EXT" - default sizes assumed for initial extents
(IMP) TABLE: "D010L"
#Trying to create primary key "D010L~0"
(IMP) PRKEY: "D010L~0"
(OLD) ERROR: CREATE statement failed for object "D010LINF"
(CREATE TABLE "D010LINF" ( "PROG" VARCHAR(40) NOT NULL ,
"R3STATE" VARCHAR(1) NOT NULL , "R3MODE" VARCHAR(1) NOT NULL ,
"R3VERSION" VARCHAR(4) NOT NULL , "MACH" SMALLINT NOT NULL ,
"R3RELEASE" VARCHAR(4) NOT NULL , "R3MODIFY" INT NOT NULL ,
"UNAM" VARCHAR(12) NOT NULL , "UDAT" VARCHAR(8) NOT NULL ,
"UTIME" VARCHAR(6) NOT NULL , "L_DATALG" INT NOT NULL ,
"Q_DATALG" INT NOT NULL , "Y_DATALG" INT NOT NULL , "SDAT" VARCHAR(8) NOT NULL ,
"STIME" VARCHAR(6) NOT NULL )
exec sp_bindefault 'str_default','D010LINF.PROG'
exec sp_bindefault 'str_default','D010LINF.R3STATE'
exec sp_bindefault 'str_default','D010LINF.R3MODE'
exec sp_bindefault 'str_default','D010LINF.R3VERSION'
exec sp_bindefault 'num_default','D010LINF.MACH'
exec sp_bindefault 'str_default','D010LINF.R3RELEASE'
exec sp_bindefault 'num_default','D010LINF.R3MODIFY'
exec sp_bindefault 'str_default','D010LINF.UNAM'
exec sp_bindefault 'str_default','D010LINF.UDAT'
exec sp_bindefault 'str_default','D010LINF.UTIME'
exec sp_bindefault 'num_default','D010LINF.L_DATALG'
exec sp_bindefault 'num_default','D010LINF.Q_DATALG'
exec sp_bindefault 'num_default','D010LINF.Y_DATALG'
exec sp_bindefault 'str_default','D010LINF.SDAT'
exec sp_bindefault 'str_default','D010LINF.STIME'
DbSlExecute: rc = 106
(SQL error 2714)
error message returned by DbSl:
There is already an object named 'D010LINF' in the database.
#STOP: 20060123152556
#START OF LOG: 20060123154952
R3load version @(#) $Id: //bas/46D/src/ins/R3load/R3load.c#12 $ SAP
R3load -fast -i SAP0000.cmd -p SAP0000.log -r
start of syntax check ###
end of syntax check ###
trying to restart import ###
(RIM) INFO: table "D010LINF" dropped
restart finished ###
#START: 20060123154955
(IMP) TABLE: "D010LINF"
#Trying to create primary key "D010LINF~0"
(IMP) PRKEY: "D010LINF~0"
(OLD) ERROR: CREATE statement failed for object "D010Q"
(CREATE TABLE "D010Q" ( "PROG" VARCHAR(40) NOT NULL ,
"R3STATE" VARCHAR(1) NOT NULL , "R3MODE" VARCHAR(1) NOT NULL ,
"R3VERSION" VARCHAR(4) NOT NULL , "MACH" SMALLINT NOT NULL ,
"BLOCKNR" TINYINT NOT NULL , "BLOCKLG" DECIMAL(5,0) NOT NULL ,
"BLOCK" IMAGE NULL )
exec sp_bindefault 'str_default','D010Q.PROG'
exec sp_bindefault 'str_default','D010Q.R3STATE'
exec sp_bindefault 'str_default','D010Q.R3MODE'
exec sp_bindefault 'str_default','D010Q.R3VERSION'
exec sp_bindefault 'num_default','D010Q.MACH'
exec sp_bindefault 'num_default','D010Q.BLOCKNR'
exec sp_bindefault 'num_default','D010Q.BLOCKLG'
DbSlExecute: rc = 106
(SQL error 2714)
error message returned by DbSl:
There is already an object named 'D010Q' in the database.
#STOP: 20060123154956
#START OF LOG: 20060123162918
R3load version @(#) $Id: //bas/46D/src/ins/R3load/R3load.c#12 $ SAP
R3load -fast -i SAP0000.cmd -p SAP0000.log -r
start of syntax check ###
end of syntax check ###
trying to restart import ###
(RIM) INFO: table "D010Q" dropped
restart finished ###
#START: 20060123162920
(IMP) TABLE: "D010Q"
#Trying to create primary key "D010Q~0"
(IMP) PRKEY: "D010Q~0"
(IMP) ERROR: CREATE statement failed for object "D010Y"
(CREATE TABLE "D010Y" ( "PROG" VARCHAR(40) NOT NULL ,
"R3STATE" VARCHAR(1) NOT NULL , "R3MODE" VARCHAR(1) NOT NULL ,
"R3VERSION" VARCHAR(4) NOT NULL , "MACH" SMALLINT NOT NULL ,
"BLOCKNR" TINYINT NOT NULL , "BLOCKLG" DECIMAL(5,0) NOT NULL ,
"BLOCK" IMAGE NULL )
exec sp_bindefault 'str_default','D010Y.PROG'
exec sp_bindefault 'str_default','D010Y.R3STATE'
exec sp_bindefault 'str_default','D010Y.R3MODE'
exec sp_bindefault 'str_default','D010Y.R3VERSION'
exec sp_bindefault 'num_default','D010Y.MACH'
exec sp_bindefault 'num_default','D010Y.BLOCKNR'
exec sp_bindefault 'num_default','D010Y.BLOCKLG'
DbSlExecute: rc = 106
(SQL error 2714)
error message returned by DbSl:
There is already an object named 'D010Y' in the database.
#STOP: 20060123162921
I am really struck with the installation any help will be highly appreciated.
best regards,
ZeeshanHi:
It seemed to me that you put the wrong directory or drive when started the installation. It shows "error message: No such file or directory" when trying to locate the files.
You can try to verify your inputs during first phase of the installation.
Hope this helps!
Best Regards,
Federico G. Babelis
NetWeaver Certified Consultant
http://www.gazum.com -
Null-value="default" ignored?
I am experimenting with the null-value attribute on a field and
while a value of "exception" seems to be behaving as expected,
"default" seems to be no different than "none".
I have a trivial class with a String field (fieldTwo) that's
mapped to a non-null column in the database. Here is the JDO
mapping file:
<class name="DumbData" identity-type="application"
objectid-class="DumbData$Oid">
<extension vendor-name="kodo" key="table"
value="dumb_data"/>
<extension vendor-name="kodo" key="lock-column"
value="lock"/>
<extension vendor-name="kodo" key="class-column"
value="none"/>
<field name="id" primary-key="true">
<extension vendor-name="kodo" key="data-column"
value="id"/>
</field>
<field name="fieldOne">
<extension vendor-name="kodo" key="data-column"
value="field_one"/>
</field>
<field name="fieldTwo" null-value="default">
<extension vendor-name="kodo" key="data-column"
value="field_two"/>
</field>
<field name="theReference">
<extension vendor-name="kodo"
key="id-data-column" value="dumb_data2_id"/>
</field>
<field name="transientField"
persistence-modifier="transactional" />
</class>
Here is the generated SQL for an insert:
INSERT INTO dumb_data
(field_two, lock, id, field_one, dumb_data2_id)
VALUES (NULL, 0, 20, 1234, NULL)
Apparently, Kodo is attempting to insert a null for fieldTwo
(instead of '') although the mapping specifies
null-value="default". Am I missing something obvious and
completely embarassing myself here?
Thanks,
Alex
Alex Albu
Commerce Technologies, Inc.
21 Corporate Drive
Clifton Park, NY 12065According to the JDO spec, setting null value = 'default' means that a null
for the field will be replaced with that field type's default value. There
is no Java default value for Strings. The default is null.No, the spec says (20.9.6.):
The null-value setting of "default" is used when the default
value for the data store element is to be used for null-valued
fields.
And it even gives an example for String:
[...] a null-valued String field would be written to the data
store as an empty (zero length) String where the null-value
setting is "default".
Alex Albu
Commerce Technologies, Inc.
21 Corporate Drive
Clifton Park, NY 12065 -
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 -
Not null and enable or disable column in tabular form
Hi,
Using apex version 4.1 and working on tabular form.
ACT_COA_SEGMENT_MAS is Master table
and
ACT_SEGMENT_VALUES_MAS is detail table
I have entered 8 rows in master table and PARENT_SEGMENT_ID is column in master table which is null able. If i specified PARENT_SEGMENT_ID with value in master table then in detail table there is column PARENT_ID that should not be null and enable.
How i can enable or disable column when in master table PARENT_SEGMENT_ID column is null then in detail table PARENT_ID column should disable and vice versa.
I have created tabular form on Detail table. before insert into the tabular form Check in master table in first entry if PARENT_SEGMENT_ID is not null in first row of master table then in tabular form PARENT_ID should enable and not null able in corresponding to this first row id's lines in tabular form.
Same should check for second row in master table if PARENT_SEGMENT_ID is not null then entered rows with PARENT_ID into tabular form corresponding to 2nd id in master table should not nullable and column should enable in tabular form.
Thanks & Regards
Vedant
Edited by: Vedant on Jan 9, 2013 9:12 PMVedant,
You need to create you own manual tabular form and not use the wizard.
Using APEX_ITEM api you should be build you own form and you will be able to control how you wan to display the rows. (See Link [Apex Item Help|http://docs.oracle.com/cd/E37097_01/doc/doc.42/e35127/apex_item.htm#CACEEEJE] )
select case when PRIMARY_TABLE_COLUMN is null then APEX_ITEM.DISPLAY_AND_SAVE(3 , DETAIL_COLUMN ) else APEX_ITEM.TEXT(2,detail_column) end "ALIAS" from detail table
Hope that help.
Vivek -
Connection ==null and Connection is closed, difference
Hi experts,
I wonder what are the differences between "Connection==null" and "Connection is closed"?
I closed a connection on one JSP page after a bean has retrieved data. Then, on the same page I call another bean to connect to the database. Because the Connection object has been created earlier, therefore Connection is not NULL, but it is closed. So, the second bean has to initiate another connection(if I knew how to test the "closed" status)
Is it true that if the Connection is closed, then it should become null?
I think I must have make quite a few mistakes in above statement:). Please help. Thanks a lot.connection.isClosed() will tell you if the connection object is closed or not. If it is closed, then the connection object can be dropped because you will not be able to create any new statements from that connection object. Just recreate another connection to use when this occurs.
-
Is null and regular value in where ($variable)
is there any polibility to create select depend on value in where ?
select count(x) where y = $variablebut if variable is NULLit doesn't work cause must be IS NULL or IS NOT
select count(x) where y is $variableIs there any posibility to make it working with null and regular variable?try:
select count(x) from <yourtable> where nvl(y,<not_possible_value>) = nvl($variable,<not_possible_value>);where <not_possible_value> is a value that is not possible for column y.
E.g. if y always is a positive number you could use the value -1. -
Avoiding null and duplicate values using model clause
Hi,
I am trying to use model clause to get comma seperated list of data : following is the scenario:
testuser>select * from test1;
ID VALUE
1 Value1
2 Value2
3 Value3
4 Value4
5 Value4
6
7 value5
8
8 rows selected.
the query I have is:
testuser>with src as (
2 select distinct id,value
3 from test1
4 ),
5 t as (
6 select distinct substr(value,2) value
7 from src
8 model
9 ignore nav
10 dimension by (id)
11 measures (cast(value as varchar2(100)) value)
12 rules
13 (
14 value[any] order by id =
15 value[cv()-1] || ',' || value[cv()]
16 )
17 )
18 select max(value) oneline
19 from t;
ONELINE
Value1,Value2,Value3,Value4,Value4,,value5,
what I find is that this query has duplicate value and null (',,') coming in as data has null and duplicate value. Is there a way i can avoid the null and the duplicate values in the query output?
thanks,
Edited by: orausern on Feb 19, 2010 5:05 AMHi,
Try this code.
with
t as ( select substr(value,2)value,ind
from test1
model
ignore nav
dimension by (id)
measures (cast(value as varchar2(100)) value, 0 ind)
rules
( ind[any]= instr(value[cv()-1],value[cv()]),
value[any] order by id = value[cv()-1] || CASE WHEN value[cv()] IS NOT NULL
and ind[cv()]=0 THEN ',' || value[cv()] END
select max(value) oneline
from t;
SQL> select * from test1;
ID VALUE
1 Value1
2 Value2
3 Value3
4 Value4
5 Value4
6
7 value5
8
8 ligne(s) sélectionnée(s).
SQL> with
2 t as ( select substr(value,2)value,ind
3 from test1
4 model
5 ignore nav
6 dimension by (id)
7 measures (cast(value as varchar2(100)) value, 0 ind)
8 rules
9 ( ind[any]= instr(value[cv()-1],value[cv()]),
10 value[any] order by id = value[cv()-1] || CASE WHEN value[cv()] IS NOT NULL
11 and ind[cv()]=0 THEN ',' || value[cv()] END
12 )
13 )
14 select max(value) oneline
15 from t;
ONELINE
Value1,Value2,Value3,Value4,value5
SQL>
Maybe you are looking for
-
Windows 8.1 to 8.1 Pro
I have purchased a laptop with Windows 8.1 pre-installed. I also purchased a Windows 8.1 Pro disc and license but every time I run a custom install it reverts back to the 8.1 Home edition with the OEM license and never allows me to install the 8.1 Pr
-
TS3276 . How to set a default email client
I can't find a way to establish a default email client (I have 4) for Mail just upgraded to Mountain Lion. All help appreciated. George
-
Why does my 720 x 480 clip not fit in my 720 x 480 sequnce? (Black side bars)
Hopefully someone understands, I'm trying to make an edit with some Mini DV Standard Definition footage in Premiere Pro CS5 and Im using a Mac with Lion 10.7.4. All of the clips are .mov and 720 x 480 and I have the sequence set to DV - NTSC 720x 480
-
Cube don't apper in the Query designer
Hi all I have created one cube and i don't see that one in my query designer..am I missing something here...pls let me know..cube is active,,update rule is active also. thanks
-
Hi, I'm trying an Idoc to file scenario. I'm posting idocs from r/3 to xi. In sxi_monitor it shows the sender schema as ALE#SP. This used to be shown as XIParty earlier. This is not really a problem, since I'm mapping to a file. But I'm just curiou