Must declare object when using package
Using SQL Developer, I can select from a table but when I try to select from table in a package body I receive must be declared error. The privs to the table are granted via a role. If I grant the priv directly to the user it works. Why won't it work when the privs are granted via a role? Thanks,
I think the best place to point you is to the explanation in the documentation
Using Invoker's Rights Versus Definer's Rights (AUTHID Clause)
Similar Messages
-
Question
why does firefox (updated) on windows 7 NOT send a hotllink (must copy/paste),when using the 'send link' feature,whereas firefox on XP always sends a hotlink? This feature has always worked perfectly on all my windows XP computers,but not at all on any of my versions of firefox on windows 7.How can i fix this? Why does it not work?Hi,
Please check if this happens in [https://support.mozilla.com/en-US/kb/Safe%20Mode Safe Mode]. You can also attach a screenshot on this page below '''Post a Reply''' > '''Add images: Browse ...''' -
hi!
I am new to java .... learning how to use packages. I have created dir on my harddrive c:\learning\java ... in which i have created com\tests.... added c:\learning\java to path env variable .... And have written two java programs.
1. jmain.java
adds two integers and puts in another integer
public int sum()
2. jtest.java
main method ... and creates an object of jmain class ... and uses
jmain jm = jmain();
jm.sum();
Both these classes are in the same package com.tests and both jmain.java uses package com.tests;
and jtest.java uses package com.tests; import com.tests.*;
3. jmain compiles alright
but when compiling jtest.java compiler gives an error saying can't resolve symbol
symbol : jmain.class
path : com.tests.jtest
What to do now ???????? when i went to check my directory structure ... i am doing everything right.... using case okay, path is okay, etc
still running errors .... please suggest a solution.
thanks.I tried this ... it's giving me same error.
Please help.
I am on winXp so i added at the end of my path env var .... c:\learning\com\tests
//jmain.java
package com.tests;
public class jmain
public int x=4;
public int y=66;
public int sum = x+ y;
public printsum ()
System.out.println(sum);
//jtest.java
package com.tests;
import com.tests.*;
public class jtest
public static void main(String [] args)
jmain jm = jmain();
jm.printsum();
Above is my program. Both java files are in C:\learning\com\tests
And, is there a difference between CLASSPATH and setting environment variable or system variable ???? What is SOURCEPATH too ???
Please help
Thanks in advance. -
On cleanuing up COM object when using Microsoft.Office.Interop.Excel
When using Microsoft.Office.Interop.Excel the COM objects that are created by the code must be released using System.Runtime.InteropServices.Marshal.ReleaseComObject().
Most of the time it's pretty clear when a new COM object is created such as:
Excel._Application excelApp = null;
Excel._Workbook wb = null;
Excel._Worksheet ws = null;
Excel.Range newRange = null;
try
// four COM objects are created below
excelApp = new Excel.Application();
wb = excelApp.Workbooks.Add();
ws = (Excel.Worksheet)wb.Worksheets.Add();
newRange = (Excel.Range)ws.Range["A1","A30"];
// do these line of cod create new COM object?
newRange.Font.Bold = true;
newRange.Borders.Color = borderColor;
finally
if (excelApp != null) Marshal.ReleaseComObject(excelApp)
if (wb != null) Marshal.ReleaseComObject(wb)
if (ws != null) Marshal.ReleaseComObject(ws)
if (newRange != null) Marshal.ReleaseComObject(newRange)
In the above code I create four COM objects in the first part that need to be released when I'm finished with them. But it's not clear if the other two lines of code create a new COM object or not. If they do then my code needs to look more
like this:
Excel._Application excelApp = null;
Excel._Workbook wb = null;
Excel._Worksheet ws = null;
Excel.Range newRange = null;
Excel.Font fnt = null;
Excel.Borders bds = null;
try
// four COM objects are created below
excelApp = new Excel.Application();
wb = excelApp.Workbooks.Add();
ws = (Excel.Worksheet)wb.Worksheets.Add();
newRange = (Excel.Range)ws.Range["A1","A30"];
// do these line of cod create new COM object?
fnt = newRange.Font
fnt.Bold = true;
bds = new newRange.Borders;
bds.Color = borderColor;
finally
if (excelApp != null) Marshal.ReleaseComObject(excelApp)
if (wb != null) Marshal.ReleaseComObject(wb)
if (ws != null) Marshal.ReleaseComObject(ws)
if (newRange != null) Marshal.ReleaseComObject(newRange)
if (fnt != null) Marshal.ReleaseComObject(fnt)
if (bds != null) Marshal.ReleaseComObject(bds)
How can I tell if getting a property creates a new COM object or not?Thank you for your replay but I do understand that the font object is a COM object. What I'm trying to figure out is if a NEW object is created each time I access the font member of a Range object and if I need to call
Marshal.ReleaseComObject on the font object after using it.
Most member object of an object are a single instance and each time you access the member you simply get the pointer to that instance. For example:
using(DataTable dt = new DataTable("Some Table Name"))
PropertyCollection ep1 = dt.ExtendedProperties;
PropertyCollection ep2 = dt.ExtendedProperties;
if (Object.ReferenceEquals(ep1,ep2)) Console.WriteLine("They are the same object");
else Console.WriteLine("They are different objects");
The output will be: They are the same object
On the other hand this:
Excel._Application excelApp = new Excel.Application();
Excel._Workbook wb = excelApp.Workbooks.Add();
Excel._Worksheet ws = (Excel.Worksheet)wb.Worksheets.Add();
Excel.Range newRange = (Excel.Range)ws.Range["A1","A30"];
// do these lines of code create new COM object?
Excel.Font ef1 = newRange.Font;
Excel.Font ef2 = newRange.Font;
if (Object.ReferenceEquals(ef1,ef2)) Consloe.WriteLine("They are the same object");
else Consloe.WriteLine("They are different objects");
The output will be: They are different objects
It looks like each time I access the font member I get a new object. I suspect that is not the case and what I am getting is two pointers to the same object and the reference counter is incremented by one.
So really the question is what happens to the font member object of the Range object when the range object is released. I assume the font member will be released along with the Range object ever if the font object has a reference count greater then
0.
If I am correct in my assumption then I can access the font member object as much as I need to without worrying about releasing it.
I have been reading a lot about working with COM and the need to use Marshal.ReleaseComObject and there does seem to be a lot of disagreement and even confusion on the
mater about when and if COM objects need to be explicitly released. -
Problems with a Business Object when using data RAW.
Hi,
I've created a Z bapi with parameter tables as
FILE_BIN like SDOKCNTBIN
The structure SDOKCNTBIN has one RAW field.
When I go to SWO1 and implement a new Bapi, the following error occurs:
"Field SDOKCNTBIN -LINE is too large to be included in container"
Does anyone knows why when I declare an structure with a field RAW, gives that error?
Thanks in advance!Does this occur when using Immediate Mode?
Here's a blurb from my ADF Toy Store paper about Batch Mode and immediate mode.
http://www.oracle.com/technology/products/jdev/collateral/papers/10g/adftoystore/readme.html#batchmode -
"caching-descriptor" must be declared error when using ejbc on WLS6.0 with EJB 1.1
I'm compiling with ejbc an entity bean .jar. Using WLS 6.0. In the ejb-jar.xml,
I've set version to EJB 1.1. I've made sure the weblogic-ejb-jar.xml has the caching-descriptor
element defined (used to work with WLS 5.1).
Thanks.
Sayid
Error is : org.xml.sax.SAXParseException: Element type "caching-descriptor" must
be declare d. at weblogic.apache.xerces.framework.XMLParser.reportError(XMLParser.java
:1008) at weblogic.apache.xerces.validators.common.XMLValidator.reportRecoverab
leXMLError(XMLValidator.java:1236) at weblogic.apache.xerces.validators.common.XMLValidator.validateElement
AndAttributes(XMLValidator.java:2673) at weblogic.apache.xerces.validators.common.XMLValidator.callStartElemen
t(XMLValidator.java:818) at weblogic.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher
.dispatch(XMLDocumentScanner.java:1222) at weblogic.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocu
mentScanner.java:380) at weblogic.apache.xerces.framework.XMLParser.parse(XMLParser.java:900)
at weblogic.xml.process.ProcessorDriver.process(ProcessorDriver.java:128 ) at
weblogic.ejb20.dd.xml.WebLogicEjbJarLoader_WLS600.process(WebLogicEjb JarLoader_WLS600.java:455)
at weblogic.ejb20.dd.xml.DDUtils.loadDeploymentDescriptor(DDUtils.java:9 3) at
weblogic.ejb20.dd.xml.DDUtils.loadDeploymentDescriptor(DDUtils.java:4 7) at weblogic.ejb20.dd.xml.DDUtils.loadDeploymentDescriptor(DDUtils.java:3
8) at weblogic.ejbc20.runBody(ejbc20.java:665) at weblogic.utils.compiler.Tool.run(Tool.java:81)
at weblogic.ejbc.main(ejbc.java:20) --------------- nested within: ------------------
weblogic.xml.process.XMLParsingException: Element type "caching-descriptor" must
be declared. - with nested exception: [org.xml.sax.SAXParseException: Element
type "caching-descriptor" must be declar ed.] Line: 8 Column: 27 at weblogic.xml.process.ProcessorDriver.process(ProcessorDriver.java:132
) at weblogic.ejb20.dd.xml.WebLogicEjbJarLoader_WLS600.process(WebLogicEjb JarLoader_WLS600.java:455)
at weblogic.ejb20.dd.xml.DDUtils.loadDeploymentDescriptor(DDUtils.java:9 3) at
weblogic.ejb20.dd.xml.DDUtils.loadDeploymentDescriptor(DDUtils.java:4 7) at weblogic.ejb20.dd.xml.DDUtils.loadDeploymentDescriptor(DDUtils.java:3
8) at weblogic.ejbc20.runBody(ejbc20.java:665) at weblogic.utils.compiler.Tool.run(Tool.java:81)
at weblogic.ejbc.main(ejbc.java:20) ERROR: weblogic.xml.process.XMLParsingException:
Element type "caching-descripto r" must be declared. - with nested exception:
[org.xml.sax.SAXParseException: Element type "caching-descriptor" must be declar
ed.] Line: 8 Column: 27but a bean's deployment descriptor lies in the
meta-inf folder, right?Sorry, my mistake. I was thinking of WAR files while writing. Thanks for pointing out.
Regards,
$ Carol. -
"Object reference not set to an instance of an object" when using Sheel Shah's example
I am attempting to use a custom add dialog as in http://blogs.msdn.com/b/lightswitch/archive/2011/07/07/creating-a-custom-add-or-edit-dialog.aspx and
I get the error "Object reference not set to an instance of an object." when clicking my button to AddEntity(). My code to call the control is:
User u = new User();
userdialoghelper.AddEntity(u);
Any ideas as to why I'm getting this error? I "think" that I've set up the class properly?
ScottI may be a couple of years late to the party here (using VS2013) but I also had some issues adapting to Yann's improvements over Sheel's code.
Sheel's screen code as provided has the word "Old in the InitializeDataWorkspace and the created methods. this does not work when copy/pasted. ALso removed the "UI" from "InitialiseUI()"
Following code can be used with Yann's Helper Class.
Namespace LightSwitchApplication
Public Class EditableCustomersGrid
Private customersDialogHelper As ModalWindow
Private Sub EditableCustomersGrid_InitializeDataWorkspace(saveChangesTo As System.Collections.Generic.List(Of Microsoft.LightSwitch.IDataService))
customersDialogHelper = New ModalWindow(Me.Customers, "CustomerViewDialog")
End Sub
Private Sub EditableCustomersGrid_Created()
customersDialogHelper.Initialise()
End Sub
Private Sub gridAddAndEditNew_CanExecute(ByRef result As Boolean)
customersDialogHelper.CanAdd()
End Sub
Private Sub gridAddAndEditNew_Execute()
customersDialogHelper.AddEntity()
End Sub
Private Sub gridEditSelected_CanExecute(ByRef result As Boolean)
customersDialogHelper.CanView()
End Sub
Private Sub gridEditSelected_Execute()
customersDialogHelper.ViewEntity()
End Sub
Private Sub EditDialogOk_Execute()
customersDialogHelper.DialogOk()
End Sub
Private Sub EditDialogCancel_Execute()
customersDialogHelper.DialogCancel()
End Sub
End Class
End Namespace -
hi...
i have a question abt. package . i have created a package called mypack with a file class1.java. I have one more file with the same file name class1.java outside of the mypack also. If i call the class1 which is inside the mypack by using mypack.class1, it works fine . But i call the class1 which is outside of the package, i get the error
javax.servlet.ServletException: class1 (wrong name: mypack/class1)
java.lang.NoClassDefFoundError: class1 (wrong name: mypack/class1)
Now if i change the file name of the outside file, it will work fine. But i like to do without changing the file name by using some other calling method,,,Can anyone give me some suggestions ...
krisThanks for ur reply..
Can you clarify what you mean when you say "i call the
class1..."? How are you 'calling?'Both class1 and class2 are servlets, so i just use
urls : http://myserver.com/servlet/class1 to call the class1(outside package) , and
http://myserver.com/servlet/mypack.class1 to access the package class1.
>
It might just be classpath related.
"java.lang.NoClassDefFoundError: class1 (wrong name:
mypack/class1)" means something found a file named
class1 but inside the file was class named
mypack.class1.No..i checked the files, it was correct. i think when i try to access the file outside the package, it tries to access the file which is inside the package.
Thanks. -
Defining the order of objects when using Distribute?
VERSION: Illustrator CC Mac
So, I've always assumed that the order of the layers determined the order and position that shapes are moved in the Distribute function.
I'm having a wierd problem today and the order seems to be defined by something I can't figure out. I'm trying to vertically distribute a set of the same shape and instead of counting the shapes in order from left to right or vise versa the distribute function seems to be randomly picking the order of the shape, not basing it on location or layer order.
Here are a couple of examples:
In both examples I have used a Vertical Distribute Center and both groups of shapes are ordered from left to right in the layers palette with the left most layer being the first layer and the right most shape being the last.
What is causing the shapes to be distributed in this order? How do I specify what the order is if it isn't based on layer or position order?So, I've always assumed that the order of the layers determined the order and position that shapes are moved....
Wrong assumption. Only true sometimes.
...instead of counting the shapes in order from left to right...
Wrong assumption again.
So first, let's deal with the above assumptions:
When distributing objects, you are not usually talking about stacking order at all. You are talking about modifying initial reading order based on the initial relative X or Y positions.
Although you want stacking order to be a factor in some cases, you wouldn't want it in every case. Nor would you want it to be the default criteria. To understand this, consider the matter of reading order in text objects:
You open a PDF. As is often the case, it has a plethora of individual text objects. Those objects have a particular reading order which is really nothing but a perception of the viewer based on their relative positions. There is no guarantee whatsoever that the object stacking order corresponds to the reading order (creation order). For all the viewer knows, the body text may in fact have been created before the decorative headlines. The subheads, bullets, and callouts may also have been created in any unknown order.
In fact, I have just such a real-world frequently-reccuring situation: DXFs exported from engineering drawings frequently contain columns/rows of text in which the reading order does not correspond to the object stacking order. If the DXF is opened in Illustrator and then those text objects are threaded, or if their text is copied and pasted to concatenate them into a single text object, their reading order becomes scrambled, because threading and concatenating text is indeed dependent upon object stacking order (as are Blends, Mesh patches, and Pattern Brush tiles). By the same token, if those "lines" of text are distributed for uniform spacing and if the result were determined by the object stacking order, the text reading order would be similarly ruined.
So for this and similar situations I wrote a set of Javascripts which I use to rearrnage the stacking order of objects according to their relative positions on the page (i.e.; their reading order) first, before concatenating the text. But you wouldn't want to have to do this in every situation in which you want to distribute every and all kind(s) of objects.
The concept of "reading order" is not limited to text. Consider a fan of playing cards in a poker player's hand. Or chess pieces on a board. Or a row of houses on a map. Fence slats. Deck boards. Bricks or stones. Holiday icons on a calendar grid. You might want to make the XY spacing of such objects uniform, but that doesn't mean you want the stacking order changed, and inversely it doesn't mean you want the XY positions to be determined by stacking order.
So unless and until there is an "Ordered By:" control with which the user specifies "Stacking Order" or "Reading Order" (which there isn't), the feature just uses initial position values (reading order) as the first sorting criteria, and this is the most "normal" behavior.
...drawing a set of overlapping squares in decreasing size order, smallest on top. Drag the top square out of alignment.
I start with a group of shapes, all repeatedly copied from the first one on the far left...Then I move up the last one up...
On the left is before with two circles on top of each other...
In all the above instances, note that the situation starts with multiple objects already aligned in the direction of desired distribution, and moving only one of them before performing the distribution. So think of the math:
You have a set of horizontal position values: [0,0,0,3]. You want to "equally space" those values. How do you do that if, as explained above, stacking order is not a determinant? How do you "order" three zeros based on their numeric values? The instructions are ambiguous. In such situations, you have to use some other secondary criteria, even if it is arbitrary; even if it is random. Example:
Understand, I'm just replying to your initial post here. I'm not saying there is no bug in the Distribute interface. There may be, and if so, the bug(s) may be version-specific. I'm not addressing what Steve is trying to explain in Post 18: But note that when you do what he describes, the Distrubute Spacing value field automatically changes to zero, even if it is initially set to Auto and you are only clicking the Horizontal Distribute Space button. (At least in CS3; I don't have later versions in front of me right now because I'm not in the studio and I don't have CC at all because I'm not going to rent Adobe's software),
JET -
Missing parent object when using FXML - cannot manipulate other content
Hi,
today I was playing around with FXML and embedded it into a custom made "Dialog" class (an abstract class to provide some basic stuff, like add OK/Cancel Button, handle result type and so on programmatically).
Basically I've created an implementation which content is defined by an FXML document and contains a handler method for a password field.
After finding out how to work with the Event-API of JavaFX I know tried to enable/disable the programmatically created ok button of the dialog within the handler... But nothing happend.
Via debugging I found out, that no parent was set to the button anymore, but I checked (debugged): it was set, when I created the dialog content.
I assume that the missing parent (and who knows what else) is responsible for this behaviour.
Is this a know issue? Should I file a bug? Or submit some code for others to test/confirm?
Greetings,
DanielHi Daniel,
I think I was having a correct idea about that what I've done wrong:
I was using my Dialog class as the Controller, however the controller is instantiated by the FXMLLoader seperatly and has nothing in common with the class that called the loader.
However I could have set the controller manually via .setController() or via a controller factory and there I could have set the dialog to be the controller...
This is now what I've done and this is how it works.
If you want some code samples, I could provide them - I guess my english is not good enough to fully describe all the problems I encounter ;-)
Daniel -
How to fix Action Link Issue in Table and Pivot Table when used Section
My OBIEE Version: OBIEE 11.1.1.6.5
Issue Description: Action links (Navigate to BI Content) doesn't work in PIVOT TABLE or TABLE object when used Section area (one or more columns in Section area).
If you want to recreate this issue please follow next steps:
1. First of all you have to create one analyse with min 3 columns (for example Time.“Calendar date“, Product.Product, „Base Fact“. Revenue -> from Sample Sales Lite )
2. From column properties -> Set value Action Link Interaction on some column for example Product.Product (choose Navigate to BI Content -> any created BI report )
3. Click Results Tab choose Pivot Table and assigned one dimension column to Section area
4. Click preview icon
5. When you click on action link nothing happens
6. If you drug and drop column from Section Area to Excluded, Table or Pivot table Area then Action Link works perfectly
How to fix this issue?
I'll be grateful for any help!This is Bug:15922681 - ACTION LINK NAVIGATE TO BI CONTENT DOES NOT WORK WITH ATTRIBUTE IN SECTION
Upgrade to 11.1.1.6.6 will fix this issue. -
2011 MacBook Pro experiencing Kernel Panics when using iPhone 4 as modem
Recently purchased a custom MacBook Pro 15" with the upgraded 2.3 ghz quad core i7 processor. I immediately installed 8 GB of Ram and a 750GB 7200 speed HD from OWC when the unit arrived. All was well when testing from home, and had zero issues after using the Mac assistant to pull apps and user data from my old MBP, which I then sold on ebay.
Brought my new MBP to work, where I use my iPhone 4 (not jailbroken) to data share, using the personal hotspot. I connect the iPhone 4 to the MBP via USB, to keep the battery on the iPhone 4 charged.
While at work, I almost immediately started getting chain Kernel Panics on the new MBP. After hard powering down and restarting, the Kernel Panics would return at unpredictable intervals, sometimes an hour or more, sometimes within seconds of booting. I immediately suspected the RAM from OWC, as bad ram is the leading cause of Kernel Panics, according to a quick google search. So here is what I did in order, although keep in mind that this took place over a period of weeks, where I would intermittently go days w/out a Kernel Panic, and I was going crazy trying to figure this out.
1. Took apart machine and re-seated OWC Ram-did not fix
2. Attempted to confirm OWC RAM was bad before sending back to OWC, moved to step 3
3. Put Apple Hardware Test DVD in and let it run the extended hardware test in loop mode over a weekend (72 hours), with no report of any hardware failure
4. Some reports on the internet seemed to indicate the Apple Hardware test was not always reliable in discovering bad ram, so I purchased memtest, which I then looped and ran for 12 hours to test ram, with no report of failure.
5. Performed clean install of OS X 10.6 from Apple DVD, to include wiping the drive-Kernel Panics remained.
6. Removed OWC ram and installed Apple original Ram-Kernel Panics remained
7. Realized that at home I was on WiFi, and was not getting Kernel Panics (at least none that I could remember over the course of 2 weeks)
8. Tested w/ iPhone 4 connected via USB as personal Hot Spot, and Kernel Panics occurred regularly.
9. Tested w/ iPhone 4 connected via WiFi as personal Hot Spot, and Kernel Panics have not returned (running 6 hours so far w/out Kernel Panic)
At the beginning I had a Kensington Turbo Mouse connected as well, but over time I unplugged it to remove it from my troubleshooting list. At this point I must conclude that when using the iPhone 4 to data share over USB is the cause of my Kernel Panics.
All of the above was the long winded version of, my iPhone 4 is crashing my Mac. I just wanted interested parties to know what I've done already before suggestions are made.
Has anyone else experienced this issue? Anyone using their iPhone 4 to data share and connecting via USB w/out experiencing Kernel Panics? Anyone have any thoughts/ideas as to why this would occur?
FWIW, I've tried more than one USB cable to connect the iPhone to my MBP, and experienced Kernel Panics w/ both cables. I also fully restored my iPhone 4 when the recent 4.3 iOS update was released, so I don't think it's a software issue w/ the iPhone. I do not have a second iPhone 4 to test with, I also do not have a second Mac to test with.
Thanks up front for your thoughts and/or assistance.
BillHi everyone !
I'm new on this forum (and French btw, so I apologize in advance for any mistake (: )
I've bought the brand new MBP 13' few weeks ago, and I kept having this problem until now, I just installed K64 Enabler, and it seems to work perfectly, so I wanted you all to know it
Thanks for all the help you brought me !
Hope Apple will fix this once for all !
See you ! -
Isolation level when using UserTransaction
What isolation level does WLS assign to JDBC connection objects when used within
a user-controlled JTA transaction?
e.g. when using the following code within a servlet:
UserTransaction ut = (UserTransaction) ictx.lookup("java:comp/Usertransaction");
ut.begin();
DataSource ds = ictx.lookup("java:comp/env/jdbc/datasource");
Connection conn = ds.getConnection();
ResultSet rs = ps.executeQuery("....");
conn.commit();
Does weblogic force a specific isolation level, or will it fall back to the default
of the database?
We are using WLS 8.1 SP1 and Oracle 9.
/Johan
johan Eltes wrote:
> What isolation level does WLS assign to JDBC connection objects when used within
> a user-controlled JTA transaction?
> e.g. when using the following code within a servlet:
>
> UserTransaction ut = (UserTransaction) ictx.lookup("java:comp/Usertransaction");
> ut.begin();
> DataSource ds = ictx.lookup("java:comp/env/jdbc/datasource");
> Connection conn = ds.getConnection();
> ...
> ResultSet rs = ps.executeQuery("....");
> ...
> conn.commit();
>
> Does weblogic force a specific isolation level, or will it fall back to the default
> of the database?
> We are using WLS 8.1 SP1 and Oracle 9.
The Spec says that the connection should be in the DBMS's default isolation level
until set differently. For Oracle you will be in READ-COMMITTED. That's what you want
because Oracle's SERIALIZABLE isolation level is problematic, not doing what most
folks assume...
Joe
> /Johan
-
PL/SQL: ORA-22806: not an object or REF when Using Record in Package
Oracle Database 11g Enterprise Edition Release 11.1.0.7.0
I have declared a record type in my package
create or replace
PACKAGE MYPKG AS
TYPE MYREC IS RECORD (VAL1 varchar2(20), val2 date);
PROCEDURE display_error (pSQLERRM number);
PROCEDURE P_LOAD_DATA (pStartDate Date, pEndDate Date);
FUNCTION F_EPI(refno1 in NUMBER, refno2 in NUMBER) return MYREC;
END MYPKG;
--In My Package Body
FUNCTION F_EPI(refno1 in NUMBER, refno2 in NUMBER) return MYREC is
F_param MYREC;
BEGIN
select myvarchar2, mydate into MYREC from MYTable
where myrefno1 = refno1
and myrefno2 = refno2
Exception
when others then
display_error(SQLERRM);
RETURN F_param;
END F_EPI ;
PROCEDURE P_LOAD_DATA (pStartDate Date, pEndDate Date) IS
insert into atable(myvarchar, mydate)
select F_EPI(refno1,refno2).val1,F_EPI(refno1,refno2).val2 from tab2;
END P_LOAD_DATA;
I get errors
Error(187,7): PL/SQL: SQL Statement ignored
Error(225,7): PLS-00382: expression is of wrong type
Error(225,7): PL/SQL: ORA-22806: not an object or REF
When I compile the package.
When I try to call the function from SQL I get an Invalid datatype error.Hi,
Before posting any query/plsql blocks, please ensure that you have written it clean and complete with less syntax errors. ( at least general syntax errors, you can avoid). Then somebody can have an interest to check your logical error.
About your posting, refer below solution step-by-step. It may help you, about what you are looking for? By the way, you must be knowing, what you are going to to do with. I haven't concentrated about your requirement; as it was not missing in your posting.
drop table test;
create table test(myvarchar varchar2(20), mydate date);
create or replace
package mypkg as
type myrec is record (val1 varchar2(20), val2 date);
--procedure display_error (psqlerrm in number); -- if you are passing sqlerrm, then parameter needs to be string type
procedure display_error (psqlerrm in varchar2);
procedure p_load_data (pstartdate in date, penddate in date);
function f_epi(refno1 in number, refno2 in number) return myrec;
end mypkg;
Package created.
--in my package body
create or replace
package body mypkg as -- added
procedure display_error (psqlerrm in varchar2) -- if you are declared a proc/func in spec, it needs to define in pkg body
is
begin
null; -- you should know, what to do here
dbms_output.put_line('Err -'||sqlerrm);
end display_error;
function f_epi(refno1 in number,refno2 in number)
return myrec
is
f_param myrec;
begin
-- select myvarchar2, mydate into MYREC from mytable
-- where myrefno1 = refno1
-- and myrefno2 = refno2;
select ename, hiredate into f_param from emp -- added demo logic by using emp
where empno = refno1
and mgr = refno2;
return f_param; -- added
exception
when others then
raise; -- if you are using OTHERS then, just raise it
display_error(sqlerrm);
--return f_param; -- what is this?
end f_epi;
procedure p_load_data (pstartdate in date, penddate in date) -- you must be knowing the use of 2 params ???
is
v_rec myrec; -- added
begin -- Added
--insert into atable(myvarchar, mydate)
-- select f_epi(refno1,refno2).val1,f_epi(refno1,refno2).val1 from tab2;
-- demo logic added with static params to call f_epi
v_rec:= f_epi(7499,7698);
insert into test values v_rec;
--null;
end p_load_data;
end mypkg;
Package body created.
SQL> exec mypkg.p_load_data(null,null);
PL/SQL procedure successfully completed.
SQL> select * from test;
MYVARCHAR MYDATE
ALLEN 20-FEB-81
Thanks! -
Error when installing the supporting objects of OLL Packaged Application
Hello,
I am trying to install OLL Packaged Application|http://www.oracle.com/webfolder/technetwork/tutorials/obe/db/apex/r41/inst_pkgapp/inst_pkgapp.htm#top
but when installing the supporting objects, I got error when executing the code of "create_package_body"
Error at line 274: PLS-00201: identifier 'UTL_TCP' must be declared
create or replace package body eba_oll_log
as
g_start_time number;
procedure log_init
is
begin
g_start_time := dbms_utility.get_time;
end log_init;
procedure log_page_view
is
begin
insert into eba_oll_page_views
( APEX_USER,
PAGE_ID,
PAGE_NAME,
VIEW_DATE,
TS,
ELAPSED_TIME,
IP_ADDRESS,
AGENT,
APEX_SESSION_ID,
CONTENT_ID,
CONTENT_TITLE )
values
( v('APP_USER'),
v('APP_PAGE_ID'),
wwv_flow.g_step_title,
trunc(sysdate,'DD'),
systimestamp,
(dbms_utility.get_time-g_start_time)*(.01),
owa_util.get_cgi_env('REMOTE_ADDR'),
owa_util.get_cgi_env('HTTP_USER_AGENT'),
v('APP_SESSION'),
case when v('APP_PAGE_ID') = 24
then v('P24_CONTENT_ID')
else null
end,
case when v('APP_PAGE_ID') = 24
then v('P24_CONTENT_TITLE')
else null
end );
if v('APP_PAGE_ID') = 24 then
insert into eba_oll_content_views
( APEX_USER,
VIEW_DATE,
TS,
IP_ADDRESS,
AGENT,
APEX_SESSION_ID,
CONTENT_ID,
CONTENT_TITLE,
NOTE )
values
( v('APP_USER'),
trunc(sysdate,'DD'),
systimestamp,
owa_util.get_cgi_env('REMOTE_ADDR'),
owa_util.get_cgi_env('HTTP_USER_AGENT'),
v('APP_SESSION'),
v('P24_CONTENT_ID'),
v('P24_CONTENT_TITLE'),
'Viewed' );
end if;
commit;
end log_page_view;
procedure log_content_click
is
begin
insert into eba_oll_content_views
( APEX_USER,
VIEW_DATE,
TS,
IP_ADDRESS,
AGENT,
APEX_SESSION_ID,
CONTENT_ID,
CONTENT_TITLE,
NOTE )
values
( v('APP_USER'),
trunc(sysdate,'DD'),
systimestamp,
owa_util.get_cgi_env('REMOTE_ADDR'),
owa_util.get_cgi_env('HTTP_USER_AGENT'),
v('APP_SESSION'),
v('P24_CONTENT_ID'),
v('P24_CONTENT_TITLE'),
'Launched' );
commit;
end log_content_click;
end eba_oll_log;
create or replace package body eba_oll_api
as
function gen_id
return number
is
l_id number;
begin
select to_number(sys_guid(), 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
into l_id
from dual;
return l_id;
end gen_id;
function eba_oll_tags_cleaner (
p_tags in varchar2,
p_case in varchar2 default 'U' ) return varchar2
is
type tags is table of varchar2(255) index by varchar2(255);
l_tags_a tags;
l_tag varchar2(255);
l_tags apex_application_global.vc_arr2;
l_tags_string varchar2(32767);
i integer;
begin
l_tags := apex_util.string_to_table(p_tags,',');
for i in 1..l_tags.count loop
--remove all whitespace, including tabs, spaces, line feeds and carraige returns with a single space
l_tag := substr(trim(regexp_replace(l_tags(i),'[[:space:]]{1,}',' ')),1,255);
if l_tag is not null and l_tag != ' ' then
if p_case = 'U' then
l_tag := upper(l_tag);
elsif p_case = 'L' then
l_tag := lower(l_tag);
end if;
--add it to the associative array, if it is a duplicate, it will just be replaced
l_tags_a(l_tag) := l_tag;
end if;
end loop;
l_tag := null;
l_tag := l_tags_a.first;
while l_tag is not null loop
l_tags_string := l_tags_string||l_tag;
if l_tag != l_tags_a.last then
l_tags_string := l_tags_string||', ';
end if;
l_tag := l_tags_a.next(l_tag);
end loop;
return substr(l_tags_string,1,4000);
end eba_oll_tags_cleaner;
procedure eba_oll_tag_sync (
p_new_tags in varchar2,
p_old_tags in varchar2,
p_content_type in varchar2,
p_content_id in number )
as
type tags is table of varchar2(255) index by varchar2(255);
l_new_tags_a tags;
l_old_tags_a tags;
l_new_tags apex_application_global.vc_arr2;
l_old_tags apex_application_global.vc_arr2;
l_merge_tags apex_application_global.vc_arr2;
l_dummy_tag varchar2(255);
i integer;
begin
l_old_tags := apex_util.string_to_table(p_old_tags,', ');
l_new_tags := apex_util.string_to_table(p_new_tags,', ');
if l_old_tags.count > 0 then --do inserts and deletes
--build the associative arrays
for i in 1..l_old_tags.count loop
l_old_tags_a(l_old_tags(i)) := l_old_tags(i);
end loop;
for i in 1..l_new_tags.count loop
l_new_tags_a(l_new_tags(i)) := l_new_tags(i);
end loop;
--do the inserts
for i in 1..l_new_tags.count loop
begin
l_dummy_tag := l_old_tags_a(l_new_tags(i));
exception when no_data_found then
insert into eba_oll_tags (tag, content_id, content_type )
values (l_new_tags(i), p_content_id, p_content_type );
l_merge_tags(l_merge_tags.count + 1) := l_new_tags(i);
end;
end loop;
--do the deletes
for i in 1..l_old_tags.count loop
begin
l_dummy_tag := l_new_tags_a(l_old_tags(i));
exception when no_data_found then
delete from eba_oll_tags where content_id = p_content_id and tag = l_old_tags(i);
l_merge_tags(l_merge_tags.count + 1) := l_old_tags(i);
end;
end loop;
else --just do inserts
for i in 1..l_new_tags.count loop
insert into eba_oll_tags (tag, content_id, content_type )
values (l_new_tags(i), p_content_id, p_content_type );
l_merge_tags(l_merge_tags.count + 1) := l_new_tags(i);
end loop;
end if;
for i in 1..l_merge_tags.count loop
merge into eba_oll_tags_type_sum s
using (select count(*) tag_count
from eba_oll_tags
where tag = l_merge_tags(i) and content_type = p_content_type ) t
on (s.tag = l_merge_tags(i) and s.content_type = p_content_type )
when not matched then insert (tag, content_type, tag_count)
values (l_merge_tags(i), p_content_type, t.tag_count)
when matched then update set s.tag_count = t.tag_count;
merge into eba_oll_tags_sum s
using (select sum(tag_count) tag_count
from eba_oll_tags_type_sum
where tag = l_merge_tags(i) ) t
on (s.tag = l_merge_tags(i) )
when not matched then insert (tag, tag_count)
values (l_merge_tags(i), t.tag_count)
when matched then update set s.tag_count = t.tag_count;
end loop;
end eba_oll_tag_sync;
procedure render_tag_cloud (
p_selection in varchar2 default null,
p_app_id in number,
p_session_id in number,
p_min_nbr_tags in number default 1,
p_max in number default 100,
p_limit in number default 10000,
p_link_to_page in varchar2 default '2',
p_tag_item_filter in varchar2 default 'P2_TAGS',
p_clear_cache in varchar2 default '2,CIR,RIR',
p_more_page in varchar2 default '62' )
as
l_printed_records number := 0;
l_available_records number := 20;
l_max number;
l_min number;
l_class_size number;
l_class varchar2(30);
type l_tagtype is table of varchar2(2000);
l_tags l_tagtype;
type l_numtype is table of number;
l_cnts l_numtype;
l_size number;
l_total number :=0;
l_buffer varchar2(32676);
CURSOR c_all_tags
IS
select tag, c from (
select t.tag, count(*) c
from eba_oll_content c,
eba_oll_tags t
where c.content_id = t.content_id
and c.display_yn = 'Y'
and (p_selection is null or
(p_selection is not null and
( (substr(p_selection,1,1) = 'R' and
substr(p_selection,2) in (select release_id
from eba_oll_content_products cp
where cp.content_id = c.content_id))
or (substr(p_selection,1,1) = 'C' and
substr(p_selection,2) in (select product_id
from eba_oll_content_products cp
where cp.content_id = c.content_id))
or (substr(p_selection,1,1) = 'P' and
(substr(p_selection,2) in (select product_id
from eba_oll_content_products cp
where cp.content_id = c.content_id) or
substr(p_selection,2) in (select p.parent_product_id
from eba_oll_content_products cp,
eba_oll_products p
where cp.content_id = c.content_id
and cp.product_id = p.product_id)))
or (substr(p_selection,1,1) = 'G' and
(substr(p_selection,2) in (select pg.group_id
from eba_oll_product_groupings pg,
eba_oll_content_products cp
where pg.product_id = cp.product_id
and cp.content_id = c.content_id) or
substr(p_selection,2) in (select pg.group_id
from eba_oll_product_groupings pg,
eba_oll_products p,
eba_oll_content_products cp
where pg.product_id = p.parent_product_id
and p.product_id = cp.product_id
and cp.content_id = c.content_id)))
group by tag
) x where rownum < p_limit
and c >= p_min_nbr_tags
order by upper(tag) ;
begin
-- Fetch tags into arrays
open c_all_tags;
loop
fetch c_all_tags bulk collect into l_tags,l_cnts limit p_limit;
exit;
end loop;
close c_all_tags;
l_available_records := l_tags.count;
-- Determine total count and maximum tag counts
l_max := 0;
l_min := 1000;
FOR i in l_cnts.first..l_cnts.last loop
l_total := l_total + l_cnts(i);
if l_cnts(i) > l_max then
l_max := l_cnts(i);
end if;
if l_cnts(i) < l_min then
l_min := l_cnts(i);
end if;
end loop;
if l_max = 0 then l_max := 1; end if;
l_class_size := round((l_max-l_min)/6);
-- Generate tag cloud --
sys.htp.prn('<div class="tagCloud"><ul>');
for i in l_tags.first..l_tags.last loop
l_printed_records := l_printed_records + 1;
if l_cnts(i) < l_min + l_class_size then
l_class := 'size1';
elsif l_cnts(i) < l_min + (l_class_size*2) then
l_class := 'size2';
elsif l_cnts(i) < l_min + (l_class_size*3) then
l_class := 'size3';
elsif l_cnts(i) < l_min + (l_class_size*4) then
l_class := 'size4';
elsif l_cnts(i) < l_min + (l_class_size*5) then
l_class := 'size5';
else l_class := 'size6';
end if;
l_buffer := '<li><a class="'||l_class||'" href="'||
'f?p='||p_app_id||':'||p_link_to_page||':'||p_session_id||':::'||p_clear_cache||':'||
p_tag_item_filter||':'||htf.escape_sc(l_tags(i))||'">'||
htf.escape_sc(l_tags(i)) || '<span>' || l_cnts(i) || '</span></a></li>';
sys.htp.prn(l_buffer);
l_buffer := '';
if l_printed_records > p_max then
exit;
end if;
end loop;
sys.htp.prn('</ul></div>');
-- print if there's more
if l_tags.count - l_printed_records != 0 then
htp.prn('<p><a href="f?p='||p_app_id||':'||htf.escape_sc(p_more_page)||
':'||p_session_id||':::'||htf.escape_sc(p_more_page)||'">View all tags</a></p>');
end if;
exception when others then
sys.htp.prn('<p>No tags found.</p>');
end render_tag_cloud;
procedure email_when_feedback (
p_feedback_id in number,
p_host_url in varchar2,
p_app_id in number )
is
l_body clob;
l_body_html clob;
begin
for c1 in (
select f.feedback_comment, f.feedback_by,
c.title, nvl(ct.feedback_contacts,'[email protected]') email
from eba_oll_content_feedback f,
eba_oll_content c,
eba_oll_team ct
where f.id = p_feedback_id
and f.content_id = c.content_id
and c.team_id = ct.team_id (+) )
loop
l_body := 'You have received feedback for a piece of content you own in the Oracle Learning Library (OLL) Application.
Content: '|| c1.title || utl_tcp.crlf || '
Feedback: '|| c1.feedback_comment || utl_tcp.crlf || '
Left by: '|| lower(c1.feedback_by) ||'
You can respond via the OLL Application, '||p_host_url||'f?p='||p_app_id||':47:::NO::P47_ID:' || p_feedback_id || '.';
l_body_html := '<div style="border: 1px solid #DDD; background-color: #F8F8F8; width: 460px; margin: 0 auto; -moz-border-radius: 10px; -webkit-border-radius: 10px; padding: 20px;">
<p style="font: bold 12px/16px Arial, sans-serif; margin: 0 0 10px 0; padding: 0;">
You have received feedback for a piece of content you own in the Oracle Learning Library (OLL) Application.
</p>
<table style="width: 100%;" cellspacing="0" cellpadding="0" border="0">
<tr>' || utl_tcp.crlf || '
<td style="font: bold 12px/16px Arial, sans-serif; color: #666; padding: 0 10px 10px 0; vertical-align: top;">Content</td>
<td style="font: normal 12px/16px Arial, sans-serif; padding: 0 10px 10px 0; vertical-align: top;"><a href="#" style="color: #000">'||c1.title||'</a></td>
</tr>
<tr>' || utl_tcp.crlf || '
<td style="font: bold 12px/16px Arial, sans-serif; color: #666; padding: 0 10px 10px 0; vertical-align: top;">Feedback</td>
<td style="font: normal 12px/16px Arial, sans-serif; padding: 0 10px 10px 0; vertical-align: top;">'||replace(c1.feedback_comment,CHR(10),'<br/>')||'</td>
</tr>
<tr>' || utl_tcp.crlf || '
<td style="font: bold 12px/16px Arial, sans-serif; color: #666; padding: 0 10px 10px 0; vertical-align: top;">Left by</td>
<td style="font: bold 12px/16px Arial, sans-serif; padding: 0 10px 10px 0; vertical-align: top;">'||lower(c1.feedback_by)||'</td>
</tr>
<tr>' || utl_tcp.crlf || '
<td colspan="2" style="text-align: center; font: normal 12px/16px Arial, sans-serif; padding: 0 10px 10px 0; vertical-align: top;">
<a href="'||p_host_url||'f?p='||p_app_id||':47:::NO::P47_ID:' || p_feedback_id ||'" style="display: block; padding: 10px; background-color: #EEE; font: bold 16px/16px Arial, sans-serif; color: #444">Respond to this Feedback</a>
</td>
</tr>
</table>
</div>';
apex_mail.send (
p_to => c1.email,
p_from => '[email protected]',
p_subj => 'OLL - New Feedback for your team',
p_body => l_body,
p_body_html => l_body_html );
end loop;
end email_when_feedback;
procedure email_when_response (
p_feedback_id in number,
p_host_url in varchar2,
p_app_id in number )
is
l_body clob;
l_body_html clob;
begin
for c1 in (
select f.feedback_comment, f.feedback_by, f.response, c.title
from eba_oll_content_feedback f,
eba_oll_content c
where f.id = p_feedback_id
and f.content_id = c.content_id )
loop
l_body := 'You have received a response to your feedback left in the Oracle Learning Library (OLL) Application.
Content: '|| c1.title || '
Feedback: '|| c1.feedback_comment || '
Response: '|| c1.response || '
You can also view this response via the OLL Application, '||p_host_url||'f?p='||p_app_id||':60:::NO::IR_ID:' || p_feedback_id || '.';
l_body_html := '<div style="border: 1px solid #DDD; background-color: #F8F8F8; width: 460px; margin: 0 auto; -moz-border-radius: 10px; -webkit-border-radius: 10px; padding: 20px;">
<p style="font: bold 12px/16px Arial, sans-serif; margin: 0 0 10px 0; padding: 0;">
You have received a response to your feedback left in the Oracle Learning Library (OLL) Application.
</p>
<table style="width: 100%;" cellspacing="0" cellpadding="0" border="0">
<tr>' || utl_tcp.crlf || '
<td style="font: bold 12px/16px Arial, sans-serif; color: #666; padding: 0 10px 10px 0; vertical-align: top;">Content</td>
<td style="font: normal 12px/16px Arial, sans-serif; padding: 0 10px 10px 0; vertical-align: top;"><a href="#" style="color: #000">'||c1.title||'</a></td>
</tr>
<tr>' || utl_tcp.crlf || '
<td style="font: bold 12px/16px Arial, sans-serif; color: #666; padding: 0 10px 10px 0; vertical-align: top;">Feedback</td>
<td style="font: normal 12px/16px Arial, sans-serif; padding: 0 10px 10px 0; vertical-align: top;">'||replace(c1.feedback_comment,CHR(10),'<br/>')||'</td>
</tr>
<tr>' || utl_tcp.crlf || '
<td style="font: bold 12px/16px Arial, sans-serif; color: #666; padding: 0 10px 10px 0; vertical-align: top;">Response</td>
<td style="font: bold 12px/16px Arial, sans-serif; padding: 0 10px 10px 0; vertical-align: top;">'||replace(c1.response,CHR(10),'<br/>')||'</td>
</tr>
<tr>' || utl_tcp.crlf || '
<td colspan="2" style="text-align: center; font: normal 12px/16px Arial, sans-serif; padding: 0 10px 10px 0; vertical-align: top;">
<a href="'||p_host_url||'f?p='||p_app_id||':60:::NO::IR_ID:' || p_feedback_id ||'" style="display: block; padding: 10px; background-color: #EEE; font: bold 16px/16px Arial, sans-serif; color: #444">View Response in OLL Application</a>
</td>
</tr>
</table>
</div>';
apex_mail.send (
p_to => c1.feedback_by,
p_from => '[email protected]',
p_subj => 'Oracle Learning Library - Response to your Feedback',
p_body => l_body,
p_body_html => l_body_html );
end loop;
end email_when_response;
end eba_oll_api;
/Error at line 274: PLS-00201: identifier 'UTL_TCP' must be declared
Edited by: Fateh on Jan 13, 2012 7:32 AMThanks & Sorry for not mentioning the full information about my environment.
it was:
Oracle 11g xe R2 on Windows 7 machine
Apex listener deployed on Glass Fish server 3.1 on Windows 7 machine
Apex 4.1
Google Chrome
So, to have OLL application worked locally . we need the following:
grant execute on utl_tcp to [your_schema_name]And to
Configure an Application Express Application as a Partner Application in Oracle AS Single Sign-On http://www.oracle.com/technetwork/testcontent/sso-partner-app-100552.html.
I think I am going to install on my work space on apex.oracle.com.
Regards,
Fateh
Edited by: Fateh on Jan 15, 2012 9:38 AM
Maybe you are looking for
-
This is EXTREMELY frustrating. I want to buy exportPDF. I have credit card in hand. I'm ready to part with money. But every time I try to subscribe I'm directed to the French login screen and there's no way to change country. The address on my cr
-
Hi , I am trying an idoc to idoc scenario in which in the r/3 system if when i try to generate partner profiles and ports in bd82 , it gives me an message saying no message type is assigned although i jhve used the transaction BD64 for the model crea
-
We are in the process of moving VMs from our legacy 2008R2 Hyper-V cluster to our new Hyper-V 2012 cluster using VMM 2012 SP1 CU3. Most VM migrations go just as expected and are completely successful. I have had a couple of VMs however that appear to
-
I tried to upload a jpg file to a shared workspace for review today, but the system would not allow me to do so. It reported that my file exceeded the maximums, either for physical file size or number of pixels. The problem is that my file was act
-
Impossible de télécharger la version d'essai d'inDesign
Bonjour, Je voudrais télécharger la version d'indesign CS6 mais j'ai un message qui me dit que le serveur n'est pas disponible et qu'il faut rééssayer dans quelques minutes. Sauf que j'essaie depuis hier et tjours rien ?? Quelqu'un sait il pourquoi ?