Query to check null values on a BLOB
Hi, I tried to write a pl/sql procedure if :blobcol is null then ....; end if;
returns an error: no PL/SQL Translation for the bindtype given for this bind variable.
is there a way to check to see if a BLOB column has data in it?
thanks!
ME_XE?create table test_blob(column1 number, column2 blob default empty_blob());
Table created.
Elapsed: 00:00:00.10
ME_XE?insert into test_blob(column1) values (1);
1 row created.
Elapsed: 00:00:00.10
ME_XE?select column1 from test_blob where DBMS_LOB.GETLENGTH(column2) = 0;
COLUMN1
1
1 row selected.
Elapsed: 00:00:00.18
Similar Messages
-
Issue with Results from Another Query (Error on Null value)
Hi All,
We have a WebI report using "Result from Another Query" option of BO XI R3.1. The report was running fine till recently the dimension object using result from another query had a null value. Report suddenly throwed error as the query filters are invalid.
Is there a way to make this filter optional if no data/null value is there ? Because we need those null values in report as well.
Thank you for your time.
Thanks & Regards
LNHi Vivek,
It was not directly solved but I applied alternate logic to over come the issue.
Here's what I did to overcome:
I used a sub query in place of the whole result from another query.
For Ex:
Dim1 inlist result from another query1
I made it as
Dim1 inlist (Dim0)
where Conditions.
Here Dim0 is the object which we use for Result from another query and Conditions will be the necessary filter conditions to arrive proper Dim0. Make sure proper context is formed for the sub query.
Even though it resolved my problem, It introduces an new issue. It causes increase in query run time when huge set of data is returned from sub query.
Please let me know if i haven't explained clearly.
Hi Aris_BO,
Sorry for not responding earlier. The logic would probably make more queries null & not null. Thats why I was not advised to use it.
Thanks
LN -
How to query for a NULL value?
Hi all,
how can I query for a NULL value in a ViewObject. I tried to set null as where-clause param [setWhereClauseParam(0, null)]. But the created statement looks like this:
SELECT ...
FROM ...
WHERE param = null
I would expect it to create something like WHERE param IS NULL. I hope anybody has a solution for this.
Thanks,
AxelI think you should use setWhereClause("COL_NAME IS NULL")
You could use setWhereClauseParam(0, "NULL"), but only if you have a predefined query similar to: "SELECT X, Y, Z FROM A WHERE X IS :0" (which is a pretty useless query, as you can ONLY set "NULL" as the value for ":0"). -
How to check the sql:query is return null value
I have use :
<sql:query var="sql1" dataSource="${db}">
select col_name from table_name
where a=<c:out value="${row.test1}"/>
and b='<c:out value="${row.test2}"/>'
</sql:query>
So, how can I check this statement return null value which is no record within this table?The Result should never be null but can be empty. You can check if the Result is empty using an if tag and checking the rowCount property:
<sql:query var="books"
sql="select * from PUBLIC.books where id = ?" >
<sql:param value="${bookId}" />
</sql:query>
<c:if test="${books.rowCount > 0}">
</c:if>http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JSTL7.html#wp84217
Look for query Tag Result Interface -
Checking NULL values in templates
Hi Tim,
This is a very common problem that one encounters in designing any report be it using D2K or XMLP. Suppose i want a particular field to be displayed only if there is value in the data field, else to be hidden from the user, how can i do this?
To be more clear on this requirement, say i have a field called PO_NUM and i want the folllowing check:
If PO_NUM != NULL then {Not Null}
display PO_DETAILS
else
don't display PO_DETAILS
end if
How can i achieve this requirement using XMLP? Please reply to this query of mine, as currently i am using a workaround for this issue, but need a solution/fix to it forever.
Thanks,
NitinHi Pavel,
You are absolutely right. It doesnot work for me either.
Sample XML:
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated by Oracle Reports version 6.0.8.24.0 -->
<SUPPLIERLIST>
<G_SUPPLIER>
<G_VENDOR>
<VENDOR_NO>100</VENDOR_NO>
<VENDOR_NAME>XYZ</VENDOR_NAME>
</G_VENDOR>
<G_VENDOR>
<VENDOR_NO></VENDOR_NO>
<VENDOR_NAME>ABC</VENDOR_NAME>
</G_VENDOR>
<G_VENDOR>
<VENDOR_NO>0</VENDOR_NO>
<VENDOR_NAME>EFG</VENDOR_NAME>
</G_VENDOR>
</G_SUPPLIER>
</SUPPLIERLIST>
Code used in RTF template:
<?for-each:G_VENDOR?>
<?if@inline: VENDOR_NO != ?><?VENDOR_NO?><?end if?>
<?if@inline: VENDOR_NAME != ?>,<?VENDOR_NAME?><?end if?>
<?end for-each?>
This gives me wrong output.
Then i used the following code:
<?for-each:G_VENDOR?>
<?if: VENDOR_NO != ?><?VENDOR_NO?><?end if?> <?if: VENDOR_NAME != ?>,<?VENDOR_NAME?><?end if?>
<?end for-each?>
I get the correct data, but the output in not in desired format.
The i tried with the following way:
A table with the following format:
Vendor No Vendor Name
for-each G_VENDOR VENDOR_NO
VENDOR_NAME end G_VENDOR
then it works perfectly fine, with data moving to next lines, although in right columns as desired.
Please let me know the right solution to this issue. I am using XMLP 5.5
Thx,
Nitin -
Hello to ABAP Gurus
First of all I am zero in ABAP hence please ingnore my lack of knowledge.
Question is that I have written an ABAP routine in transfer rule where I am pulling data from R/3 system into my info objects.
What I would like to do here is that if the date is NULL "Not present at source", I would like to assign the default date to my info object.
My small piece of code looks like below
If TRAN_STRUCTURE-birthdt = ' '.
RESULT = '01/01/9999'.
else.
RESULT = TRAN_STRUCTURE-birthdt.
endif.
Please let me have your expert advice.
Many thanks in Advance.
Regards,
BobbyHi Gopal
Use function module <b>CONVERT_DATE_TO_EXTERNAL</b>. This will convert the date to the user specific format. So if your user specific format is mm/dd/yyyy, then this is all you need.
Check below threads as well...
Re: Date Conversion Function Modules YYYYMMDD to MM/DD/YYYY
convert yyyymmdd date format to mm/dd/yyyy
How to convert date format to MM/DD/YYYY
hope it will solve ur problem..
<b>Reward Points if helpful.</b>
Thanks & Regards
ilesh 24x7 -
hi,
can anyone please tell me the solution to solve my problem?
i have two tables.
1.HR->it contains all the Employee Details
2.criteria->it contains some fields as in the HR
hr table
emp_id|Country_code|lob_level10|lob_level_11|salary|cpu_name
|-----|------------|------------|-----------|------|--------
|1111 | AE | IASG | CRM |10000 |Global
|2222 | BZ | TTL | ILL |20000 |MD
|3333 | CH | LLD | CRM |30000 |Global
criteria table
|emp_id|country_code|lob_level10|lob_level_11|cpu_name
|------|------------|-----------|------------|--------
| 2222 | null | null | null | MD
| null | null | null | CRM | Global
i want to update cpu_name in HR depend upon the condition entered in the criteria table.
--->here the first row condition is i have to update the cpu_name as MD in HR table
those who having the emp_id as 1111 in HR
---->second row condition is update the Cpu_name as Global in HR those who are having
Lob_Level11 As CRM
like this i want to check each row in criteria table with HR.
after the completion of the process th HR table should look like this...
emp_id|Country_code|lob_level10|lob_level_11|salary|cpu_name
|-----|------------|------------|-----------|------|--------
|1111 | AE | IASG | CRM |10000 |Global
|2222 | BZ | TTL | ILL |20000 |MD
|3333 | CH | LLD | CRM |30000 |Global
thanks in advance
vally.s
Message was edited by:
LEE_APT
Message was edited by:
LEE_APTHi Vally.s,
You first need to decide how you're going to update your table.
Are you going to do it:
1) for ex.:
UPDATE hr h
SET h.cpu = (SELECT c.cpu FROM criteria c WHERE c.emp_id = h.emp_id)
WHERE EXISTS
(SELECT 1
FROM criteria c
WHERE c.emp_id = h.emp_id);
... and same for other columns of criteria
2) with PLSQL, write a procedure that loops through criteria and then through the hr table to do the update (LOOP ... (criteria) IF ... THEN LOOP ... (hr) END LOOP; END IF; IF ... THEN ... END LOOP)
3) If you need interaction with your APEX application, you can add a condition to your different PLSQL processes.
Hope that it's more clear now,
Dimitri -
NULL Value in ORDR.DISCPRCNT.
Hi SAP Gurus,
is there any possibility that NULL Values can be passed in ORDR.DISCPRCNT Field in Sales Order Screen..?
on executing query on Doc Num 205926 i found NULL value in ORDR.DISCPRCNT, instead of 0.00,
is there any solutions available for this problem..?
i appreciate your help..
Thanks and Regards,
kaviprashuHi Kaviprashu,
If this is a problem you can either report it to SAP (official), run a simple update query setting all NULL values to 0 (not allowed, so you did not hear this from me), or work around it with
ISNULL(ORDR.DISCPRCNT, 0) AS DISCPRCNT
Regards,
Johan -
Check for NULL value (Recordset field)
Hi y'all...
A little question, so just for the weekend...
I've a query that returns 4 fields, the fisrt three always containing data, and the last one an integer, or NULL. If I get the value with <i>rs.Fields.Item(3).Value.ToString();</i> it always contains an integer. The NULL values are always converted to '0'.
How can I check if it is a NULL value?Okey, found a workaround, using the SQL function ISNULL()...
SELECT ISNULL(U_MyVar, 'null_value') FROM [@MyTable]
Now I can check if the value has the value <i>"null_value"</i>. If so, that field was <i>null</i> -
How to check a value for paramter query
I am passing a paramter value from my text box to my sql statement and I would like to check if the value is entered into a text box. If you have any idea please share it with me, i have been struggling with this for many days.Code below is how i try to check if the value is entered but I do not know how to check the value in the :VendorName
thanks
If Not txtVendorName.Text = "" Then
Sql = Sql & " AND (Upper(V.VNAMEL) LIKE '%' || Trim(Upper(:VendorName))|| '%') "
End IfSorry guys english is not my first language and i will try to be clear and specific.
I have a search page where customeres can do searching either using a text box or two dropdowns i have on my page. they have the option of doing search either using a text box or dropdowns or both.Everything seems to work fine but if users does not leave the text box blank. but they leave the text box blank and do searching using the two dropdowns then the page comes up empty and i checked my query and i should get a value. Attacehed my code for you to look at it.
<pre>
Sub VendorSearch()
gvSearch.Visible = True
Dim MinPDate As String = drPur.SelectedItem.ToString
Dim MaxMDate As String = drPurM.SelectedItem.ToString
Dim liThisOne As ListItem
Dim strState As String = ""
For Each liThisOne In lstState.Items
If liThisOne.Selected Then
strState = strState & "'" & liThisOne.Value & "'" & ","
End If
Next
Dim Sql As String = " SELECT distinct V.VENDOR ""Vendor Id"",R.ADDRNUM,V.VNAMEL ""Vendor Name"",R.AADDR1,R.ACITY,R.VASST1, "
Sql = Sql & "R.ASTATE State,R.AZIPCODE, to_char(Max(P.DATEPUR),'YYYY/DD/MM') ""Plan Purchased Date"" , "
Sql = Sql & "TRIM (r.aaddr1 || decode(trim(r.aaddr2),null,'',' - ') || r.aaddr2) Address,"
Sql = Sql & " substr(decode(trim(r.vasst1),null, 'N/A','000/000-0000?','N/A','000/000-0000','N/A', r.vasst1),1,12) Fax, "
Sql = Sql & " substr(decode(trim(r.aphone),null, 'N/A','000/000-0000?','N/A', r.aphone),1,12)Phone "
Sql = Sql & "FROM VENDOR V,VENDADDR R, PLANHOLD P "
Sql = Sql & "WHERE V.VENDOR = R.VENDOR AND P.VENDOR = R.VENDOR "
Sql = Sql & " AND (P.DATEPUR >= TO_DATE('1999-01-01','YYYY-MM-DD')) "
Sql = Sql & "AND P.DATEPUR In ( select Max(P.DATEPUR) from PLANHOLD P where P.vendor = R.VENDOR) "
'If txtVendorName.Text <> "" Then
' Sql = Sql & " AND (Upper(V.VNAMEL) LIKE '%' || Trim(Upper(:VendorName))|| '%') "
'End If
If (strState.Length > 0 And lstState.SelectedIndex <> 0) Then
strState = Left(strState, strState.Length - 1)
strState = "(" & strState & ")"
Sql = Sql & "AND R.ASTATE IN " & strState
End If
If (drPur.SelectedIndex <> 0 And drPurM.SelectedIndex <> 0) Then
Sql = Sql & " AND to_number(to_char(p.datepur, 'YYYY')) between " & "'" & MinPDate & "'" & " AND " & "'" & MaxMDate & "'"
End If
' Dim Para As String
' SqlDataSource1.SelectParameters.
If Not txtVendorName.Text = "" Then
Sql = Sql & " AND (Upper(V.VNAMEL) LIKE '%' || Trim(Upper(:VendorName))|| '%') "
End If
'If Not IsDBNull(SqlDataSource1.SelectParameters(":VendorName")).val Then
' Sql = Sql & " AND (Upper(V.VNAMEL) LIKE '%' || Trim(Upper(:VendorName))|| '%') "
'End If
Sql = Sql & " AND V.VOBSOLET = 'N' "
Sql = Sql & "GROUP BY V.VENDOR, R.ADDRNUM,V.VNAMEL,R.AADDR1,R.AADDR2,R.ACITY,R.ASTATE, R.AZIPCODE, R.APHONE, R.VASST1, P.DATEPUR "
Sql = Sql & "ORDER BY V.VENDOR "
Response.Write("Sql " & "<br/>" & Sql & "<hr/>")
SqlDataSource1.SelectCommand = Sql
End Sub
</pre> -
How does APEX check for null values in Text Fields on the forms?
Hello all,
How does APEX check for null values in Text Fields on the forms? This might sound trivial but I have a problem with a PL/SQL Validation that I have written.
I have one select list (P108_CLUSTER_ID) and one Text field (P108_PRIVATE_IP). I made P108_CLUSTER_ID to return null value when nothing is selected and assumed P108_PRIVATE_IP to return null value too when nothign is entered in the text field.
All that I need is to validate if P108_PRIVATE_IP is entered when a P108_CLUSTER_ID is selected. i.e it is mandatory to enter Private IP when a cluster is seelcted and following is my Pl/SQL code
Declare
v_valid boolean;
Begin
IF :P108_CLUSTER_ID is NULL and :P108_PRIVATE_IP is NULL THEN
v_valid := TRUE;
ELSIF :P108_CLUSTER_ID is NOT NULL and :P108_PRIVATE_IP is NOT NULL THEN
v_valid := TRUE;
ELSIF :P108_CLUSTER_ID is NOT NULL and :P108_PRIVATE_IP is NULL THEN
v_valid := FALSE;
ELSIF :P108_CLUSTER_ID is NULL and :P108_PRIVATE_IP is NOT NULL THEN
v_valid := FALSE;
END IF;
return v_valid;
END;
My problem is it is returning FALSE for all the cases.It works fine in SQL Command though..When I tried to Debug and use Firebug, I found that Text fields are not stored a null by default but as empty strings "" . Now I tried modifying my PL/SQL to check Private_IP against an empty string. But doesn't help. Can someone please tell me how I need to proceed.
ThanksSee SQL report for LIKE SEARCH I have just explained how Select list return value works..
Cheers,
Hari -
How to check for null values in pl sql?
Hello,
I have an sql statement where I read the db column into a number of variables, some of the columns contain NULL values or empty varchars. How can I check if my variable contains any data?
Thanks,
Jto check if your variable contain null or not use like this
if v_variable is null if you use
if v_variable=NULL this is right according to syntax but it will not give you desired result
SQL> declare
2 v_empname varchar2(20);
3 v_comm number;
4 begin
5 select ename,comm into v_empname,v_comm from emp
6 where empno=7839 and comm is NULL;
7 dbms_output.put_line(v_empname);
8 if v_comm is NULL then
9 dbms_output.put_line(v_empname);
10 end if;
11 end;
12 /
KING
KING
PL/SQL procedure successfully completed.but if you will use = null then you will not get result
SQL> declare
2 v_empname varchar2(20);
3 v_comm number;
4 begin
5 select ename,comm into v_empname,v_comm from emp
6 where empno=7839 and comm is NULL;
7 dbms_output.put_line(v_empname);
8 if v_comm = NULL then
9 dbms_output.put_line(v_empname);
10 end if;
11 end;
12 /
KING -------------king will get printed only once.
PL/SQL procedure successfully completed. -
How to check for null values in bpel?? Please Help! very urgent!!!
Hello Guys,
I have a problem. I have an external webservice to which I have to post my request. My task is to create an Webservice and Service Assembly to which others would post request and get response. I have to create SA to deploy onto the bus.
The problem is that there are optional elements in the request and response xsd's. In the Response sometimes certain feilds may come or they may not. for Example:- my response could contain a tag like this <firstName></firstName>
I have to copy these feilds in my bpel process from one variable to another.(like in the mapper).
My Question is , Is there any way in BPEL process or BPEL mapper where I could Check for null values in the request or response???
Your inputs would be very helpful.
Thanks
RajeshThanks for replying man :)
Ok I will be more clear.
Here is a snippet of one of the xsd's that I am using.
<xs:element name="returnUrl" nillable="false" minOccurs="0">
<xs:annotation>
<xs:documentation>Partner specifies the return URL to which responses need to be sent to, in case of
Async message model.
</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:anyURI">
<xs:maxLength value="300"/>
<xs:whiteSpace value="collapse"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
This means that the return URL field can be there or it may not be there. But if it is there it cant be null because nillable=false. But the whole <returnURL> </returnURL> can be there or it may not be there because minOccurs=0.
My requirement is , if returnURL is there in the response with a value, then in my BPEL mapper I should map it else I should not map it.
Thats the issue.
and Yes kiran, the node be non-existant.
So can you please help me with this.
Thanks
Rajesh -
Checking for null value in arraylist
Hi
i have an excel file which i i am reading into an arraylist row by row but not necesarrily that all columns in the row mite be filled. So how do i check for null values in the array list.
try
int cellCount = 0;
int emptyRow = 0;
HSSFWorkbook workbook = new HSSFWorkbook(new FileInputStream(file));
HSSFSheet sheet = workbook.getSheetAt(0);
Iterator rows = sheet.rowIterator();
myRow = new ArrayList();
int r = 1;
while (rows.hasNext())
System.out.println("Row # " + r);
HSSFRow row = (HSSFRow) rows.next();
Iterator cells = row.cellIterator();
cellCount = 0;
boolean isValid = false;
while (cells.hasNext())
HSSFCell cell = (HSSFCell) cells.next();
switch (cell.getCellType())
case HSSFCell.CELL_TYPE_NUMERIC:
double num = cell.getNumericCellValue();
DecimalFormat pattern = new DecimalFormat("###,###,###,###");
NumberFormat testNumberFormat = NumberFormat.getNumberInstance();
String mob = testNumberFormat.format(num);
Number n = null;
try
n = pattern.parse(mob);
catch ( ParseException e )
e.printStackTrace();
System.out.println(n);
myRow.add(n);
//myRow.add(String.valueOf(cell.getNumericCellValue()).trim());
//System.out.println("numeric: " +cell.getNumericCellValue());
break;
case HSSFCell.CELL_TYPE_STRING:
myRow.add(cell.getStringCellValue().trim());
System.out.println("string: " + cell.getStringCellValue().trim());
break;
case HSSFCell.CELL_TYPE_BLANK:
myRow.add(" ");
System.out.println("add empty:");
break;
} // end switch
cellCount++;
} // end while
r++;
}// end while
} myRow is the arrayList i am adding the cells of the excel file to. I have checked for blank spaces in my coding so please help with how to check for the black spaces that has been added to my arraylist.
I have tried checking by looping through the ArrayList and then checking for null values like this
if(myRow.get(i)!=null)
// do something
// i have tried this also
if(myRow.get(i)!="")
//do something
}Edited by: nb123 on Feb 3, 2008 11:23 PMFrom your post I see you are using a 3rd party package to access the Excel SpreadSheets, you will have to look in your API for you 3rd party package and see if there is a method that will identify a blank row, if there is and it does not work, then you have to take that problem up with them. I know this is a pain, but it is the price we pay for 3rd party object use.
In the mean time, you can make a workaround by checking every column in your row and seeing if it is null, or perhaps even better: check and see if the trimmed value of each cell has a lenth of 0. -
Hi,
I have a table with columns a1, a2, a3, a4 and a5. The column a1 is the primary key for the table. I want to check if all the other columns except a1 have null values. How can I do that?
Thanks,
MachaanFor fun;
select a1,
a2,
a3,
a4,
a5,
nvl2(a2, 0,1) + nvl2(a3, 0,1) + nvl2(a4, 0,1) + nvl2(a5, 0,1) num_nulls
from sample_data;
A1 A2 A3 A4 A5 NUM_NULLS
1 2 3
2 4
3 4 3
4 4 4 2
5 2 3
6 -2 3
7 1 2 3 4 0
8 -1 -2 -3 -4 0
Maybe you are looking for
-
Hi, WebCenter consists of multiple parts (framework, services, composer, ...). Do I need WebCenter license when I only use the framework and composer functionality but no pre-build webcenter service (like wiki, blog, email, ...)? regards Peter
-
How to dial the plus sign in front of the phone number when dialing abroad
iPhone 5: When dialling a phone number, the + sign is inactive, and I cannot phone abroad unless I write the number in Contacts, or know the number code of my operator. Is there another way ?
-
Problem to compile .java class
hi, i'm using/creating a package of classes....and as per my knowledge there is no need to write explicit import if u r importing/using an instance of class1 in other class2 in the same package..... I'm doing the same..... but the problem arrises her
-
Is Buddy API baSetDisplay working in Director 11.5 under Windows 7?
Hello, I'm trying to update some of my old games. The "baSetDisplay" of Buddy API is not working under Windows 7 in Director 11.5 Did someone had made it working? Any solution to change resolution to have a fullscreen game? Thanks Sebastien
-
Upgrading Photoshop Touch to ver 1.4?
I have just got myself a new Galaxy Note 10.1 with Photoshop touch pre installed. This was one of it's selling points due to the Note's S-Pen and i have been very happy with the Adobe product The only trouble is, it is only version 1.2 and i see no w