Compare/merge models and datatypes,stored procedures,packages
In the ddl scripts produces by compare/merge models functionality the stored procedures, packages and object types seems to be missing, it is a bug or the Data Modeler is designed in order to produce the stored procedures code only with the DDL generation functionality?
Could be possible iwith the data modeler generate fully the scripts of the changes comparing the prodution and the development database?
In the ddl scripts produces by compare/merge models functionality the stored procedures, packages and object types seems to be missing, it is a bug or the Data Modeler is designed in order to produce the stored procedures code only with the DDL generation functionality? It's not implemented - you can look at it as bug or missing functionality. Support for that will appear in future releases just matter of time - we didn't have support for packages in version 2.0.
Could be possible iwith the data modeler generate fully the scripts of the changes comparing the prodution and the development database?You see some elements are missing - yes for the rest.
Philip
Similar Messages
-
Creating Sap Crystal Report Through Oracle Stored Procedure Packages
Hi,
1.How we can create crystal report through oracle stored
procedure packages pls tell me the steps through adding command then
tell me the syntax what should i write in command to call the stored
procedure packages or if have some other option then also tell.
2.can
we link stored procedure column to other table column that used in
report.Hi Ganesh,
As this error comes when you are trying to insert non-numeric value into a numeric column in db it seems that your field might be numeric and you are trying to send it as a string in database.
Please check your Store Proc carefully..
Reference Thread: Oracle/PLSQL: ORA-01722
--Dhana -
Import only stored procedure packages
Hi,
I would like to import only stored procedure packages, procedures and functions (don't want
tables, views, etc.) from a dump file.
Can I do that?You can use exclude parameter of Datapump Import to exclude the tables and views.To know how to exclude tables this thread is helpful
http://forums.oracle.com/forums/thread.jspa?threadID=425226
And also for exclude and include this link is helpful
http://www.oracle-base.com/articles/10g/OracleDataPump10g.php -
Compare Merge Model problems with models from different connections
Hi all,
I've experienced a problem while using the compare/merge model funcion under tools.
Just to put in place:
I've 4 model, one for each enviroment that I have: DEV, INT, TEST, PROD(*each model imported from different connections*). Because I haven't found any reliable way to keep them sincronyzed, using DLL deltas. Is there a way to do that?
Anyway, regarding the main subject problem. Whem I try to sync for example, from PROD, to TEST, using compare/merge model function under tools, the process find the differences. When I selecte those that I want, and click on merge, the destination model TEST, get the selected objects merged into.
But now, the model Schema, when I select sincronyze model with data dictionary to get de DLL delta, things get crazy, and the merged objects doesn't get detected to be created.
If it's help, I think that the is with the associated import connection than the merged objects have. They have the PROD connection name, instead of the TEST connection name. Also when I try to syncronize the relational model againts de data dictionary(database), datamodeler ask me wich connection to use, PROD or TEST. When, before, merging, model, data modeler did not ask me anything.
Why is data modeler doing this?
What I have seen is when you import in a model things from different connections/models, when you try to sincronyze agains a connection, all objects that are not from the selected connection doesn't get compared.
Is there a bug or a problem?
How can I can keep a schema in different enviroments, sync? What are the step that I shoulf follow?
Thanks in advance.
Edited by: morfeo8marc on 14-mar-2012 11:17I shall try to explain what is happening here.
When you import objects from TEST data dictionary, their source information (see Summary info in Properties dialog) will refer to TEST.
The relational model for TEST will contain source information (see Summary info in Properties dialog) for the connection to TEST.
Similarly, imported objects from PROD will refer to the PROD data dictionary, and the PROD relational model will hold connection details for PROD.
If you merge PROD objects into the TEST model, they will retain their source information (i.e. referring to PROD).
The TEST model will be updated to include connection details to PROD.
When you synchronize a model, if it only has one source connection, it uses that.
If it has more than one, it will prompt you to decide to which data dictionary it should synchronize.
In your case, for the TEST data dictionary, it will synchronize all objects that have source information for TEST (i.e. those imported from TEST).
It will also compare any new objects (i.e. those not imported from a data dictionary).
It will not compare objects that were imported from a different data dictionary (e.g. PROD).
This supports the scenario where a model consists of objects imported from more than one data dictionary, and where the data dictionaries are maintained separately.
We may need to review the above strategy in light of your experience and development process.
In the meantime, may I suggest that from your updated TEST model, you Import from Data Dictionary using the TEST connection.
The resulting Compare Models dialog should show all objects (i.e. those from TEST and PROD).
You may need to set the Swap Models option to generate DDL with which to update your TEST data dictionary.
Thank you for raising this matter.
Regards,
Tony Rose -
Compare/Merge Models does not recognise changes to FK delete rules
Hi,
I think I have found some functional gap in the data modeler (Version 3.0.0.665) comparison tool. I'd be glad to learn that I am wrong, but otherwise please consider this for a future version.
Start with model "A"
Model "B" = "A" + changed delete rules for some foreign keys, e.g. from CASCADE to RESTRICT.
If I now compare A and B via Tools > Compare/Merge models, the ddl preview is empty.
I only realised that because I explicitly tried to change FK delete rules in my db. I guess that if you do delete rule changes on the side of many other changes, you might easily overlook that the according constraint changes are missing in the ddl.
Best regards,
MartinHi Martin,
thanks for feedback. I logged bug on that.
Philip -
Wrapped in a function and/or stored procedure, recursive CTE stops working
This query builds an hierarchical tree from a single table with the typical
value/reports_to_value columns.
When running in SQL manager returns like 7 records (note i'm avoiding infinite
loop by blocking top level value)
WITH c
AS
SELECT deptid, reports_to_dept
FROM glo_tree
WHERE deptid = '18538'
UNION ALL
SELECT t.deptid, t.reports_to_dept
FROM glo_tree T
INNER JOIN c
ON t.deptid = c.reports_to_dept
where t.deptid <> '00001'
SELECT deptid
FROM c
However, the exact same query, if wrapped in a function and/or stored procedure,
returns 0 records (no error message whatsoever)
CREATE FUNCTION [dbo].[checkDept] (@deptid varchar(16))
RETURNS TABLE
AS
RETURN
WITH c
AS
SELECT deptid, reports_to_dept
FROM glo_tree
WHERE deptid = @deptid
UNION ALL
SELECT t.deptid, t.reports_to_dept
FROM glo_tree T
INNER JOIN c
ON t.deptid = c.reports_to_dept
SELECT deptid
FROM c
GO
CREATE PROCEDURE [dbo].[getDept] (@deptid varchar(16))
AS
SELECT deptid
FROM dbo.checkDept(@deptid)
Then call them like:
select * FROM checkDept('18538')exec getDept @deptid='18538'
Both return nothingThanks Patrick, i don't think it can do that, i call it like:
select * FROM checkDept('18538')exec getDept @deptid='18538'Just to make sure, i've changed the function like:WHERE ltrim(rtrim(deptid)) = @deptidStill the same thing -
Can we have an example of using update, insert, and delete stored procedure
I would like to see an example of using retrieve (return resultset), update, insert, and delete stored procedures in JSF. I need to see syntax how JSF can call those stored procedures. This option is absolutely important when building web-application. Currently, I haven't found resource to do for this purpose yet. The database can be any such Oracle, DB2, pointbase, etc that support stored procedures.
Anyone knows?
Thanks,
Tue VuHi ttv,
I asked around a bit and here's some more info:
To bind a ResultSet to a read only Data Table component just set the "value" property of the Data Table component to point at it, and JSF will synthesize a DataModel around it.
* Note that because we can't call the stored procedure at design time, Creator can't do the fancy table layout stuff it does for rowsets. You'll need to hand craft the columns just like the Google Client example.
* As I mentioned previously, you will have to manually code the stored procedure access in your java code - see the code clip I mentioned in previous reply (and if this is via a stored procedure, then any textbook about JDBC will undoubtedly have examples). Simplest way might be a getter method on the page bean that contains the call to the stored procedure and returns the resulting ResultSet object.
* Don't forget to close the result set - we typically do this at the end of the request (i.e. add a close in the afterRenderResponse() method.
* Don't throw exceptions - or if you have to, make sure you close the result set in a finally clause (thrown exceptions bypass the afterRenderResponse method in the lifecycle).
* You give up on the caching provided by our RowSetDataModel (which can't be connected to a ResultSet even manually), so I would recommend that you only use datatables to display the data and then go to a single row page to do edits/deletes (similar to the TwoPage example in AppModel and the Update, Insert Delete tutorial).
And yes please do submit an example - we will gladly post it!!! :) The best way to submit this kind of thing would be through:
http://developers.sun.com/prodtech/javatools/jscreator/reference/codesamples/sampleapps.html
on the right side, Related Links, under Creator Heros, click Submit Content and there you can send it in!
Hope this helps!
Val -
About BC4j and java stored procedure
Is it possible create a java stored procedure using BC4j and deploy to Oracle9iR2 VM?
If it is possible, how about the performance compare to PL/SQL stored procedure?In 9.0.3.3 it will be possible again. The ability to deploy a BC4J-based, local-mode Java Stored Procedure was broken in 9.0.3 before this upcoming maintenance release.
PL/SQL will almost surely be faster if you are talking about just doing basic DML type of operations, when compared to Java stored procedures. -
Help Needed in Creating Java Class and Java Stored Procedures
Hi,
Can anyone tell how can i create Java Class, Java Source and Java Resource in Oracle Database.
I have seen the Documents. But i couldn't able to understand it correctly.
I will be helpful when i get some Examples for creating a Java Class, Java Source and Stored Procedures with Java with details.
Is that possible to Create a Java class in the oracle Database itself ?.
Where are the files located for the existing Java Class ?..
Help Needed Please.
Thanks,
Murali.vHi Murali,
Heres a thread which discussed uploading java source file instead of runnable code on to the database, which might be helpful :
Configure deployment to a database to upload the java file instead of class
The files for the java class you created in JDev project is located in the myworks folder in jdev, eg, <jdev_home>\jdev\mywork\Application1\Project1\src\project1
Hope this helps,
Sunil.. -
Creating and calling stored procedure using jdbc
When I try to create and call a stored procedure using JDBC a very confusing error message about non-existence of the procedure just created is thrown. Using Informix database (IDS 10). Any pointers to point out what am doing wrong would be great!
Thanks
import java.io.FileNotFoundException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Scanner;
public class CreateStoredProc {
public static void main(String args[]){
if (0 == args.length)
return;
try {
Class.forName("com.informix.jdbc.IfxDriver");
Connection conn = DriverManager.getConnection("jdbc:informix-sqli://10.76.244.120:30000/sampledb:INFORMIXSERVER=krisunda;user=root;password=cisco");
String q = " create procedure runproc() "+
" define i int; "+
" let i = 0; "+
" end procedure; "+
" execute procedure runproc(); ";
Statement stmt = conn.createStatement ();
stmt.execute (q);
} catch (Exception e) {
e.printStackTrace();
The stack trace:
java.sql.SQLException: Routine (runproc) can not be resolved.
at com.informix.jdbc.IfxSqli.a(IfxSqli.java:3204)
at com.informix.jdbc.IfxSqli.E(IfxSqli.java:3518)
at com.informix.jdbc.IfxSqli.dispatchMsg(IfxSqli.java:2353)
at com.informix.jdbc.IfxSqli.receiveMessage(IfxSqli.java:2269)
at com.informix.jdbc.IfxSqli.executeExecute(IfxSqli.java:2157)
at com.informix.jdbc.IfxSqli.executeExecute(IfxSqli.java:2132)
at com.informix.jdbc.IfxResultSet.b(IfxResultSet.java:378)
at com.informix.jdbc.IfxStatement.a(IfxStatement.java:1299)
at com.informix.jdbc.IfxStatement.executeImpl(IfxStatement.java:1269)
at com.informix.jdbc.IfxStatement.c(IfxStatement.java:989)
at com.informix.jdbc.IfxStatement.execute(IfxStatement.java:875)
at CreateStoredProc.main(CreateStoredProc.java:37)
Caused by: java.sql.SQLException
at com.informix.util.IfxErrMsg.getSQLException(IfxErrMsg.java:373)
at com.informix.jdbc.IfxSqli.E(IfxSqli.java:3523)
... 10 moreDriverManager.getConnection("jdbc:informix-sqli://10.76.244.120:30000/sampledb:INFORMIXSERVER=krisunda;user=root;password=cisco");check with ur sys admin wheather the particular user in the database has >execute privilage(rights) also.i mean execute the SP in the DB level.I guess that a root user will have the enough right.
String q = " create procedure runproc() "+
" define i int; "+<" let i = 0; "+
" end procedure; "+
" execute procedure runproc(); ";
Statement stmt = conn.createStatement ();
stmt.execute (q);Try to use the following code:
String q = " create procedure runproc() "+
" define i int; "+
" let i = 0; "+
" end procedure; "
Statement stmt = conn.createStatement ();
stmt.execute (q);
q=" execute procedure runproc(); ";
stmt.execute (q);
Because maybe the driver failed to precompile your sql once, so that nothing happen. -
JDBC Thin-Driver and Oracle Stored Procedure
I've got a Oracle stored procedure which returns a Oracle record.
How can I retrieve the record in java using the JDBC Thin-Driver ?
Record:
TYPE messagerec IS RECORD
(log_level VARCHAR(2), timestamp VARCHAR2(19), text VARCHAR2(200));Using PL/SQL BOOLEAN, RECORD Types, and TABLE Types:
Oracle SQLJ and JDBC do not support calling arguments or return values of the
PL/SQL BOOLEAN type or RECORD types. Also, when using the Thin driver, they
do not support calling arguments or return values of PL/SQL TABLE types (known
as indexed-by tables). TABLE types are supported for the OCI driver.
Check the following guide,
http://otn.oracle.com/tech/java/sqlj_jdbc/pdf/a96655.pdf -
Scripted JDBC and Oracle Stored Procedure with in/out Array
The com.waveset.util.pooledconnection used by Scripted JDBC Adapter extends java.sql.connection.
I need to pass an Varchar2 Array to the Stored Procedure. I tried using the oracle.sql.ARRAY and oracle.sql.ArrayDescriptor to pass the values, but get a casting exception,as the polledconnection implements only the java.sql.connection and not oracle.sql.connection.
What are my options of using java.sql.Array with a PL/SQL procedure that takes a varchar2 array as in out parameter?
Thanks
Venkii ran my procedure which is very similar syndra posted
create or replace procedure foo(p_dt in date, cv out sys_refcursor) as
begin
open cv for
select e.*
from table_xyz e
where start_dt = p_dt;
end;
/Here is how is executed
DECLARE
P_DT DATE;
CV SYS_REFCURSOR;
BEGIN
P_DT := '10-oct-2005';
-- CV := NULL; Modify the code to initialize this parameter
scott.foo ( P_DT, CV );
COMMIT;
END;
-- i get PL/SQL procedure successfully complted , But i dont see the result set Or output
- How do i see the output when i m using refcursor ?? i tried using print , but nothing didnt work
- Any idea ??
Thank you!!
Edited by: user642297 on Jun 24, 2010 1:35 PM -
SQLJ and Java Stored Procedures
Hi,
Am very sorry, if I am taxing you too much with Java Stored Procedures!!
However, I have struggling with it for more than 3 days or so.So please bear with me
I am facing a peculiar problem on the subject.
I have deployed a Java Stored Procedure using Connection name as "JDBC" through JDev.
My client calls the Stored procedure getDept as follows:
int deptNo = 0;
String deptName = null,
deptLoc = null;
#sql {
call sample.getDept( :out deptNo,
:out deptName,
:out deptLoc)
In my project properties , in SQLJ tab, when I select "JDBC" as my connectionName, and leave the ContextName blank(i.e. DefaultContext), I get the following error :
Error: [26] Not Found: SAMPLE.GETDEPT There is no stored procedure with this name
When I leave the ConnectionName as blank (which I suppose means donot do online checking!!), it compiles OK.
Howvever, it is not able to run my SQLJ file!!
Cannot figure out why this is happening.Please help!!
TIA
Sandeep
nullLooks like Java stored procedure don't support the return of result sets to the client. Given the complexity and non-generic 'cursor ref' approach that Oracle has always implemented, I guess it is not too surprising. I suggest throwing the select into a work table and pulling the rows from there. If you are in a COM capable environment, you can use 0040 to get back a Dynaset, but be aware, it is live!
Good luck.
Cal -
Could anyone answer the following questions ?
1. Will Enterprise Manager Version 2.2 and 9.2 tune Java Stored Procedures?
2. If not, are there plans in EM 4.0 for Enterprise Manager to tuneJava Stored Procedures?
cheers!
KarthikHi again,
perhaps I didn't understand exactly what you meant with "publish", AFAIK you have to expose the java class (i.e. RowCounter) by using
CREATE OR REPLACE FUNCTION row_count (tab_name VARCHAR2) RETURN NUMBER
AS LANGUAGE JAVA
NAME 'RowCounter.rowCount(java.lang.String) return int';
(BTW this works fine)
or else you cannot access the java class you loaded on the server, and that's where my questions arose. What if I am passing an object, let's say myObject, shouldn't I use the STRUCT mapping then or something like that?
Or, could you clarify what do you mean by publishing to SQL, I just need to access the class from jdbc, not from PL/SQL or others, but as I understand to call the class from JDBC I need to call the function or procedure that calls the class and then I could call it from PL/SQL as well...
Thanks,
A. -
Jdbc and java stored procedures
Hi all,
I am new to Oracle Java Stored Procedures but I am interested in knowing to which extent is object passing supported.
Can I send any kind of object to a java stored procedure? And back from the procedure? Anybody knows any good resources online about Java Stored Procedures and JDBC?
I also saw that to pass the string back you need to specify java.lang.string, how would I do in order to pass back a user defined object, do I have to register the class in Oracle before (and if yes, how?)or is the classpath enough?
Many thanks,
A.Hi again,
perhaps I didn't understand exactly what you meant with "publish", AFAIK you have to expose the java class (i.e. RowCounter) by using
CREATE OR REPLACE FUNCTION row_count (tab_name VARCHAR2) RETURN NUMBER
AS LANGUAGE JAVA
NAME 'RowCounter.rowCount(java.lang.String) return int';
(BTW this works fine)
or else you cannot access the java class you loaded on the server, and that's where my questions arose. What if I am passing an object, let's say myObject, shouldn't I use the STRUCT mapping then or something like that?
Or, could you clarify what do you mean by publishing to SQL, I just need to access the class from jdbc, not from PL/SQL or others, but as I understand to call the class from JDBC I need to call the function or procedure that calls the class and then I could call it from PL/SQL as well...
Thanks,
A.
Maybe you are looking for
-
Payed twice for the same App. How can this be and how do I get my money back?
Hello! I had a MBP and downloaded Adobe Photoshop. I paid for it. Then I had to set up the whole MBP again and Adobe was gone of course. I downloaded it again. Thinking, I wouldn't have to pay this time. But I had to!! Now that I would need the Photo
-
Please reply ;3
-
Query performance tuning beyond entity caching
Hi, We have an extremely large read-only dataset stored using BDB-JE DPL. I'm seeking to tune our use of BDB while querying, and I'm wondering what options we have beyond simply attempting to cache more entities? Our expected cache hit rate is low. C
-
WDS does not seem to increase strength of my network
Hi all, I have an older flying saucer Airport Extreme a/b/g (think it is snow model it has two ethernet ports and usb but no phone connection about 6 years old) and also a new Airport express b/g/n about 1 year old. When I first bought the express I
-
Duplicate pages resulting from PDF conversion
Hello! I've run into an issue I've never seen happen before: When converting a 26-page Word file to PDF, the resulting PDF file duplicates 5 pages of the Word file inappropriately. That is, Table 2 (which breaks across a few pages), is interrupted by