Bug: 1st Date value returned from CF function as an Array
I am encountering an annoying behavior in Flex. I call a CF function to return a query into an arraycollection - very basic. If the SELECT statement in the CF function includes any dates as returned values, the first date in the SELECT statement comes back into Flex as an array object that includes all of the fields in the query. The other dates are returned normally as Date data types.
This started happening a month or two ago, and I've reproduced it on several machines. Needless to say, it is causing numerous errors when my code excpects a Date and gets an Array.
Do you have any ideas of what might be causing this and what I can do about it?
Thanks!!
I'm not sure where to post it, but here are some snippets:
in the cfc, I have a function as such:
<CFFUNCTION name="GetPersonLog" returntype="query">
<CFARGUMENT name="STUDENTID" type="numeric" required="Yes">
<CFQUERY name="qry" datasource="#connection_string#">
SELECT tblStudentLog.STUDENTLOGID, tblStudentLog.STUDENTID,
<!---GETDATE() AS TESTTHIS,--->
tblStudentLog.LOGDATE,
tblStudentLog.LASTUPDATED,
tblStudentLog.LOGENTRY
FROM tblStudentLog LEFT OUTER JOIN
tblStudentDiscipline ON tblStudentLog.StudentDisciplineID = tblStudentDiscipline.StudentDisciplineID
WHERE tblStudentLog.STUDENTID = <CFQUERYPARAM value = "#studentid#">
ORDER BY tblStudentLog.LOGDATE DESC
</CFQUERY>
<CFRETURN qry>
</CFFUNCTION>
You see I have a REMmed out line to get a test date. If I check the results in CF using cfdump, all dates come back as dates.
In flex, the handler for the call to this function is simple:
private function PersonLogHandler(event:ResultEvent):void{
personlog = event.result as ArrayCollection;
CursorManager.removeBusyCursor();}
If I stop the code here and evaluate the results in debug mode, I find that the LOGDATE result is an array of values, while the LASTUPDATED field is a date.
If I put back the GETDATE() AS TESTTHIS, statement in the cfc function, then the result includes LOGDATE as a date object, but now the TESTTHIS result is an array.
I have experienced this on 2 different machines, and it has brought my development to a standstill. I can't thin of what changed to start these problems, except that I am now using the FlashPlayer 10 (with debugger). This happens in Firefox and IE. I am using FlexBuilder 3 and Coldfusion 8.
Similar Messages
-
How to compare a boolean value returned from a function in a sql query
Hi all
i have a function which return boolean true or false.
mean while i am writing a sql query which should check this function and will return a result set only when it is true. how will i use a function which returns boolean in a sql query..
thanks in advance'
HariI don't think this is possible - i'm not sure. Can you post your function script? The reason why am i asking this is --
satyaki>set serveroutput on
satyaki>
satyaki>
satyaki>
satyaki>create or replace function test_satf(emno in number)
2 return boolean
3 is
4 v_cnt number(5);
5 v_flg boolean;
6 begin
7 select count(*)
8 into v_cnt
9 from emp
10 where empno = emno;
11
12 if v_cnt = 1 then
13 v_flg := TRUE;
14 else
15 v_flg := FALSE;
16 end if;
17
18 return v_flg;
19 exception
20 when others then
21 v_flg := FALSE;
22 return v_flg;
23 end;
24 /
Function created.
satyaki>
satyaki>
satyaki>
satyaki>
satyaki>
satyaki>desc emp;
Name Null? Type
EMPNO NOT NULL NUMBER(4)
ENAME VARCHAR2(10)
JOB VARCHAR2(9)
MGR NUMBER(4)
HIREDATE DATE
SAL NUMBER(7,2)
COMM NUMBER(7,2)
DEPTNO NUMBER(2)
satyaki>
satyaki>
satyaki>
satyaki>select count(*) from emp;
COUNT(*)
14
satyaki>
satyaki>select empno,test_satf(empno)
2 from emp;
select empno,test_satf(empno)
ERROR at line 1:
ORA-06552: PL/SQL: Statement ignored
ORA-06553: PLS-382: expression is of wrong type
satyaki>select to_char(test_satf(empno))
2 from emp;
select to_char(test_satf(empno))
ERROR at line 1:
ORA-06552: PL/SQL: Statement ignored
ORA-06553: PLS-382: expression is of wrong type
satyaki>
satyaki>create or replace function test_satf(emno in number)
2 return varchar2
3 is
4 v_cnt number(5);
5 v_flg varchar2(10);
6 begin
7 select count(*)
8 into v_cnt
9 from emp
10 where empno = emno;
11
12 if v_cnt = 1 then
13 v_flg := 'TRUE';
14 else
15 v_flg := 'FALSE';
16 end if;
17
18 return v_flg;
19 exception
20 when others then
21 v_flg := 'FALSE';
22 return v_flg;
23 end;
24 /
Function created.
satyaki>
satyaki>
satyaki>select test_satf(empno)
2 from emp;
TEST_SATF(EMPNO)
TRUE
TRUE
TRUE
TRUE
TRUE
TRUE
TRUE
TRUE
TRUE
TRUE
TRUE
TEST_SATF(EMPNO)
TRUE
TRUE
TRUE
14 rows selected.Or, may be i'm missing something.
Regards.
Satyaki De. -
I am currently testing our website with CF11. It is currently working with CF8 however after migrating it to a new server running CF11 I have encountered the following error.
The value returned from the load function is not of type numeric.
The error occurred in
D:/Applications/CFusion/CustomTags/nec/com/objects/address.cfc: line 263
Called from D:/Applications/CFusion/CustomTags/nec/com/objects/contact.cfc: line 331
Called from D:/Applications/CFusion/CustomTags/nec/com/objects/user.cfc: line 510
Called from D:/Applications/CFusion/CustomTags/nec/com/objects/user.cfc: line 1675
Called from D:/website/NECPhase2/action.validate.cfm: line 54
261 : <cfif isNumeric(get.idCountry)>
262 : <cfset rc = this.objCountry.setID(get.idCountry)>
263 : <cfset rc = this.objCountry.load()>
264 : </cfif>
265 : <cfset this.sPostcode = get.sPostcode>
Have there been any changes between CF8 and CF11 that could cause this error?
Does anyone have ideas?This is the code in file object file country.cfc (nec.com.objects.country):
<cfcomponent displayname="Country object" hint="This is a Country object, it allows you to access and set values in the Country.">
<!---
// Construct this object
--->
<cfset this.objFunctions = CreateObject( 'component', 'nec.com.system.functions' )>
<cfscript>
this.idCountryID = 0;
this.sCountryName = "";
this.sISOCode = "";
this.sDHLCode = "";
this.iErrorID = "";
</cfscript>
<!---
// The following functions are the setters and getters. offering us a better way to get
// at the contents of the object
--->
<!---
// Getters
--->
<cffunction name="getID" displayname="Get ID" returntype="numeric" output="false" hint="This returns the ID of the current item.">
<cfreturn this.idCountryID>
</cffunction>
<cffunction name="getsCountryName" displayname="Get sCountryName" returntype="string" output="false" hint="This gets the sCountryName value of this item.">
<cfreturn this.sCountryName>
</cffunction>
<cffunction name="getsISOCode" displayname="Get sISOCode" returntype="string" output="false" hint="This gets the sISOCode value of this item.">
<cfreturn this.sISOCode>
</cffunction>
<cffunction name="getsDHLCode" displayname="Get sDHLCode" returntype="string" output="false" hint="This gets the sDHLCode value of this item.">
<cfreturn this.sDHLCode>
</cffunction>
<cffunction name="iError" displayname="Get iError" returntype="numeric" output="false" hint="This returns the iError of the current item.">
<cfreturn this.iError>
</cffunction>
<!---
// Setters
--->
<cffunction name="setID" displayname="Set ID" returntype="boolean" output="false" hint="This sets the ID value of this item.">
<cfargument name="idCountryID" required="true" type="numeric" displayname="ID" hint="The ID to use.">
<cfset this.idCountryID = arguments.idCountryID>
<cfreturn true>
</cffunction>
<cffunction name="setsCountryName" displayname="Set sCountryName" returntype="boolean" output="false" hint="This sets the sCountryName value of this item.">
<cfargument name="sCountryName" required="true" type="string" displayname="sCountryName" hint="The sCountryName to use.">
<cfset this.sCountryName = arguments.sCountryName>
<cfreturn true>
</cffunction>
<cffunction name="setsISOCode" displayname="Set sISOCode" returntype="boolean" output="false" hint="This sets the sISOCode value of this item.">
<cfargument name="sISOCode" required="true" type="string" displayname="sISOCode" hint="The sISOCode to use.">
<cfset this.sISOCode = arguments.sISOCode>
<cfreturn true>
</cffunction>
<cffunction name="setsDHLCode" displayname="Set sDHLCode" returntype="boolean" output="false" hint="This sets the sDHLCode value of this item.">
<cfargument name="sDHLCode" required="true" type="string" displayname="sDHLCode" hint="The sDHLCode to use.">
<cfset this.sDHLCode = arguments.sDHLCode>
<cfreturn true>
</cffunction>
<!---
// Clear, to empty out the contents of this object
--->
<cffunction name="clear" displayname="Clear items Details" returntype="boolean" output="false" hint="Clears out all of the items details.">
<cfscript>
this.sCountryName = "";
this.sISOCode = "";
this.sDHLCode = "";
this.iErrorID = "";
</cfscript>
<cfreturn true>
</cffunction>
<!---
// The following functions deal with the load, save and deleting of objects
--->
<!---
// Load
--->
<cffunction name="load" displayname="Load items details" returntype="numeric" output="false" hint="This loads in all the information about an item.">
<cfset rc = this.clear()>
<!---
// First of all we need to get the name of the data source we are going to be using
--->
<cfscript>
objDS = CreateObject("component","nec.com.system.settings");
sDatasource = objDS.getDatasource();
</cfscript>
<!---
// Check to see if it exists
--->
<cftry>
<cfquery name="checkID" datasource="#sDatasource#">
SELECT idCountryID
FROM tblCountry
WHERE idCountryID = #this.idCountryID#
</cfquery>
<cfcatch>
<cfscript>
objError = CreateObject("component","nec.com.system.errors");
iErrorID = objError.addError("load: checkID: '#this.idCountryID#' #cfcatch.detail#");
</cfscript>
<cfset this.iErrorID = iErrorID>
<cfreturn iErrorID>
</cfcatch>
</cftry>
<cfif not checkID.recordCount>
<cfscript>
objError = CreateObject("component","nec.com.system.errors");
if(isDefined("session.afr")){
whichOne = "#session.afr.getsAFRNumber()#";
} else {
whichOne = "";
iErrorID = objError.addError("A Country with that id doesn't exists.[#this.idCountryID#][#whichOne#]");
</cfscript>
<cfset this.iErrorID = iErrorID>
<cfreturn iErrorID>
</cfif>
<!---
// If we got past all then then load in the details
--->
<cftry>
<cfquery name="get" datasource="#sDatasource#">
SELECT idCountryID, RTRIM(sCountryName) as sCountryName, RTRIM(sISOCode) as sISOCode, RTRIM(sDHLCode) as sDHLCode
FROM tblCountry
WHERE idCountryID = #this.idCountryID#
</cfquery>
<cfcatch>
<cfscript>
objError = CreateObject("component","nec.com.system.errors");
iErrorID = objError.addError("load: get: #cfcatch.detail#");
</cfscript>
<cfset this.iErrorID = iErrorID>
<cfreturn iErrorID>
</cfcatch>
</cftry>
<cfset this.idCountryID = get.idCountryID>
<cfset this.sCountryName = get.sCountryName>
<cfset this.sISOCode = get.sISOCode>
<cfset this.sDHLCode = get.sDHLCode>
<cfset this.iErrorID = "">
<cfreturn true>
</cffunction>
<!---
// Save
--->
<cffunction name="save" displayname="Save items Details" returntype="numeric" output="false" hint="Saves (to some source) the current details for the ID of the item.">
<!---
// First of all we need to get the name of the data source we are going to be using
--->
<cfscript>
objDS = CreateObject("component","nec.com.system.settings");
sDatasource = objDS.getDatasource();
</cfscript>
<!---
// Now check to see if ithat ID exists
--->
<cftry>
<cfquery name="checkID" datasource="#sDatasource#">
SELECT idCountryID
FROM tblCountry
WHERE idCountryID = #this.idCountryID#
</cfquery>
<cfcatch>
<cfscript>
objError = CreateObject("component","nec.com.system.errors");
iErrorID = objError.addError("save: checkID: #cfcatch.detail#");
</cfscript>
<cfreturn iErrorID>
</cfcatch>
</cftry>
<!---
// If it doesn't exist, then add the record, otherwise update the record
--->
<cfif not checkID.recordCount>
<cfreturn this.add()>
<cfelse>
<cfreturn this.update()>
</cfif>
</cffunction>
<!---
// Add
--->
<cffunction name="add" displayname="Add Country" returntype="numeric" output="false" hint="This adds a Country.">
<!---
// Check to see if that a different item isn't already using the same unique details
--->
<cftry>
<cfquery name="checkUnique" datasource="#sDatasource#">
SELECT idCountryID
FROM tblCountry
WHERE sCountryName = '#this.objFunctions.scrubText(this.sCountryName)#'
OR sISOCOde = '#this.objFunctions.scrubText(this.sISOcode)#'
</cfquery>
<cfcatch>
<cfscript>
objError = CreateObject("component","nec.com.system.errors");
iErrorID = objError.addError("add: checkUnique: #cfcatch.detail#");
</cfscript>
<cfreturn iErrorID>
</cfcatch>
</cftry>
<cfif checkUnique.recordCount>
<cfscript>
objError = CreateObject("component","nec.com.system.errors");
iErrorID = objError.addError("A Country with that name or ISO code already exists. idCountryID=#checkUnique.idCountryID#");
</cfscript>
<cfreturn iErrorID>
</cfif>
<cftry>
<cfquery name="add" datasource="#sDatasource#">
SET nocount on
INSERT INTO tblCountry(sCountryName, sISOCode, sDHLCode)
VALUES('#this.objFunctions.scrubText(this.sCountryName)#','#this.objFunctions.scrubText(t his.sISOCode)#','#this.objFunctions.scrubText(this.sDHLCode)#')
SELECT @@identity as autoID
SET nocount off
</cfquery>
<cfcatch>
<cfscript>
objError = CreateObject("component","nec.com.system.errors");
iErrorID = objError.addError("add: add: #cfcatch.detail#");
</cfscript>
<cfreturn iErrorID>
</cfcatch>
</cftry>
<cfreturn add.autoID>
</cffunction>
<!---
// Update
--->
<cffunction name="update" displayname="Update Country" returntype="numeric" output="false" hint="This updates a Country record.">
<!---
// Check to see if that a different item isn't already using the same unique details
--->
<cftry>
<cfquery name="checkUnique" datasource="#sDatasource#">
SELECT idCountryID
FROM tblCountry
WHERE (sCountryName = '#this.objFunctions.scrubText(this.sCountryName)#'
OR sISOCOde = '#this.objFunctions.scrubText(this.sISOcode)#')
AND idCountryID <> #this.idCountryID#
</cfquery>
<cfcatch>
<cfscript>
objError = CreateObject("component","nec.com.system.errors");
iErrorID = objError.addError("update: checkUnique: #cfcatch.detail#");
</cfscript>
<cfreturn iErrorID>
</cfcatch>
</cftry>
<cfif checkUnique.recordCount>
<cfscript>
objError = CreateObject("component","nec.com.system.errors");
iErrorID = objError.addError("Another Country with that name already exists. idCountryID=#checkUnique.idCountryID#");
</cfscript>
<cfreturn iErrorID>
</cfif>
<!---
// Attempt to update the record to the datasource
// if this fails for any reason then we submit an error message
// to the error component and return the ID of the error
--->
<cftry>
<cfquery name="update" datasource="#sDatasource#">
UPDATE tblCountry
SET sCountryName = '#this.objFunctions.scrubText(this.sCountryName)#',
sISOCode = '#this.objFunctions.scrubText(this.sISOCode)#',
sDHLCode = '#this.objFunctions.scrubText(this.sDHLCode)#'
WHERE idCountryID = #this.idCountryID#
</cfquery>
<cfcatch>
<cfscript>
objError = CreateObject("component","nec.com.system.errors");
iErrorID = objError.addError("update: update: #cfcatch.detail#");
</cfscript>
<cfreturn iErrorID>
</cfcatch>
</cftry>
<cfreturn this.idCountryID>
</cffunction>
<!---
// Delete
--->
<cffunction name="delete" displayname="Delete Country" returntype="numeric" output="false" hint="This deletes a Country record.">
<!---
// First of all we need to get the name of the data source we are going to be using
--->
<cfscript>
objDS = CreateObject("component","nec.com.system.settings");
sDatasource = objDS.getDatasource();
</cfscript>
<!---
// Now check to see if ithat ID exists
--->
<cftry>
<cfquery name="checkID" datasource="#sDatasource#">
SELECT idCountryID
FROM tblCountry
WHERE idCountryID = #this.idCountryID#
</cfquery>
<cfcatch>
<cfscript>
objError = CreateObject("component","nec.com.system.errors");
iErrorID = objError.addError("delete: checkID: #cfcatch.detail#");
</cfscript>
<cfreturn iErrorID>
</cfcatch>
</cftry>
<cfif not checkID.recordCount>
<cfscript>
objError = CreateObject("component","nec.com.system.errors");
iErrorID = objError.addError("A Country with that id doesn't exists, delete failed.");
</cfscript>
<cfreturn iErrorID>
</cfif>
<!---
// Now check to see if there are any dependancies, if so we can't delete the item
--->
<cftry>
<cfquery name="checkDependancies" datasource="#sDatasource#">
SELECT idCountry
FROM tblAddress
WHERE idCountry = #this.idCountryID#
</cfquery>
<cfcatch>
<cfscript>
objError = CreateObject("component","nec.com.system.errors");
iErrorID = objError.addError("delete: checkDependancies: idCountry: #cfcatch.detail#");
</cfscript>
<cfreturn iErrorID>
</cfcatch>
</cftry>
<cfif checkDependancies.recordCount>
<cfscript>
objError = CreateObject("component","nec.com.system.errors");
iErrorID = objError.addError("That Country is being used by an address, delete failed.");
</cfscript>
<cfreturn iErrorID>
</cfif>
<!---
// Now attempt to remove the record.
// if this fails for any reason then we submit an error message
// to the error component and return the ID of the error
--->
<cftry>
<cfquery name="delete" datasource="#sDatasource#">
DELETE FROM tblCountry
WHERE idCountryID = #this.idCountryID#
</cfquery>
<cfcatch>
<cfscript>
objError = CreateObject("component","nec.com.system.errors");
iErrorID = objError.addError("delete: delete: #cfcatch.detail#");
</cfscript>
<cfreturn iErrorID>
</cfcatch>
</cftry>
<cfreturn this.idCountryID>
</cffunction>
</cfcomponent> -
Can I use the value returned from a Text Function in another Formula?
I'm writing a report in Hyperion System 9 BI + Financial Reporting Studio version 9.2. I have 2 grids in my report.
Grid1 Column A is set up as a text function using the function type - <<GetCell("Grid2", 1, a, 1)>>. I would like to use the values returned from this text function in Column A (Grid 1) in a formula in Column B (Grid 1).
Is it possible to use the values returned in Column A of the text function in another formula? My report does not seem to recognize Column A as numerical values, even though the values to be returned are numerical.
If so, how do I recognize the values in Column A Grid 1 as numerical values and not text?
Thanks for any help you can offer!Hi Edson,
Yes you need to use the CALC_ERROR macro function to be able to test whether the last macro function returned an error. CALC_ERROR will return an 'X' if there an error occured during the execution of the last macro function.
You can use a macro similar to the following:
IF
CALC_ERROR( )
= 'X'
DO SOMETHING HERE
ENDIF
Let me explain how this works internally. The SAP system maintains a global variable g_flg_calc_error during the execution of macros in the planning book. The g_flg_calc_error variable will contain the value of f_calc_error that was set by the last macro function which executed. The ABAP coding of a planning book is something like this:
data: g_flg_calc_error type /SAPAPO/FLAG.
* SAP will pass g_flg_calc_error variable to all macro
* functions. When SAP calls a macro function, it does
* something like this.
call function '/SAPAPO/MACRO_FUNCTION_HERE'
exporting
plob_values = i_s_adv_plob_values
sdp_book = g_c_advf_sdp_book
sdp_view = g_c_advf_sdp_view
tables
cols_index = i_t_cols
value_tab = l_t_value_tab
changing
f_calc_error = g_flg_calc_error
As you can see, the g_flg_calc_error variable
is passed in the "changing" part of the call. The macro function being called can then use the f_calc_error
variable to change the value of the global
g_flg_calc_error variable. In fact, the macro function being called can also check (by looking at the f_calc_error variable) if the last macro function reported an error. The CALC_ERROR macro function just checks the value of f_calc_error parameter (w/c in fact is the value of the g_flg_calc_error variable) and returns "true/X" if the f_calc_error was set to true by the last macro function.
Hope this helps in clearing things out -
How to get the values returned by a function in a drop down?
Hi All,
Can anyone please help in getting the values returned by a function into a drop down? I have a java class file where in i have written a function called getWeeks() which give all the week dates and i want to display these week dates in a drop down box in a JSP page.
Please help me in this regard.
Thanks in Advance!!
Lakshman.Hi Lakshman,
the following code can help you do what you want :
<hbj:dropdownListBox id="calendar" tooltip="Calendar" selection="<%= selected %>">
<%
String[] weeks = myObjectBean.getWeeks();
for (int i = 0; i < weeks.length; i++) {
%>
<hbj:listBoxItem key="<%= i %>" value="<%= weeks<i> %>"/>
<%
%>
</hbj: dropdownListBox>
The <%= selected %> snippet allows you to pre-select one of the options (provided that the variable 'selected' is equal to one of the listBoxItem keys).
You can also add onSelect to the tag (e.g. = "setSelectedItem"). It corresponds to a method in the corresponding JSPDynPage class. This means that when you select another item in the dropdown list, the method in your Java class is performed (allowing you to save the selected value and performing actions with it)
I hope this helped you enough,
kind regards,
Frederic
Edited seven times by: Frederic Taes on Nov 5, 2008 11:24 AM -> the onSelect element was in the hbj tag and in the text with "='setSelectedItem'" next to it and when I tried to post my message, I got a 501 error all the time ! Seems like a SDN bug to me ... -
Reading User Profile Properties pragmatically in SharePoint 2010 Returns Null Values Although it has values returned from AD
I configured the user profile service application and run Sync and user profiles and its properties returned from Active directory but when I want to read it pragmatically it returns null values.
this is my code...
void runQueryButton_Click(object sender, EventArgs e)
// Get the My Sites site collection, ensuring proper disposal
using (SPSite mySitesCollection = new SPSite("http://sp/my"))
//Get the user profile manager
SPServiceContext context = SPServiceContext.GetContext(mySitesCollection);
UserProfileManager profileManager = new UserProfileManager(context);
UserProfile profile = profileManager.GetUserProfile("Contoso\\user");
foreach (Property prop in profileManager.Properties)
// if (prop.Name == "Department")
resultsLabel.Text += prop.DisplayName + ":" + profile[prop.Name].Value + "<br />"; ;Hi,
Please try with the following code
PrincipalContext principalContext = new PrincipalContext(ContextType.Domain);
SPServiceContext context = SPServiceContext.GetContext(site);
UserProfileManager profileManager = new UserProfileManager(context);
foreach (Property prop in profileManager.Properties)
// if (prop.Name == "Department")
resultsLabel.Text += prop.DisplayName
+ ":" + profile[prop.Name].Value + "<br />"; ;
Thanks,
Vivek
Please vote or mark your question answered, if my reply helps you -
DATE type returned from function does not return the time component
Hi,
I'm dealing with a strange problem. I have a PL/SQL function (running on Oracle 8.1.4.7) which returns a DATE value. Like we all know the DATE datatype includes a date component and a time component.
The function I used for testing is like this:
FUNCTION ReturnDate return Date is
dReturn Date;
Begin
select sysdate into dReturn from dual;
return dReturn;
end ReturnDate;
When I call this function from .NET using ODP.NET the date value I get does not have the time component included only the day-month-year components.
This is a code-snippet that calls the function :
command.CommandText="Schema.ReturnDate";
command.CommandType=CommandType.StoredProcedure;
command.Parameters.Add("Return_Value",
OracleDbType.Date,0,ParameterDirection.ReturnValue);
command.ExecuteNonQuery();
I use the OracleDbType.Date type which I think is the most logical choice, because the type in the Database is after all DATE.
However this does not include the time componet. But if I change the OracleDbType.Date to OracleDbType.TimeStamp I get the time component. I'm not happy with this "hack" because I'm not sure what will happen when we upgrade our version of the Database to Oracle 9i which uses the new TimeStamp datatype.
Is this a bug that the OracleDbType.Date does not include the time component??How do you examine the output Date value?
If it is from the string, then the time components will
not show because the NLS_DATE format in the client
machine does not contain the time components.
In American, the Date format is 'DD-MON-RR' by default whereas, the TimeStamp format is 'DD-MON-RR HH.MI.SSXFF AM' by default.
Can you take a look at the time components from the OracleDate by accessing the time properties, eg. OracleDate.Hour, OracleDate.Minute..etc to see if the time values are there?
Thanks
Martha -
Assigning value returned from RFC call to a global variable
If I have an RFC call to SAP how can I assign the value returned to a global variable on my data services job?
Hi,
For now, it seems u haven't specified the destination properly. the call function statement must be suffixed with the 'destination' addition to make sure that the function call is an RFC and the particular function be executed at the desired destination. -
Exiting from SQLPLUS on failure returned from a function
I am working on Oracle 11g (R2). I want to call a function in package and if that function returns zero then I want to quit/exit from SQLPLUS prompt.
I will be calling that function of package from an .sql file.
How can i do this?
I can also call raise_application_error() from that function. Without using WHENEVER SQLERROR EXIT, is there any way of doing this?Thanks, but if i am calling that function from a .sql file, can i verify the return value and exit from sqlplus prompt.
-
How to use value returned from a bean in jsp page
Hi All,
I have a string array value being returned from a javabean to a jsp page. I want to be able to assign the value to a variable in the jsp page.
How do I do this?
Many thanks :)thanks for your response.
I actually used something like this:
<% String loggedin = log.User(user,password);
out.println(loggedin);
%>i am not yet as much of an expert on beans as i would like to be, but i thought it is not really a bean if it has a getter method which takes arguments? -
XMLAttribute unable to handle multiple values returning from a query
Hi Guys,
I have to design the format of the data returning from a query in XML. For this i have used xmlelement and xmlattribute
the query goes like this
SELECT '<?xml version="1.0" ?>'||' '||XMLELEMENT("imageData",
XMLATTRIBUTES(LI.GROUPNO as "imageName", 'PNG'as "imageType", '2.0' as "version", 'com.snapon.sbs' as "xmlns"),
XMLELEMENT("callouts",
XMLATTRIBUTES('roundedRectangle' as "shape"),
XMLELEMENT("callout",
XMLATTRIBUTES((SELECT IO.PNC_KEYNO FROM PFEALIOCR IO WHERE IO.BASECATALOGNO = LI.BASECATALOGNO AND LI.GROUPNO = IO.GROUPNO) as "label"),
XMLELEMENT("point",
XMLATTRIBUTES((SELECT IO.COORDINATESX1 FROM PFEALIOCR IO WHERE IO.BASECATALOGNO = LI.BASECATALOGNO AND LI.GROUPNO = IO.GROUPNO) as "x",(SELECT IO.COORDINATESY1 FROM PFEALIOCR IO WHERE IO.BASECATALOGNO = LI.BASECATALOGNO AND LI.GROUPNO = IO.GROUPNO) as "y")))))
FROM PFEALIGIL LI
WHERE LI.DELETEFLAG <> 'D'
here he logic is the one groupno from pfealigil and the corresponding pnc_keyno that are related to groupno are fetched here. but here since multiple pnc_keyno are returning xmlattributes is unable to handle. I want to design the xml in this format
<?xml version="1.0" ?>
<imageData imageName="ISDH0001104"
imageType="PNG" version="2.0" xmlns="com.snapon.sbs">
<callouts shape="roundedRectangle">
<callout label="182">
<point x="289" y="68"/>
</callout>
<callout label="247"<point x="430" y="83"/>
</callout>
<callout label="122"><point x="546" y="331"/>
</callout>
<callout label="249"><point x="402" y="429"/>
</callout>
<callout label="248"><point x="392" y="463"/>
</callout>
<callout label="182"><point x="228" y="416"/>
</callout>
<callout label="1"><point x="364" y="737"/>
</callout>
<callout label="14"><point x="494" y="980"/>
</callout>
<callout label="168"><point x="671" y="910"/>
</callout>
<callout label="15"><point x="779" y="848"/>
</callout>
<callout label="1"><point x="805" y="343"/>
</callout>
</callouts>
</imageData>
like here one image name all those pnc_keyno that are valid should come in this way as above. Please let me know if anything is unclear to youapexStarter wrote:
Data model goes like thisYou mentioned two tables in your first post, but I guess it's just a matter of joining them to get the above resultset?
In this case you can do it like this :
SQL> WITH sample_data AS (
2 SELECT '91-921' groupno, '1125AE' pnc_keyno, 000000127 coordinatesx1, 000000730 coordinatesy1 FROM dual UNION ALL
3 SELECT '91-921', '18642F', 000000513, 000000891 FROM dual UNION ALL
4 SELECT '91-921', '18643D', 000000620, 000000844 FROM dual UNION ALL
5 SELECT '91-921', '18649E', 000000561, 000000688 FROM dual UNION ALL
6 SELECT '91-921', '18668B', 000000620, 000000864 FROM dual UNION ALL
7 SELECT '91-921', '92101A', 000000587, 000000591 FROM dual UNION ALL
8 SELECT '91-921', '92102A', 000000587, 000000571 FROM dual UNION ALL
9 SELECT '91-924', '1243BD', 000000617, 000000889 FROM dual
10 )
11 SELECT XMLRoot(
12 XMLElement("imageData",
13 XMLAttributes(
14 groupno as "imageName"
15 , 'PNG'as "imageType"
16 , '2.0' as "version"
17 , 'com.snapon.sbs' as "xmlns"
18 )
19 , XMLElement("callouts",
20 XMLAttributes('roundedRectangle' as "shape")
21 , XMLAgg(
22 XMLElement("callout",
23 XMLAttributes(pnc_keyno as "label")
24 , XMLElement("point",
25 XMLAttributes(
26 coordinatesx1 as "x"
27 , coordinatesy1 as "y"
28 )
29 )
30 )
31 )
32 )
33 )
34 , version '1.0'
35 )
36 FROM sample_data
37 GROUP BY groupno
38 ;
XMLROOT(XMLELEMENT("IMAGEDATA",XMLATTRIBUTES(GROUPNOAS"IMAGENAME",'PNG'AS"IMAGETYPE",'2.0'AS"VERSION",'COM.SNAPON.SBS'AS
<?xml version="1.0"?>
<imageData imageName="91-921" imageType="PNG" version="2.0" xmlns="com.snapon.sbs">
<callouts shape="roundedRectangle">
<callout label="1125AE">
<point x="127" y="730"/>
</callout>
<callout label="92102A">
<point x="587" y="571"/>
</callout>
<callout label="92101A">
<point x="587" y="591"/>
</callout>
<callout label="18668B">
<point x="620" y="864"/>
</callout>
<callout label="18649E">
<point x="561" y="688"/>
</callout>
<callout label="18643D">
<point x="620" y="844"/>
</callout>
<callout label="18642F">
<point x="513" y="891"/>
</callout>
</callouts>
</imageData>
<?xml version="1.0"?>
<imageData imageName="91-924" imageType="PNG" version="2.0" xmlns="com.snapon.sbs">
<callouts shape="roundedRectangle">
<callout label="1243BD">
<point x="617" y="889"/>
</callout>
</callouts>
</imageData> -
Tabular form loses entered data on return from error page after validation
APEX 3.2
I have a manually-built tabular form with validation. I display the error on the error page. When using Firefox and Chrome, when returning from the error page, the data I entered in the tabular form is still displayed. When using IE, that data is NOT retained.
This worked properly at one time in IE.
Suggestions?
Thanks,
-KenAPEX 3.2
I have a manually-built tabular form with validation. I display the error on the error page. When using Firefox and Chrome, when returning from the error page, the data I entered in the tabular form is still displayed. When using IE, that data is NOT retained.
This worked properly at one time in IE.
Suggestions?
Thanks,
-Ken -
Iterating over the Values returned from a HashMap
Hi,
I have a HashMap which stores some Strings as Keys and their corresponding Values are a Vector of Strings.
for eg. one (Key, Value) pair is
(String1, [StringA, StringB, StringC, ........])
I understand that I can read the Vector Values by iterating over the HashMap using the ".entrySet()" and "Map.Entry" operations.
My problem is I am not able to iterate through the Vector values returned by the ".getValue( )" method.
can anyone please give some hints as to where I am commiting an error, or if I need to cast my values in some manner to iterate over them?
thanks in advancecan anyone please give some hints as to where I am commiting an errorSomewhere in your code. Post the smallest complete example which demonstrates the problem, then people may be able to give more specific help.
-
Splitting a value returned from 1 data attribute into 2 columns
Hi,
I have a data attributes called 'Customer Name' and this returns the customers first name and sirname so I see for example "Bob Marley", I need to break this value out into 2 fields the first name and sirname so I have two columns the first with "Bob" in the second with "Marley" in.
I was going to do the split by looking for the space between the first name and sirname for example for the first name I was this using the following syntax so it returns everything before the first space for the first name
substr(<urname>,instr(<urname>,' ')-1)
I was then going to have a second formula to get the sirname, I cant see the instr function in Answers though, any suggestion how I can split 1 field into first name and sirname assuming the first space it finds it where the first name ends ?
Edited by: user12521067 on 27-Jan-2010 09:40Cheers thanks, another related question, when I add a formula to a field it seems to re-run the query against the database, does that mean any formulas I create are only excuted at SQL run time so become part of the SQL ? I ask because in Business Objects XI when you create a variable this is applied to the data set you SQL statement has already returned and is cached so the forumla does not become part of the SQL ?
Sorry for all the questions, must get rid of my Business Objects hat :)
Edited by: user12521067 on 27-Jan-2010 09:49
Edited by: user12521067 on 27-Jan-2010 09:50 -
Output of value returned from function in SELECT statement ??
Hi
I have created the below function
create or replace
FUNCTION jc_test
RETURN VARCHAR2
IS myrec VARCHAR2(270);
BEGIN
SELECT RPAD('*',270,'*')
INTO myrec
FROM DUAL ;
RETURN myrec;
END ;
and I executed the SELECT statement in Oracle SQL developer as a script
select
LENGTH(jc_test()) len
*,jc_test() rec*
from dual ;
I get exact output as below
LEN REC
270 ******************************************************************************************************************************************************************************************************************************************************************************
So here LEN is correctly shown as 270 characters but when I see the astrisk's (also appended with spaces ) its total length is 4000 characters
Can anyone give their thoughts on this.
Its fine if I run as normal, i mean not as a script.
Regards
jc
Edited by: JC on Jun 16, 2011 11:25 AMHi,
So here LEN is correctly shown as 270 charactersYes, correct
but when I see the astrisk's (also appended with spaces ) its total length is 4000 charactersNo buts. It is not padded. That is just how it is displayed by your tool. In SQL*Plus this is controlled by LINESIZE and COLUMN
SQL> create or replace function dummy return varchar2 as begin return null; end;
2 /
Function created.
SQL> select dummy from dual;
D
X
SQL> select dummy() from dual;
DUMMY()
SQL> col "dummy()" for a10
SQL> select dummy() from dual;
DUMMY()
SQL>P.S: It is a really bad idea to create your own wrapper functions, built-in functions. Hopefully you are not really doing that?
Regards
Peter
Maybe you are looking for
-
More detail and a reply for the CQ50 - 130US will not boot with 8gb ram post
The specs, on the web site say that the max memory supported is 3GB DDR2 because the notebook was built with the OS Vista(32 bit) installed so that's why the manual has the 3 GB max. memory supported limit. The 32 bit OS can't address memory over 3.
-
In Internet Explorer, in the tools bar there is a refresh screen button, I can not find it in your tool bar in Mozilla Firefox. Please tell me how to refresh a screen in this web. Thanks ! If you go to IE you will see it in the tool bar under the add
-
Help! I'm literally due to have a baby today and need to sort out video footage storage
I just went to check that the battery is charged on the camera and got a notice saying the hard drive is full!.!!!!!!!! I have previously imported the video onto our Desktop Mac ( which is currently in storage) and think I have a back up too, but I'
-
Copying TLD from Sales Quote to Sales Order
Hi SAP experts, We would like to copy the Trailing LD value at the item level, from a Sales Quotation to a Sales Order...when a Sales Order is created in reference to the quote. VBAP-ZZTRLD on the Quotation...to VBAP-ZZTRLD on the Sales Order item le
-
ADF 10.1.2 vs JSF 10.1.3 - new project
Hello all, This question is primarily directed towards the Oracle PM's, but I'm interested in any opinion. We are starting a new project in the next week or two, and I am trying to decide which version of JDev and which technology to use for the view