Access on objects to public
Dear all,
10.2.0.5 on solaris 10
Audit team had raised the below issue.
that several database packages including “UTL_FILE”, “UTL_HTTP”, “UTL_SMTP”,
“DBMS_JOB” and “DBMS_SCHEDULER” are granted execute access to “PUBLIC”. When I revoked the privileges from public, the object XDB.DBMS_XMLPARSER became errored and our application started throwing the error :XDB.DBMS_XMLPARSER has errors. after the revoke, I was monitoring the invalid objects in the database using the command
select object_name from dba_objects where status='INVALID' order by last_ddl_time desc;Why the above commmand doesn't show XDB.DBMS_XMLPARSER as invalid. ?
Anyway, I resolved using the note : 247093.1 Be Cautious When Revoking Privileges Granted to PUBLIC
Thanks
Kai
To throw the objects using the right mouse button, drag the following library scripts on to your 3D sprite and set their parameters:
Push Model [from Havok --> Control]
Mouse Right [from 3D --> Triggers]
To prevent button conflicts, you need to remove the rightMouseDown and rightMouseUp handlers from the Move Model script. Then you need you remove the mouseDown and mouseUp handlers from the Push Model script.
In the Push Model script, edit the rightMouseDown handler to the following:
on rightMouseDown(me)
-- add your movable models here
tModelList = [pMember.model("proxy box"), pMember.model("proxy sphere")]
tOptionsList = [#levelOfDetail: #simple, #modelList: tModelList, #maxNumberOfModels: 1]
tClickedModels = pSprite.camera.modelsUnderLoc(the mouseLoc - point(pSprite.left, pSprite.top), tOptionsList)
if tClickedModels.count then
pClickedModel = tClickedModels[1]
else
pClickedModel = VOID
end if
end rightMouseDown
Then edit the rightMouseUp handler to the following:
on rightMouseUp(me)
pClickedModel = 0
pAttached = false
end rightMouseUp
And hopefully that should solve your problems.
Similar Messages
-
Allowing access to select few public objects (moved from Native forum)
I am moving my posting from Java Forums > Fundamentals > Key Classes > Native forum to this one. Sorry for posting it on the wrong forum earlier. Before each reply I have added a lien for clarity.
Allowing access to select few public objects
Author: COOLNM Posts: 5 Registered: 12/21/05
Dec 21, 2005 9:59 AM
I am developing a java application. I need to provide some scripting support (using Jython or Rhino) to my application so that the user can better use my application. Now the problem is I just want a select few public objects to be accesible via scripts and not all public objects I have written internally. I read somewhere that class name and code obfuscation could be a option but not a full proof solution. Can anyone suggest how a full proof solution can be achieved? Would running the script interpreter in seperate JVM help (and propogate the calls to the original JVM) ? Would a custom class loader help? Please suggest.
Thanks,
COOLNM
Re: Allowing access to select few public objects
Author: IanSchneider Posts: 1,381 Registered: 10/26/00
Dec 21, 2005 10:14 AM (reply 1 of 10)
I read somewhere that class name and code obfuscation could be a option but not a full proof solution.Correct, someone could still can call obfuscated methods.
Would running the script interpreter in seperate JVM help (and propogate the calls to the original JVM) ?No.
Would a custom class loader help? Possibly depending upon how the interpreter dispatches calls.
Can anyone suggest how a full proof solution can be achieved?With jython, you could write custom PyObject subclasses (or general java facade classes) to expose only the methods you want to. The former technique allows more cool scripting functionality, the latter would presumably work in other interpreters. This would have to be done for every object you want to expose.
Alternatively, you could enable a SecurityManager and allow only trusted code to invoke yours.
Re: Allowing access to select few public objects
Author: COOLNM Posts: 5 Registered: 12/21/05
Dec 21, 2005 9:36 PM (reply 2 of 10)
I read somewhere that class name and codeobfuscation could be a option but not a full proof
solution.
Correct, someone could still can call obfuscated
methods.
Would running the script interpreter in seperate JVMhelp (and propogate the calls to the original JVM) ?
No.Could you please explain why this wouldn't work?
The plan is:
Let say I have 2 public objects A & B and I want the user to only use A via their scripts.
In JVM1: I use both A & B
In JVM2: I write a psuedo A and not B. For all the methods of A, I propogate the calls to JVM1 (I think this is achievable but not sure how)
The script interpreter runs on JVM2.
Now if the user tries to access A then the call would go to JVM1 but if he tries to access B then there is no B available in JVM2 so the user cant access B.
I know this method could be heavy as each call would have to go from JVM1 to JVM2.
By sepeate JVMs I mean seperate instance of java.
>
Would a custom class loader help? Possibly depending upon how the interpreter
dispatches calls.
Can anyone suggest how a full proof solution can beachieved?
With jython, you could write custom PyObject
subclasses (or general java facade classes) to expose
only the methods you want to. The former technique
allows more cool scripting functionality, the latter
would presumably work in other interpreters. This
would have to be done for every object you want to
expose.
Alternatively, you could enable a SecurityManager and
allow only trusted code to invoke yours.-----------------------------------------------------------------------------------------------------
Re: Allowing access to select few public objects
Author: allquixotic Posts: 12 Registered: 12/19/05
Dec 22, 2005 5:09 AM (reply 3 of 10)
RMI has a way for multiple JVMs to communicate programmatically; you could also use sockets on the loopback network device (localhost). These techniques are how mature Java products constrain their number of running instances to a finite number (usually 1), they terminate any starting JVM early in the initialization procedures of the main method if the "already-running test" indicates one is running.
If you use the networking method, you could basically read from a ServerSocket on the "executing" JVM, while the "scripting" JVM writes to a Socket. Then use reflection in the executing (server) side to determine if the method or object being referenced is one you want to expose. If not, do something -- like write back to the client that the method invocation was invalid. Reflection will slow down your code a lot though, so I don't recommend it for apps that already take up 50 megs or more of RAM ;)
Regards,
Sean
Re: Allowing access to select few public objects
Author: IanSchneider Posts: 1,381 Registered: 10/26/00
Dec 22, 2005 9:05 AM (reply 4 of 10)
Would running the script interpreter in seperate JVMhelp (and propogate the calls to the original JVM) ?
No.
Could you please explain why this wouldn't work?It could work. I said no because the other methods are better - easier to implement and vastly more performant without wasting resources.
Re: Allowing access to select few public objects
Author: COOLNM Posts: 5 Registered: 12/21/05
Dec 23, 2005 12:48 AM (reply 5 of 10)
Ya, the seperate JVM approach seems complex and might not be fully achievable.
Can someone give small code snippets on how the method level control be achieved using Java SecurityManager. Just a recap on what I am trying to achieve -
A & B are two public objects defined internally by my app.
I have to give the user of my app the ability to write some code. But only B
is to be exposed to client and not A.
Let say I have this code -
Object A = Interpreter.InitializeEngine(..);
A.executeFromUser(stdin);
The user mostly uses some scripting language, say Python and the Interpreter
is Jython. Now my Interpreter is capable of understanding calls to Java
objects from Python. If the user tries to access B via the scripts then it
should be allowed to do so but access to A should not be allowed via the
scripting language.
Thanks,
Neeraj
Re: Allowing access to select few public objects
Author: bschauwejava Posts: 721 Registered: 1/13/04
Dec 26, 2005 2:13 PM (reply 6 of 10)
What you probably want is to give the user access to an interface - not a class - that only exposes the methods that you want to expose.
This is the way all RMI APIs are exposed to client programs.
Re: Allowing access to select few public objects
Author: bschauwejava Posts: 721 Registered: 1/13/04
Dec 26, 2005 2:16 PM (reply 7 of 10)
Just one more comment. You haven't said very much about the runtime model of the scripting environment vs your java environment. How many processes do you expect to have running to make the system work? Are you expecting your java code to wind up in a jar file and get loaded by the Python process? Or are you planning on the java code executing in a separate process? If the latter, then RMI is probably your best bet.
Re: Allowing access to select few public objects
Author: COOLNM Posts: 5 Registered: 12/21/05
Dec 27, 2005 4:20 AM (reply 8 of 10)
I haven't finalized on the runtime model yet as the scripting security issue is still not resolved. But I am sure that the java app code would init and run the scripting code and not the other way round. The app is pretty huge with heavy UI. Ya, the java code would be wrapped in jars (but mostly not in a single jar as I dont want the jar to be too hefty).
Can someone comment on the use of SecurityManager in this case. My initial investigation shows that the objective on implementing method level security can't be implemented by this.
Re: Allowing access to select few public objects
Author: IanSchneider Posts: 1,381 Registered: 10/26/00
Dec 27, 2005 9:14 AM (reply 9 of 10)
My initial reply suggested writing a facade in java or by subclass PyObject. I highly recommend this path for ease of development, use, and runtime performance.
Given that you don't understand the basics of java security, I will recommend this again.
Re: Allowing access to select few public objects
Author: COOLNM Posts: 5 Registered: 12/21/05
Dec 27, 2005 11:33 PM (reply 10 of 10)
I have started investigating on facade in java and subclassing PyObject. But I am not sure how these would resolve the primary issue. Even if I use these and if the script writer knows that there is a public class, say XYZ in my app then he can always access that class directly skipping my subclassed PyObject or the Java facade. Or am I missing something here?I have started investigating on facade in java and subclassing PyObject. But I am not sure
how these would resolve the primary issue. Even if I use these and if the script writer knows
that there is a public class, say XYZ in my app then he can always access that class directly
skipping my subclassed PyObject or the Java facade. Or am I missing something here?Presumably your objects are somehow connected to the application. Your user could do something like:
from com.foo import Player
p = Player()
p.setGold(Integer.MAX_VALUE)But of course the new Player object would not be part of the game. Now if you have some kind of static/singleton game state, then the malicious user could insert the Player into the game model...
The real trick lies in understanding how to setup the jython interpreter. If your interpreter classloader can only load facade classes (and system classes) then the client script could not load other classes. There is also a hook for the import keyword so you could disallow importing java classes. Each interpretor instance has the ability to setup the locals and globals for the session so you can insert live game objects.
I am only familiar with jythons internals, so this may or may not be applicable to rhino. -
How to access an object in a bean
I am looking for a way to access an object in a bean and make available to the page.
for example if i have a Bean called User and it contains an attribute Called Company as an attribute in User. Now I have User.getCompany(). and I can do this
<%User user = request.getUser();
Company company = user.getCompany();
request.setAttribute("comp", company); %>
how do I do this with useBean ?I am looking for a way to access an object in a bean
and make available to the page.
for example if i have a Bean called User and it
contains an attribute Called Company as an attribute
in User. Now I have User.getCompany(). and I can do
this
<%User user = request.getUser();
Company company = user.getCompany();
request.setAttribute("comp", company); %>
how do I do this with useBean ?You can access a JavaBean Object property of another JavaBean inside the JSP with the use of EL (Expression Language)
So if you are using JSP 2.0 or higher try this:
<jsp:useBean id="user" class="your.package.User" scope="request"/>
${user.company.id}I tested the above and it works.
Note that you need to set the Company object in the User object before trying to access it inside the JSP.
You can also set it in the JSP if you want, (before trying to access it), but its cleaner to do it in a Servlet.
Both User and Company must follow JavaBeans notation.
So in the above case the User object is something like this:
package your.package;
public class User{
private Customer customer;
public User(){}
public Customer getCustomer(){
return customer;
public void setCustomer(Customer customer){
this.customer = customer;
}And your Customer JavaBean is something like this:
package your.package;
public class Customer{
private int id;
public Customer(){}
public int getId(){
return this.id;
public void setId(int id){
this.id = id;
} -
Unable to access the objects with out schema as prefix.. can any body help
Hi,
i am using 10g.I have one problem like i unable to get the table access with out mention prefix for that table.
but i created public synonym and gave all grants to all users also. but still i need to mention schema name as prefix otherwise it give the error..
can any body tell me reason and give me solution.
ex: owner:eiis table:eiis_wipstock
connect to: egps schema
in this position if i try with eiis.wipstock it gives error but if i mention like eiis.wiis_wipstock then its working fine.Pl do not spam the forums with duplicate posts - Unable to access the objects with out schema as prefix.. can any body help
-
when we are decleared a class variable,there should be an object in the memory.this object is the object of the java.obj.Class class.............
my query is ..
how to acess that object ?
e.g.
public class Basic
public class Acsess{
Basic b;//now please tell how access the object of class Basic.Class?......
thanks and regurdsI believe that the following example will help. You should also read this tutorial page:
[Understanding Instance and Class Members|http://java.sun.com/docs/books/tutorial/java/javaOO/classvars.html]
class A
static String fie = "this is fie";
String foo = "this is foo";
public class B
public static void main(String[] args)
System.out.println(A.fie);
A instance = new A();
System.out.println(instance.fie); // Not recommended; does not
// make it clear that fie is
// a class (static) variable
System.out.println(instance.foo);
} -
Access to object that call me?
Any can help me with this problem.
I got:
ClassA
ClassB
ClassC
They all mine. and derived from Object.
I create "objectA" of ClassA,
then call method of "objectA", which call method of "objectB" (ClassB)
which call method of "objectC"..
At end of this in "objectC", i want to have access to "objectA"
What i should use?
Sorry about my English.public ClassB (ClassA obja) {
ClassC c = new ClassC(a)
public ClassC (ClassA obja) {
obja.whatever -
Hi,
I've come across such a silly probem shown in example below:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:views="*" creationComplete="initApp()">
<mx:Script>
<![CDATA[
import mx.controls.Text;
public function initApp()
label1.text = "View1 changed";
]]>
</mx:Script>
<views:view1 label="view1" width="100%" />
</mx:Application>
view1.xml file contains:
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="100%">
<mx:Label id="label1" x="10" y="50" text="View1"/>
</mx:Canvas>
It renders error:
1120: Access of undefined property label1.
How can I access label1 object from main file?Next I wanted to call function declared in main app:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:views="*">
<mx:Script>
<![CDATA[
import mx.controls.Button;
public function test():void
]]>
</mx:Script>
<views:view1 id="myComp" />
</mx:Application>
view1.mxml:
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="100%">
<mx:Button id="button1" label="Button1" click="test()"/>
</mx:Canvas>
1180: Call to a possibly undefined method test. ViewStackTest/src view1.mxml line 3 1251498782218 1661
How can reference to test()? -
Access an object in a arraycollection set as dataprovider
Hi,
I'm having trouble accessing an object, which is inside an
arraycollection and that arraycollection is bound to a datagrid
dataprovider.
One item in the arraycollection looks like this for example:
(string) value1="foo"
(string) value2="bar"
(object) myobject=I am looking for a way to access an object in a bean
and make available to the page.
for example if i have a Bean called User and it
contains an attribute Called Company as an attribute
in User. Now I have User.getCompany(). and I can do
this
<%User user = request.getUser();
Company company = user.getCompany();
request.setAttribute("comp", company); %>
how do I do this with useBean ?You can access a JavaBean Object property of another JavaBean inside the JSP with the use of EL (Expression Language)
So if you are using JSP 2.0 or higher try this:
<jsp:useBean id="user" class="your.package.User" scope="request"/>
${user.company.id}I tested the above and it works.
Note that you need to set the Company object in the User object before trying to access it inside the JSP.
You can also set it in the JSP if you want, (before trying to access it), but its cleaner to do it in a Servlet.
Both User and Company must follow JavaBeans notation.
So in the above case the User object is something like this:
package your.package;
public class User{
private Customer customer;
public User(){}
public Customer getCustomer(){
return customer;
public void setCustomer(Customer customer){
this.customer = customer;
}And your Customer JavaBean is something like this:
package your.package;
public class Customer{
private int id;
public Customer(){}
public int getId(){
return this.id;
public void setId(int id){
this.id = id;
} -
Accessing view object class (impl) method from bean (or vice versa)
Halo everyone, I am using JDeveloper 11.1.2.1.0
I have a UsersViewImpl class with a method which refresh the user table like below.
public void resetEmployeeSearch() {
removeApplyViewCriteriaName("viewCriteria");
executeQuery();
and I have a UserBean class with a method which reset the search fields values like below.
public void resetInput(ActionEvent actionEvent) {
........RichInputText = input ...
input.setValue("");
AdfFacesContext.getCurrentInstance().addPartialTarget(searchForm);
I would like to implement it in such a way that, once I press a button, both methods will be called.
I have tried to call from bean method using UsersViewImpl vs = new UsersViewImpl ..... which is wrong and wont work.
I have read about doing something like ViewObject vo = am.findViewObject("DeptView1") but I duno how to use it because I cant have a proper example.
Any suggestion on accessing view object class (impl) method from bean (or vice versa)?
Or is there any way to combine both method in the same class ?
Thank you :(User, if you get class not found exceptions you need to tell us which classes you can't find. The JSFUtils and ADFUtils classes needing some other libraries which should already be part of your Fusion Web Application template (which your adf application should be based on). If you did not use this application template, you may have to add some libraries yourself.
What is the diff of using the ADFUtils and OperationBinding way?
The ADFUtils can get you access to the application module which you then use to call exposed methods on. The disadvantage of doing this is that you have to implement your own exception framework which then handles exceptions thrown by the application module. An other thing is that if you e.g. alter a VO which you use on the page this changes are not seen on the page until you refresh the page. The binding layer does not know about these changes so the iterators (which are used on the page to show the data) are not refreshed and so you don't see the changes.
In general you should avoid using the application modul in a managed bean method and always use the binding layer (OperationBinding) to call methods. This ensures that exceptions are all handled the same way and that changes to the data model are reflected in the GUI.
Timo -
Hi all - this code is full of errors, but here's my main question...
I have this code in the beginning of the getTotalSales() method (in the Station class): total += (myPumps.get(0).getGallonsSold()) * (myBasePrice +.25); Apparently, that's not working - it causes a compiler error "cannot find symbol - method getGallonsSold()". I'm not sure how else to do it, since I'm using an ArrayList. Any suggestions?
Thanks, I really appreciate the help. My full code is below...
import java.io.*;
import java.util.*;
import chn.util.*;
class Pump
private double gallonsSold;
public Pump( )
gallonsSold = 0;
public double getGallonsSold()
return gallonsSold;
public void resetGallonsSold()
gallonsSold = 0;
class Station
private double myBasePrice;
private ArrayList myPumps; //contains an arraylist of object pumps
public Station()
myBasePrice = 2.00;
myPumps = new ArrayList<Pump>();
public double getTotalSales()
double total = 0.00;
total += (myPumps.get(0).getGallonsSold()) * (myBasePrice +.25);
total += (myPumps.get(1).getGallonsSold()) * (myBasePrice +.25);
if (myPumps.size() > 2)
for(int x=2; x<myPumps.size(); x++)
total += (myPumps.get(x).getGallonsSold()) * (myBasePrice);
public void resetAll( )
for(Pump p: myPumps)
p.resetGallonsSold();
public void closeStation(FileOutput outFile)
outFile.println("Total day's sales: $" + getTotalSales());
public class week29
public static void main(String[] args)
Scanner in = new Scanner(System.in);
Station s = new Station();
System.out.print("create a station with how many pumps? (the first two will be full service) -->");
int numPumps = in.nextInt();
for (int i=0; i <= numPumps; i++)
s.myPumps.add(new Pump());
System.out.println("Station created with a base price of $2/gallon and full service price of $2.25/gallon");
boolean quit = false;
while (!quit)
System.out.println("-- Menu --");
System.out.println("0 - buy gas");
System.out.println("1 - get total sales");
System.out.println("2 - reset all sales");
System.out.println("3 - close station, write total sales to file, and exit");
System.out.print("enter choice --> ");
int choice = in.nextInt();
if (choice == 0)
System.out.printf("Available pumps: 0 - %d (0 and 1 are full service)\n", numPumps-1);
System.out.print("Buy from which pump? --> ");
int p = in.nextInt();
System.out.print("Buy how many gallons? --> ");
double g = in.nextDouble();
s.myPumps.get(p).gallonsSold += g;
else if (choice == 1)
System.out.println("Total sales: "+ s.getTotalSales());
else if (choice == 2)
System.out.println("Sales reset.");
s.resetAll();
else if (choice == 3)
FileOutput outFile = new FileOutput("station.txt");
System.out.println("Writing total sales to station.txt and exiting.");
s.closeStation(outFile);
quit = true;
}You have a lot of other things that won't work. You can't access "s.myPumps" because myPumps is private. You need a "getPumps()" (returning a List<Pump>) or a "getPump(int pumpNumber)" (returning a Pump)---probably the latter is better. You need to have a "addGallonsSold(double gal)" method in Pump--you can't manipulate gallonsSold directly from your test driver.
You should not have the following in main:
for (int i=0; i <= numPumps; i++)
s.myPumps.add(new Pump());
} You should make a constructor for Station that takes the number of pumps, and put the 'for' loop there.
Your Station will blow up if the user doesn't specify at least 2 pumps. -
I get an error message when downloading ITunes "could not access the network location" %public%\desktop\?
windows vista 32 bitTry the following user tip:
"Could not access network location %PUBLIC%\Desktop\" install errors -
How do i restrict access on ipad for public use?
My employer would like to set up Ipads in each office to display our advertizements and products as well as play informative videos.
Eventually we would also like to be able to set up access on the ipads for the clients to type in their personal info and submit quote requests electronically.
However, we want to be able to restrict the access so that the public are only able to view and access specific apps or websites that we have chosen.
also if anyone has a recommendation on an app that provides a pausable slideshow for displaying documents that would be helpful as well.One option would be to investigate an MDM such as AirWatch. Devices can be placed in Single App Mode, or setup with a restricted browser. You can also display business content on your devices.
-
Hyper-V encountered an error trying to access an object on computer ...
I'd like to share an issue which occurred during one of my recent configurations as well as the associated solution which worked for me.
While configuring Hyper-V Manager on a non-domain joined Windows 8.1 Enterprise client, to communicate with a non-domain joined Microsoft Hyper-V Server 2012R2, I received the following enjoyable message:
Hyper-V encountered an error trying to access an object on computer '.....' because the object was not found. The object might have been deleted. or you might not have permission to perform the task. Verify that the Virtual Machine Management service
on the computer is running. If the service is running, try to perform the task again by using Run as Administrator.
As it turns out I forgot to change the machine name on the Hyper-V server. It's worth noting that it's also necessary to add an entry in the client machine's HOSTS file which matches the computer name of the Hyper-V server.Hi ITMAGE,
Thanks for your sharing and support for this forum .
It should be helpful to other people who are facing this issue .
Best Regards,
Elton JI
We
are trying to better understand customer views on social support experience, so your participation in this
interview project would be greatly appreciated if you have time.
Thanks for helping make community forums a great place. -
Add ABAP program: validating package - error accessing shared objects-area
When adding a new program or browsing the packages in eclipse i get an "error accessing shared objects-area".
I can edit, save and run existing ABAP reports, however.
There was a similar problem here, regarding database procedure proxies but the solution doesn't apply to my problem, i guess. The solution was about creating the shared memory area CL_RIS_SHM_AREA. I can't access the memory area and start the constructor, as it doesn't show up on the monitor.
ADT 2.28
Eclipse 4.3
Netweaver 7.31 SP4 -> is this really compatible with ADT 2.28?
Thanks in advance for helpful hints,
JulianHI Julian,
if the area doesn't show up in the monitor, please try to start the constructor in transaction SHMM on your own by selecting the icon 'Start Constructor' as shown in the screenshot.
Choose CL_RIS_SHM_AREA as area, select 'Default Instance' and 'Dialog' as execution mode. Then press 'Create'. Either this works or the system will tell you the issue with the instance creation (e.g. insufficient shared objects memory - see the other solution description).
Best regards, Sebastian -
DBMS_SQL.PARSE to access remote objects
I am using following code in a procedure ...
DBMS_SQL.PARSE (cur, vSQL, DBMS_SQL.NATIVE);
where variable vSQL can contain a remote object.
A DB link (with Fixed User option) exists to access that database.
The DB link is working. The remote object is accessible outside this procedure.
When this command is executed, I get ...
ORA-24374: define not done before fetch or execute and fetch
... error.
Can DBMS_SQL handle remote objects?
Oracle version is 9.2.0.5.0
Any help would be greatly appreciated.Here is the code I am running ...
CREATE OR REPLACE PROCEDURE p_sql_valid_or_not_cnt
(vSQL IN VARCHAR2, vValid OUT NUMBER, vMessage OUT VARCHAR2, vCount OUT NUMBER) IS
-- Purpose: Returns 0 in vvalid if SQL is valid, else returns -1. Returns row count when SQL is valid.
-- Parameters:
-- IN : vSQL
-- OUT : vValid
-- OUT : vMessage
-- OUT : vCount
cur INTEGER := DBMS_SQL.OPEN_CURSOR;
fdbk INTEGER;
BEGIN
DBMS_SQL.PARSE (cur, vSQL, DBMS_SQL.NATIVE);
fdbk := DBMS_SQL.EXECUTE (cur);
vCount := 0;
LOOP /* Fetch next row. Exit when done. */
EXIT WHEN DBMS_SQL.FETCH_ROWS (cur) = 0;
vCount := vCount + 1;
END LOOP;
vValid := 0;
vMessage := 'No errors';
DBMS_SQL.CLOSE_CURSOR (cur);
END p_sql_valid_or_not_cnt;
To run ...
set serveroutput on
declare
i number;
m varchar2(500);
c number;
begin
p_sql_valid_or_not_cnt('SELECT * FROM TAB where 1 <> 1',i,m,c);
DBMS_OUTPUT.PUT_LINE(i);
DBMS_OUTPUT.PUT_LINE(m);
DBMS_OUTPUT.PUT_LINE(c);
end;
This runs fine.
But when I try to access an object from a remote server using DB link. I get the error ...
set serveroutput on
declare
i number;
m varchar2(500);
c number;
begin
p_sql_valid_or_not_cnt('SELECT * FROM REMOTE_SCHEMA.T_REMOTE@REMOTE_SERVER where 1 <> 1',i,m,c);
DBMS_OUTPUT.PUT_LINE(i);
DBMS_OUTPUT.PUT_LINE(m);
DBMS_OUTPUT.PUT_LINE(c);
end;
declare
ERROR at line 1:
ORA-24374: define not done before fetch or execute and fetch
ORA-06512: at "SYS.DBMS_SYS_SQL", line 1125
ORA-06512: at "SYS.DBMS_SQL", line 328
ORA-06512: at "IMEPAS.P_SQL_VALID_OR_NOT_CNT", line 16
ORA-06512: at line 6
I can run the SQL that I am passing as vSQL directly in SQLPLUS ...
This code in itself works.
SELECT * FROM
REMOTE_SCHEMA.T_REMOTE@REMOTE_SERVER
where 1 <> 1;
The user I am using to logon to my server is also there on REMOTE_SERVER.
The DB LINK is created by CONNECTED USER option. The user on REMOTE_SERVER has explict select access on the table (not via role) I am accessing.
Any help would be much appreciated.
Maybe you are looking for
-
Selecting "Use Small Icons" in the Customize Toolbar window doesn't resolve the problem
-
Firefox freezes when saving, printing, or otherwise opening "sub-windows"
Firefox freezes when I open a window to save, print, etc. - not always, but far too often. If I dare try to choose another folder in which to save, I'm even more likely to make it freeze. When it happens for the first time after opening Firefox, I ca
-
Marketing Attributes and Segment Builder performance
Hello! Could you pls let me know 1. Maximum number of Marketing attributes one can create at - CRMD_PROF_CHAR - Maintain Attributes 2. What is the maximum number of BP's that can be taken into segment builder for Target Group creation with
-
Hi guys, does someone know the resolution of a facetime call?
-
Hello! I have Windows, and work with someone on a mac. 1. Can I edit a picture (jpg, gif, etc.) and send it to him? (i.e. will he be able to open it?) 2. On Word etc. if a picture has a white background (e.g. it was scanned in) on the picture toolbar