Returned by function MAPIResolveNames
Hello all. We have a customer that is trying to export a report and email it. I will give you the rundown.
Windows 7
CR 9 SP 7
Latest Windows SP
Outlook 10
We are getting an error, ERROR 2147500037 RETURNED BY FUNCTION <MAPIRESOLVENAME>
I read the other threads and didn't seem to be anything in there for CR 9. Any help would be greatly appreciated.
Hello,
Correct. There is no fix for Cr 9 since it's been out of support for 5 years or so.
Only option is to upgrade to CR 2008 and apply Fix Pack 3.1. Microsoft deprecated simple MAPI API's in Window version 6.1 ( 7 and Server 2008 ) Cr had to update the export dll to use the Extended API set of instructions which is why there is no fix for old versions of CR that had no concept of the Extended set.
If they can't upgrade then only other option is to ask Microsoft to put the simple MAPI functionality back into all the Products they removed it from. They broke backward compatibility.
Thank you
Don
Similar Messages
-
Error 2147500037 returned by function MAPIResolveName
I am getting this error when i am sending a mail
MAPI Destination
Error 2147500037 returned by function <MAPIResolveName>
its Crystal Report 8.5 with SP3
Windows Server 2008 R2 Standard
Windows LIve Mail
Please suggestUpgrade to Crystal Reports 2008 SP 3 and install [Fix Pack 3.5|https://smpdl.sap-ag.de/~sapidp/012002523100006341722011E/cr2008fp35.exe] and then it supports Windows Office 2007 Extended MAPI API's. Microsoft deprecated the Simple MAPI API's in in Office 2007 and above.
Not supported in CR 8.5, it is 10 years old. Only other option is to ask Microsoft to add the simple MAPI API's back into their new Office Products that use MAPI.
Thank you
Don -
Procedure parameter of type returned by function
Hi there
I want to know if it's possible to pass a parameter to procedure of type returned by function
Something like that
pocedure test(x in varchar2
,y in my_function(param)
)Definitely don't fullish yourself ;-)
AFAIK you cannot declare a variable based on the return type of a function.
Perhaps though you are looking for SUBTYPEs.
SQL> SET SERVEROUTPUT ON;
SQL> DECLARE
2 SUBTYPE subtype_name IS VARCHAR2 (30) NOT NULL;
3
4 PROCEDURE procedure_name (
5 parameter_name IN subtype_name)
6 IS
7 BEGIN
8 DBMS_OUTPUT.PUT_LINE (parameter_name);
9 END;
10
11 FUNCTION function_name (
12 parameter_name IN DATE)
13 RETURN subtype_name
14 IS
15 BEGIN
16 RETURN TO_CHAR (parameter_name, 'DAY');
17 END;
18
19 BEGIN
20 procedure_name (function_name (SYSDATE));
21 END;
22 /
THURSDAY
PL/SQL procedure successfully completed.
SQL> -
Display text (returned by function) after tabelar forom submit...
Hi guys...
Is there any possibility to display text returned by function after tabular form submit?
If yes please tell me how :)
With regards,
PsmakRThe value of the selected row's Display column ("Choice B", for example) is not stored in the field -- only the value of the selected row's Value column ("2") is. With the DDLB's item list loaded the form is able to translate "2" (Value) to "Choice B" (Display) so you see "Choice B". With the DDLB's item list empty there is no way to translate "2" to "Choice B" so you see "2".
If you do not want to save the DDLB's item list with the form you would need to preserve the selected row's Display column in another, possibly hidden, field then use that to display the translated Value. -
Does Mail (for Lion) have a return receipt function?
i was wondering whether Mail (for Lion) have a return receipt function. I've seen many negative answers, but they're all from 2007 and earlier. How can I configure for some of my messages to have return receipts?
chrisrdc wrote:
Yeah, I do have the home and student Office version, but the trial version for outlook included in the package does not include this feature. Is is available only with the "real"version?
I'm not sure there is a forum for Office for Mac Product Forums, I'd recommend posting there is no one here is able to help. -
My profile was 'fixed' and I am trying to return to functionality
I had a bug on my laptop and the system experts removed my profile.
That got rid of all of my workspace information. I had a backup, so I started copying everything back. I am close to getting things back, but this isn't horeshoes!
I currently get this in my console,
at com.businessobjects.reports.sdk.requesthandler.f.a(Unknown Source)
at com.businessobjects.reports.sdk.requesthandler.DatabaseRequestHandler.byte(Unknown Source)
at com.businessobjects.reports.sdk.JRCCommunicationAdapter.do(Unknown Source)
... 35 more
Caused by: com.businessobjects.reports.jdbinterface.common.DBException: Unexpected database connector error
at com.crystaldecisions.reports.queryengine.driverImpl.jdbc.JDBCConnection.Open(Unknown Source)
at com.crystaldecisions.reports.queryengine.JDBConnectionWrapper.Open(Unknown Source)
... 45 more
Parms are; 800/S80/5069723
ERROR - detected an exception: Unexpected database connector error
at com.crystaldecisions.reports.queryengine.Connection.t1(Unknown Source)
My program isn't very large and it did work before. I have it below. The params are printing, so the program did read the input control file. It just can't find the database connection. I do have the log4j.properties file and it is in the correct place.
I think I just need to redo the JDBC connection.
Can somebody help me?
What I need to do is re-establish or check my database connection.
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.text.SimpleDateFormat;
import javax.swing.SwingUtilities;
import com.crystaldecisions.sdk.occa.report.application.DatabaseController;
import com.crystaldecisions.sdk.occa.report.application.ReportClientDocument;
import com.crystaldecisions.sdk.occa.report.exportoptions.ReportExportFormat;
import com.crystaldecisions.sdk.occa.report.lib.*;
import com.crystaldecisions.sdk.occa.report.data.*;
public class checkReg {
private static final String REPORT_NAME = "D:\\Inetpub\\ftproot\\CRegister\\CheckRegister.rpt";
public static void launchApplication() {
try
File f1 = new File("D:\\Inetpub\\ftproot\\CRegister\\CReg.jac");
if (f1.exists())
{f1.delete();
java.io.File src = new File("D:\\Inetpub\\ftproot\\CRegister\\CReg.txt");
java.io.File dest = new File("D:\\Inetpub\\ftproot\\CRegister\\CReg.txt".replace(".txt", ".jac"));
src.renameTo(dest);
File f2 = new File("D:\\Inetpub\\ftproot\\CRegister\\CReg.bak");
if (f2.exists())
{f2.delete();
FileInputStream in = new FileInputStream("D:\\Inetpub\\ftproot\\CRegister\\CReg.jac");
BufferedReader br = new BufferedReader(new InputStreamReader(in));
String strLine;
String sDate;
float tran;
SimpleDateFormat formatter = new SimpleDateFormat("MMddyyyy");
java.util.Date date = new java.util.Date();
// to run for the current day use this -
sDate = formatter.format(date);
// Read the file one line at a time
while ((strLine = br.readLine()) != null)
String patternStr = ",";
String[] args = strLine.split(patternStr);
// format is vendor_yyyymmdd_check_nbr.pdf
String EXPORT_FILE = "D:\\Appdata\\CRegister\\" + args[3] + "_" + sDate + "_" + args[4] + ".pdf";
String Params = args[0] + "/" + args[1] + "/" + args[4];
System.out.println("Parms are; " + Params);
try {
//Open report.
ReportClientDocument reportClientDoc = new ReportClientDocument();
reportClientDoc.open(REPORT_NAME, 0);
//Switch all tables on the main report. See utility method below.
switch_tables(reportClientDoc.getDatabaseController());
//We will be using the ParameterFieldController quite a bit through-out the rest of this function.
reportClientDoc.getDatabaseController().logon("procure","procure90");
com.crystaldecisions.sdk.occa.report.application.ParameterFieldController paramFieldController = reportClientDoc.getDataDefController().getParameterFieldController();
paramFieldController.setCurrentValue("", "cash_code", new String(args[0]));
paramFieldController.setCurrentValue("", "bank_code", new String(args[1]));
String tranValue = args[4];
Float tranTemp = Float.valueOf(tranValue);
tran = tranTemp.floatValue();
paramFieldController.setCurrentValue("", "tran_code", tran);
ByteArrayInputStream byteArrayInputStream = (ByteArrayInputStream)reportClientDoc.getPrintOutputController().export(ReportExportFormat.PDF);
//Release report.
reportClientDoc.close();
//Use the Java I/O libraries to write the exported content to the file system.
byte byteArray[] = new byte[byteArrayInputStream.available()];
//Create a new file that will contain the exported result.
File file = new File(EXPORT_FILE);
FileOutputStream fileOutputStream = new FileOutputStream(file);
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(byteArrayInputStream.available());
int x = byteArrayInputStream.read(byteArray, 0, byteArrayInputStream.available());
byteArrayOutputStream.write(byteArray, 0, x);
byteArrayOutputStream.writeTo(fileOutputStream);
//Close streams.
byteArrayInputStream.close();
byteArrayOutputStream.close();
fileOutputStream.close();
System.out.println("Successfully exported report to " + EXPORT_FILE);
catch(ReportSDKException ex) {
ex.printStackTrace();
System.out.println("The exporting of reports has finished!");
br.close();
in.close();
java.io.File src2 = new File("D:\\Inetpub\\ftproot\\CRegister\\CReg.jac");
java.io.File dest2 = new File("D:\\Inetpub\\ftproot\\CRegister\\CReg.jac".replace(".jac", ".bak"));
catch(Exception ex) {
System.out.println(ex);
private static Object String(String string) {
// TODO Auto-generated method stub
return null;
* Sample utility method for switching the database connection properties of all tables accessible from a databaseController
* (i.e., could be a main report database controller, or a subreport's database controller) from one database to another.
private static void switch_tables(DatabaseController databaseController) throws ReportSDKException {
//Declare the new connection properties that report's datasource will be switched to.
//NOTE: These are specific to using JDBC against a particular MS SQL Server database. Be sure to use the
//DisplayConnectionInfo sample to determine what your own connection properties need to be set to.
final String TABLE_NAME_QUALIFIER = "xtreme.dbo.";
// final String DBUSERNAME = "procure";
// final String DBPASSWORD = "procure90";
final String SERVERNAME = "aix-dblaw2.ochsner.org";
final String CONNECTION_STRING = "Use JDBC=b(true);Connection URL=s(jdbc:oracle:thin:@aix-dblaw2.ochsner.org:1521:lawocfp);" +
"Database Class Name=s(jdbc:oracle:thin);Server=s(aix-dblaw2.ochsner.org);" +
"User ID=s(procure);Password=;Database=s(procure90);Trusted_Connection=b(false);" +
"JDBC Connection String=s(!jdbc:oracle:thin:@aix-dblaw2.ochsner.org:1521" +
"DatabaseName={lawocfp};user={procure};password={procure90}!)";
final String DATABASE_NAME = "lawocfp";
final String URI = "!jdbc:oracle:thin:@aix-dblaw2.ochsner.org:1521;DatabaseName={lawocfp};user={procure};password={procure90}!";
final String DATABASE_DLL = "crdb_jdbc.dll";
//Obtain collection of tables from this database controller.
Tables tables = databaseController.getDatabase().getTables();
//Set the datasource for all main report tables.
for (int i = 0; i < tables.size(); i++) {
ITable table = tables.getTable(i);
//Keep existing name and alias.
table.setName(table.getName());
table.setAlias(table.getAlias());
//Change properties that are different from the original datasource.
table.setQualifiedName(TABLE_NAME_QUALIFIER + table.getName());
//Change connection information properties.
IConnectionInfo connectionInfo = table.getConnectionInfo();
//Set new table connection property attributes.
PropertyBag propertyBag = new PropertyBag();
//Overwrite any existing properties with updated values.
propertyBag.put("Trusted_Connection", "false");
propertyBag.put("Server Name", SERVERNAME); //Optional property.
propertyBag.put("Connection String", CONNECTION_STRING);
propertyBag.put("Database Name", DATABASE_NAME);
propertyBag.put("Server Type", "JDBC (JNDI)");
propertyBag.put("URI", URI);
propertyBag.put("Use JDBC", "true");
propertyBag.put("Database DLL", DATABASE_DLL);
connectionInfo.setAttributes(propertyBag);
//Set database username and password.
//NOTE: Even if these the username and password properties don't change when switching databases, the
//database password is *not* saved in the report and must be set at runtime if the database is secured.
connectionInfo.setUserName("procure");
connectionInfo.setPassword("procure90");
connectionInfo.setKind(ConnectionInfoKind.DBFile);
table.setConnectionInfo(connectionInfo);
//Update old table in the report with the new table.
databaseController.setTableLocation(table, tables.getTable(i));
public static void main(String [] args) {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
//Hand-off to worker function to start application.
launchApplication();An update -
The libraries appear to all be in tact, now.
The error I am getting,
Parms are; 800/S80/5069660
ERROR - detected an exception: Unexpected database connector error
is a connection issue.
Any ideas?? -
How to return javascript function value to jsp page
Hi i want to retrieve values from javascript function to jsp page, how can i do that ? i am trying this but its not working
<script language="javascript" type="text/javascript" src="/feedback/common/scripts/config.js"></script>
<script language="javascript" type="text/javascript" src="/feedback/common/scripts/richtext.js"></script>
<td>
<jsp:param id="description" value= "<%=request.initRTE('', '')%>"/>
</td>
here this initRTE function is used for displaying rich text editor .....i want to retrieve back the contetnt written in this editor and save it to DB.
Please help.
Edited by: xtech on Apr 4, 2008 12:00 PMsurely i will do that but my app is still not working.....
here is my code
</td>
<td align="left">
<script language="javascript" type="text/javascript" src="/feedback/common/scripts/config.js"></script>
<script language="javascript" type="text/javascript" src="/feedback/common/scripts/richtext.js"></script>
<h:inputHidden id="introtext" value= "<%=request.getParameterValues(description)%>">
<script>
initRTE('','');
</script>
</td>
in java script function i am geeting the text content
function initRTE(rtePreloadContent, rteCSS) {
rtePreloadContent=document.getElementById('surveyinfo:introtext').value;
startRTE(rtePreloadContent);
menuBuilder();
var description= document.getElementById(rteFormName).value;
return description;
basically i want to get the text written in text editor in jsp and want to send it to DB.(Here initRTE() function is calling rich text editor)
i have downloaded this editor from this url
http://freerichtexteditor.com/page/4.htm
and trying to embed it in my app. -
I need to include a procedure in a dll that is non-blocking, i.e. it should return immediately after the procedure has been called, and not return after its processes are completed.
The procedure is a LabView 7.0 VI, and the dll is being created using the Application Builder. Currently the procedure completes its desired task and then returns, but I would like the function to return immediately. Thanks for your help!Rischaard,
I don't know if that will work in a dll, however as an idea:
use the vi-server functions:
Your dll-procedure opens a OwnTreat.vi(wich will do the work) with vi-server, and run it without waiting for completion.
First thing OwnTreat.vi should do is opening (with vi-server) a reference to itself (So your caller dll can close without stopping the OwnTreat.vi)
Then OwnTreat.vi con do what YOU want. When finished close the self-reference
Maybe you need a short wait or a feedback to make sure that OwnTreat has opened his own reverence before your dll stops.
Greetings from Germany
Henrik
LV since v3.1
“ground” is a convenient fantasy
'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ' -
Sending pdf via email: pdf is not returned from function module
Hi all.
I am having trouble sending a pdf form as an attachment to an email.
After calling the funtion module that is creating the PDF, field pdf of the return parameter /1bcdwb/formoutput should be used to create the attachment.
But the field PDF is empty after calling the function module - only the field xml is given back.
What did I miss?
Thank you for your help and best regards, Kathrin!Hi Kathrin,
See below for the example:
ls_outputparams-getpdf = 'X'.
CALL FUNCTION 'FP_JOB_OPEN'
CHANGING
ie_outputparams = ls_outputparams
EXCEPTIONS
cancel = 1
usage_error = 2
system_error = 3
internal_error = 4
OTHERS = 5.
If you setup the job like this then the pdf parameter will be filled with the XSTRING data for the generated PDF.
Regards,
Ryan Crosby -
Using Column Name returned by function in SELECT statement
Hi
Output from my function (RETURN data type is VARCHAR2) is column name. I want to use it directly in my SELECT statement. Below is simplified example of this:
--- Function
CREATE OR REPLACE FUNCTION simple RETURN varchar2 IS
BEGIN
RETURN ‘my_column’;
END simple;
--- Select
SELECT simple FROM my_table;
This does not work. It seems that output from function is passed in quotation i.e.
SELECT ‘my_column’ FROM my_table;
So the output from SELECT is a list of rows populated with values my_table:
COLUMN simple
ROW1 my_column
ROW2 my_column
ROW3 my_column
Can please someone help me with this?I'm not sure I got you right.
In standard SQL everything must be known at compile time. If not dynamic SQL is required, but is a costly operation (usually requires parsing before each execution) so it should better not be used when standard SQL can do it.
I provided a design time example where a function returns the column name from the given the table name and column id for a varchar2 column data type to make things simple. Then a query string is constructed and executed dynymically to return all column values of the chosen table_name.column_name.
SELECT simple FROM my_tableAt compile time the simple function return value is unknown (any varchar2 value would do) you already find out you get the (same) return value (i.e column name) for each table row => dynamic SQL needed to get the column values
The purpose of function would be to rename all columns for provided table.The table name would be provided, right? If yes => dynamic SQL
What is the function supposed to return the column name (where would the new name come from?), the column alias (which table column would be renamed to the new name?)
The user could use the new_column name as the column alias name submitting the query.
Is it possible to do this?Maybe () using a pipelined function (different data types - number,date, ... not cosidered yet) but your simple query;
<tt>SELECT simple FROM my_table</tt>
might look like:
<tt>select my_column_value new_column_name from table(get_column_value(table_name,column_name))</tt>
Sorry, no Database at hand to provide a specific example.
Regards
Etbin -
Using SYS_REFCURSOR returned from function in a WHERE clause
Hi All,
I have a plsql function that returns a SYS_REFCURSOR. Typically it will be three columns wide and 1 or more rows. I'd like to use it like:
SELECT *
FROM schema_name.table_name a
WHERE a.date_col BETWEEN trunc(add_months(SYSDATE,-12),'month') AND sysdate
AND ((a.col_a, a.col_b, a.col_c) IN (
open SYS_REFCURSOR returned by schema_name.package_name.function_name('x','y','z')
I've tried casting it to a table, but it complains about an invalid relational operator:
SELECT *
FROM schema_name.table_name a
WHERE a.date_col BETWEEN trunc(add_months(SYSDATE,-12),'month') AND sysdate
AND ((a.col_a, a.col_b, a.col_c) IN (TABLE(schema_name.package_name.function_name('x','y','z')))
Any suggestions would be appreciated!
Thanks,
ThomasRegarding 3360's xml functionality:
SQL> create or replace function f
2 return sys_refcursor
3 as
4 c sys_refcursor;
5 begin
6 open c for
7 select 7788 empno, 'SCOTT' ename from dual
8 union all
9 select 7900 empno, 'JAMES' ename from dual;
10
11 return c;
12 end f;
13 /
Function created.
SQL> select empno, ename
2 from emp
3 where (empno, ename) in
4 (select extractvalue (column_value, 'ROW/EMPNO'),
5 extractvalue (column_value, 'ROW/ENAME')
6 from table (xmlsequence (f)));
EMPNO ENAME
7788 SCOTT
7900 JAMES -
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 -
Catching collection returned by function in SQL statement
I am having a select query as : (I need all the values returned by the function in the select list)
select t1.col1,t2.col2, (select t.a,t.b,t.c from fn(t2.col3) t)
from
t1,t2
where t1.col1=t2.col2;
My function is like :
fn(t2.col3) returns a table in object format
Here I was able to select only one value from table returned by the funcation at a time.If I select all the values as above it was giving too many vales error.
Please any one help me in thisuser13044793 wrote:
I am having a select query as : (I need all the values returned by the function in the select list)
select t1.col1,t2.col2, (select t.a,t.b,t.c from fn(t2.col3) t)
from
t1,t2
where t1.col1=t2.col2;Any specific reason for doing this? It adds an additional complexity to the SQL projection, and there's the additional costs of context switching to the PL/SQL engine (per row). All in all - not your typical approach and one that should have sound justification.
As for the basic method - the multiset() SQL function needs to be used to create a collection. Here's a basic example of the approach:
SQL> create or replace type TFoo as object(
2 id number,
3 bar varchar2(5)
4 );
5 /
Type created.
SQL>
SQL> create or replace type TFooSet as table of TFoo;
2 /
Type created.
SQL>
SQL> create or replace function GetSomeFoo( n number ) return TFooSet is
2 foo TFooSet;
3 begin
4 foo := new TFooSet();
5 foo.Extend( 5 );
6
7 for i in 1..5
8 loop
9 foo(i) := new TFoo( n+i-1, to_char(i-1,'0000') );
10 end loop;
11
12 return( foo );
13 end;
14 /
Function created.
SQL>
SQL> select
2 object_id,
3 object_name,
4 cast(
5 multiset( select * from table(GetSomeFoo(object_id)) ) as TFooSet
6 ) as FOO
7 from all_objects
8 where owner = 'SYS'
9 and rownum <= 5;
OBJECT_ID OBJECT_NAME FOO(ID, BAR)
27538 /1000e8d1_LinkedHashMapValueIt TFOOSET(TFOO(27538, ' 0000'), TFOO(27539, ' 0001')
, TFOO(27540, ' 0002'), TFOO(27541, ' 0003'), TFOO
(27542, ' 0004'))
28544 /1005bd30_LnkdConstant TFOOSET(TFOO(28544, ' 0000'), TFOO(28545, ' 0001')
, TFOO(28546, ' 0002'), TFOO(28547, ' 0003'), TFOO
(28548, ' 0004'))
11718 /10076b23_OraCustomDatumClosur TFOOSET(TFOO(11718, ' 0000'), TFOO(11719, ' 0001')
, TFOO(11720, ' 0002'), TFOO(11721, ' 0003'), TFOO
(11722, ' 0004'))
30094 /100c1606_StandardMidiFileRead TFOOSET(TFOO(30094, ' 0000'), TFOO(30095, ' 0001')
, TFOO(30096, ' 0002'), TFOO(30097, ' 0003'), TFOO
(30098, ' 0004'))
684122 /1023e902_OraCharsetUTFE TFOOSET(TFOO(684122, ' 0000'), TFOO(684123, ' 0001
'), TFOO(684124, ' 0002'), TFOO(684125, ' 0003'),
TFOO(684126, ' 0004'))
SQL>
SQL> with dataset as(
2 select
3 object_id,
4 object_name,
5 cast(
6 multiset( select * from table(GetSomeFoo(object_id)) ) as TFooSet
7 ) as FOO
8 from all_objects
9 where owner = 'SYS'
10 and rownum <= 5
11 )
12 select
13 d.object_id,
14 d.object_name,
15 f.id,
16 f.bar
17 from dataset d,
18 table(d.foo) f
19 /
OBJECT_ID OBJECT_NAME ID BAR
217 DUAL 217 0000
217 DUAL 218 0001
217 DUAL 219 0002
217 DUAL 220 0003
217 DUAL 221 0004
268 SYSTEM_PRIVILEGE_MAP 268 0000
268 SYSTEM_PRIVILEGE_MAP 269 0001
268 SYSTEM_PRIVILEGE_MAP 270 0002
268 SYSTEM_PRIVILEGE_MAP 271 0003
268 SYSTEM_PRIVILEGE_MAP 272 0004
271 TABLE_PRIVILEGE_MAP 271 0000
271 TABLE_PRIVILEGE_MAP 272 0001
271 TABLE_PRIVILEGE_MAP 273 0002
271 TABLE_PRIVILEGE_MAP 274 0003
271 TABLE_PRIVILEGE_MAP 275 0004
274 STMT_AUDIT_OPTION_MAP 274 0000
274 STMT_AUDIT_OPTION_MAP 275 0001
274 STMT_AUDIT_OPTION_MAP 276 0002
274 STMT_AUDIT_OPTION_MAP 277 0003
274 STMT_AUDIT_OPTION_MAP 278 0004
815 RE$NV_LIST 815 0000
815 RE$NV_LIST 816 0001
815 RE$NV_LIST 817 0002
815 RE$NV_LIST 818 0003
815 RE$NV_LIST 819 0004
25 rows selected.
SQL> -
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 -
MULTIPLES RETURN IN FUNCTIONS?
Is it possible for a function to return more than one value @ a time.?
user4539121 wrote:
Is it possible for a function to return more than one value @ a time.?A function can only pass back a single return item, however that item may be a data structure containing many values.
There are also pipelined functions which act as tables when incorporated into SQL queries. These effectively open up a pipe and can return one return item after another until it chooses to stop. Example...
SQL> CREATE OR REPLACE TYPE num_descript AS OBJECT(num number, descript varchar2(30))
2 /
Type created.
SQL>
SQL> CREATE OR REPLACE TYPE tbl_num_descript AS TABLE OF num_descript
2 /
Type created.
SQL>
SQL>
SQL> CREATE OR REPLACE PACKAGE reftest AS
2 FUNCTION pipedata(p_choice number) RETURN tbl_num_descript PIPELINED;
3 END;
4 /
Package created.
SQL>
SQL> CREATE OR REPLACE PACKAGE BODY reftest AS
2 FUNCTION pipedata(p_choice number) RETURN tbl_num_descript PIPELINED IS
3 v_obj num_descript := num_descript(NULL,NULL);
4 v_rc sys_refcursor;
5 BEGIN
6 IF p_choice = 1 THEN
7 OPEN v_rc FOR SELECT empno as num, ename as descript FROM emp;
8 ELSIF p_choice = 2 THEN
9 OPEN v_rc FOR SELECT deptno as num, dname as descript FROM dept;
10 END IF;
11 LOOP
12 FETCH v_rc INTO v_obj.num, v_obj.descript;
13 EXIT WHEN v_rc%NOTFOUND;
14 PIPE ROW(v_obj);
15 END LOOP;
16 CLOSE v_rc;
17 RETURN;
18 END;
19 END;
20 /
Package body created.
SQL> select * from table(reftest.pipedata(1));
NUM DESCRIPT
7369 SMITH
7499 ALLEN
7521 WARD
7566 JONES
7654 MARTIN
7698 BLAKE
7782 CLARK
7788 SCOTT
7839 KING
7844 TURNER
7876 ADAMS
7900 JAMES
7902 FORD
7934 MILLER
14 rows selected.
SQL> select * from table(reftest.pipedata(2));
NUM DESCRIPT
10 ACCOUNTING
20 RESEARCH
30 SALES
40 OPERATIONS
SQL>
Maybe you are looking for
-
How to perform grouping like a daisy chain
Hi: I have a database table of Building Inspections (InspectionID) for each Building Permit (PermittingID). Sometimes the inspections fail and have to be re-inspected. I do not relate each re-inspection to the original inspection. I relate each re-
-
I cant open itunes !! an error occures !
hi every1. i got a problem with itunes 7 (latest version). actually i got my new video ipod.i installed itunes & everything worked. but after 2 weeks ,i dont know wht actually happened ?? i have no idea wht happened , now whenever i try to open itune
-
Import Enterprise Service into Repository and Enhance Service
Hi experts. We've activated with transaction SOAMANAGER a enterprise service discovered in ENTERPRISE SERVICE WORKPLACE in SAP BACKEND. In SAP PI we created a external definition from WSDL definition and we've developed a SOAP to SOAP scenario where
-
How do I set up iTunes with a computer? I have an iPad 3 with an external drive that contains around 50 ripped CD's.
-
hi, i deployed applet and select the requred libraries throw the deployment but when im try to run it IE or Netscape no values appears from teh database on the browser but in JDeveloper everything is working fine. this mesasage appear from java conso