Problem in generating packaged functions!!!!!
Does anybody know how to restrict generating packaged
functions just in package script file?
Generating packaged function, they are generated
both in function script file and package script file
while I need just in package script file.
I think that by default the functions are included in the application default implementation as you create them. If you also include them in a package then they will be generated twice when the implementation is generated.
If this is the case then simply delete the functions from the implementation, leaving just the package to be implemented and then everything should be ok.
Regards,
Steve
Similar Messages
-
Problem calling a packaged function from an authorization scheme
I wrote a package and body called pkg_auth with a function returning a boolean called is_authorized with 2 parameters (username and functional area).
i.e.
CREATE OR REPLACE PACKAGE pkg_auth
AS
FUNCTION is_authorized(p_username VARCHAR2, p_functional_area VARCHAR2) RETURN BOOLEAN;
END;
additionally i created a public synonym for it and granted execute access on it to apex_public_user and htmldb_public_user;
i then created an authorization scheme called 'access_control_db' defined as Scheme Type 'PLSQL Function Returning Boolean' and placed the following:
pkg_auth.is_authorized(v('APP_USER'),'DATABASE')
in the Expression 1 field.
and the following:
Not permitted to edit database information.
in the error field.
However when I apply this authorization scheme to a buton I receive the following error when I go to the page containing that button:
ORA-06550: line 1, column 44: PLS-00221: 'IS_AUTHORIZED' is not a procedure or is undefined ORA-06550: line 1, column 44: PL/SQL: Statement ignored
Error ERR-1082 Error in executing authorization scheme code.
Any help would be most appreciated.Hello,
Does putting 'return' infront -
return pkg_auth.is_authorized(v('APP_USER'),'DATABASE')fix your problem?
John.
Blog: http://jes.blogs.shellprompt.net
Work: http://www.apex-evangelists.com
Author of Pro Application Express: http://tinyurl.com/3gu7cd
REWARDS: Please remember to mark helpful or correct posts on the forum, not just for my answers but for everyone! -
JPublisher generated wrapper package function name contains "ORIG_PKG"$FN
jPublisher generated wrapper package function name contains "ORIG_PKG"$FN
which shows compilation error as
Compilation errors for PACKAGE BODY <schema>.JPUB_PLSQL_WRAPPER
Error: PLS-00181: unsupported preprocessor directive '$FN'
Line: 2699
Text: FUNCTION "ORIG_PKG"$FN (P_SOURCE VARCHAR2,
Along with this, the generated .sqlj file have a calling sqlj content having the same format as
#sql [getConnectionContext()] __jPt_result = { VALUES(JPUB_PLSQL_WRAPPER."ORIG_PKG"$FN( ...
This also show sqlj compilation error such as
Error(91,5): Expected "$FN" and found ")" instead.
and a warning
Warning(91,5): Invalid SQL syntax at:
JPUB_PLSQL_WRAPPER."ORIG_PKG"$FN(
^^^^
Encountered "$FN" :
Was expecting one of:
<EOF>
"AND" ...
"BETWEEN" ...
"IN" ...
"IS" ...
"LIKE" ...
"NOT" ...
"OR" ...
"ROW" ...
"AT" ...
"MOD" ...
"RANGE" ...
<CONCAT_OP_> ...
Any suggestion would be helpful. thank you.Just to put a proper closure to this thread, there were 2 issues with the Jdev version I was using (11.1.2.0.0)
1) Wrapper for PL/SQL not getting generated properly.
2) Webservice proxies are not getting generated properly.
The 2 issues were taken care by generating the wrapper and proxy on a much higher version of Jdev. -
Revision: 4184
Author: [email protected]
Date: 2008-11-25 12:33:43 -0800 (Tue, 25 Nov 2008)
Log Message:
Fix for @see tag referencing a non-global package function generates an empty link@href in DITA
Also now the deprecated should show up in the property and method summary table.
and when @see results in an invalid href, an additional attribute called invalidHRef will be added to the dita file - this isn't picked up by xslt but will be consumed by FB.
QE Notes: Some baselines may need to be updated due to new attribute for invalidHRef
Doc Notes: None
Bugs: SDK-18206
tests: checkintests
Ticket Links:
http://bugs.adobe.com/jira/browse/SDK-18206
Modified Paths:
flex/sdk/trunk/asdoc/templates/asdoc-util.xslt
flex/sdk/trunk/asdoc/templates/class-files.xslt
flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/asdoc/TopLevelClassesGenerator.ja vaUpdate!
v3.1 has a major bug! Even though it may appear to work properly, strange characters may leak onto the end of URLs, and you may even get segfaults. Sorry I didn't properly test it before releasing it!
Technical details:
I calloc()ed the memory for the link href improperly, per:
link = calloc((noprepend ? 0 : urllen) + i - s, 1);
Once I fixed it with "+ 1", per:
link = calloc((noprepend ? 0 : urllen) + i - s + 1, 1);
it worked great.
I may use a method that doesn't use a calloc() in the future; this works for now, and I'm not gonna knock it...
Last edited by dav7 (2009-01-23 12:38:51) -
Yaourt: Problems installing generated AUR packages [SOLVED]
Hello.
I'm using Archlinux and the system works flawessly. Sadly, there's a problem when trying to install AUR packages.
The following happens installing any AUR package I tried lately.
==> Continue installing wicked-git? [Y/n]
==> [v]iew package contents [c]heck package with namcap
==> ----------------------------------------------
==>y
loading package data...
error: './wicked-git-20090112-1-i686.pkg.tar.gz': cannot open package file
==> WARNING: Your package is saved in /tmp/yaourt-tmp-timofonic/wicked-git-20090112-1-i686.pkg.tar.gz
cp: cannot stat `./wicked-git-20090112-1-i686.pkg.tar.gz': No such file or directory
==> WARNING: Unable to copy wicked-git-1-i686.pkg.tar.gz to /tmp/yaourt-tmp-timofonic/ directory
Any idea about how to fix it? I tried using both an user with sudo and root, same problem.
Regards.
Last edited by timofonic (2009-07-14 19:52:53)lilsirecho wrote:
Perhaps the method to use is given by the man pacman files.
pacman -U (.pkg.tar.gz package ID found in the directory generating the package)
For example: ...pacman -U /var/local/kernel26-2.6.30-5-x86-64.pkg.tar.gz......since the pkg generated is in that directory for this theoretical case.
Any locally generated package is loaded with ...pacman -U....
What do you mean? The package doesn't exist, I double checked it.
Maybe I need to check where yaourt writes it. Any suggestion about what util to use for that?
EDIT: I used "lsof" command and found the file is there, but yaourt can't locate it and deletes the directory after
$ ls /tmp/yaourt-tmp-root/aur-wicked-git/wicked-git/w*
/tmp/yaourt-tmp-root/aur-wicked-git/wicked-git/wicked-git-20090708-1-i686.pkg.tar.gz
/tmp/yaourt-tmp-root/aur-wicked-git/wicked-git/wicked-git-20090709-1-i686.pkg.tar.gz
Please, could anyone help me to solve this problem?
Last edited by timofonic (2009-07-09 22:08:47) -
2.1.0.62: Problem with Package.Functions and Unit Tests
I like the new Sqldeveloper - I startet trying Unit Tests as described here: Link: [http://www.oracle.com/technology/obe/11gr2_db_prod/appdev/sqldev/sqldev_unit_test/sqldev_unit_test.htm#t4]
It worked with a test-procedure. Now i am trying to test my package functions, but all i get is this:
Die folgende Prozedur wurde ausgeführt.
Ausführungsaufruf
BEGIN
:1 := "PKG_MYPACK"."CREATEFUNCTION"(IN_PROGRAMMEID=>:2,
IN_AMOUNT=>:3,
IN_SWS=>:4);
END;
Bind-Variablen verwendet
1 INTEGER OUT (null)
2 INTEGER IN 1
3 INTEGER IN 10
4 INTEGER IN 11
Ausführungsergebnisse
ERROR
Ungültige Konvertierung angefordert
oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)
oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:110)
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:171)
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:227)
oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:439)
oracle.jdbc.driver.OraclePreparedStatement.setObjectCritical(OraclePreparedStatement.java:7723)
oracle.jdbc.driver.OraclePreparedStatement.setObjectInternal(OraclePreparedStatement.java:7496)
oracle.jdbc.driver.OraclePreparedStatement.setObjectInternal(OraclePreparedStatement.java:7978)
oracle.jdbc.driver.OracleCallableStatement.setObject(OracleCallableStatement.java:4063)
oracle.jdbc.driver.OraclePreparedStatementWrapper.setObject(OraclePreparedStatementWrapper.java:221)
oracle.dbtools.raptor.datatypes.strategies.callablestatement.CallableBindingDatum.customBindIN(CallableBindingDatum.java:135)
oracle. ...
what can i do?Created
Bug 8976245 - EA1: UNIT_TEST: INVALID CONVERSION ERROR USING INTEGER PARAMETER
and have asked bug responder to keep you updated on status here in the forum.
Bad news is that any INTEGER parameter for which you specify a non-null value will fail.
Possibly helpful news is that if you create a 'clone' of you function using NUMBER as the data type, you can continue to experiment with how unit testing may be of use to you.
Sorry no instant answer. :(
Brian
SQL Developer Team -
How to use type, packages, functions, and procedures in another schema ?
I have two target schema in one OWB project, such as A and B. In a mapping of A, I would like to use some types, packages, functions, and procedures from B. I have tried the method of synonym as suggested, but I could not find the metadata of these when importing ... The only type of synonym I can import is the synonym for table. Is there a bug for synonym?
If I cannot use synonym for this issue, is there another way to solve the problem?Now, in some instances you will absolutely need to create the second module as Carsten describes, however it should also be noted that you can reference objects in things like Expressions even if you have not loaded up the metadata. It is only when you need strong binding that it becomes neccessary to import objects. For everything else, as long as the reference will resolve at compile-time then you are good to go.
For example, I have a function in one target schema (S1) and a private synonym to it in another(s2). A mapping in the S2 schema has an expression object that uses the synonym to the function in the expression property for a couple of the output attirbutes. The synonym has not been loaded into metadata - indeed OWB has no knowledge of its existance. But it resolves at compile time so the mapping validates and generates successfully.
Mike -
ORA-00904 and packaged function in report
Oracle 9.2.0.7
APEX 2.0
Is APEX not able to deal with SQL that calls a packaged function?
I ask because I'm able to execute this query:
SELECT s.doc_id,
s.last_name || ', ' || s.first_name full_name,
s.p_id,
s.create_date
, rwa_wfrole.get_role_list(s.proj_id, s.p_id) wfrole_label
FROM signatures_vw s
WHERE s.proj_id = 182
AND s.status = 'APPROVED'
ORDER BY s.create_date, s.last_name, s.first_name
in SQL*Plus, but not in the SQL Workshop or in a report region. In the latter case I get "ORA-00904 invalid identifier" for "rwa_wfrole.get_role_list"... which is a packaged function. Actually, to be more precise, it's a package in a remote database. In the APEX instance, I have a synonym pointing to it.
Thanks for insight.
-JohnI can't reproduce this in 10g. I did find bug 4177810 (Fixed in 9.2.0.8 Server Patch Set) that looks a bit like this problem.
Description
An unexpected ORA-904 can occur for some internally generated SQL
when the select list contains non-column constants and the select
appears in the FROM clause. This can occur for SQL produced for
parallel query or for remote / distributed queries.
Workaround:
Rewrite the query to avoid constant expressions in the FROM clause select lists.***************************
There are also recommendations dating way back that you should include the schema name in the Create Synonym statement.
Scott -
Calling Oracle Package Function from Visual Basic
Hi,
Oracle Client 8.04
Oracle ODBC Driver 8.00.04
VB 6.0
Windows 2000
I'm stumped here. I want to have a Oracle stored procedure run a
query and return a result set which I can assign to a recordset
object in VB. Based on things I've read here and on MS's site,
here's what I've done:
In the Oracle Schema Manager under the Packages folder I created
the following package:
PACKAGE test
IS
TYPE test_cur IS REF CURSOR;
FUNCTION mycur RETURN test_cur;
END test;
and under the Package Body folder created:
PACKAGE BODY test
IS
FUNCTION mycur RETURN test_cur
IS
c_return test_cur;
BEGIN
OPEN c_return FOR
SELECT * FROM table_A;
RETURN c_return;
CLOSE c_return;
END mycur;
END test;
They both compile without errors and in Oracle SQL Worksheet I
can enter the following:
variable x refcursor;
execute :x :=test.mycur;
print x;
and the query results are displayed as expected.
The problem is trying to get the result back into a VB recordset
object.
In VB 6.0 I have done this:
Dim RS As ADODB.Recordset
Dim Conn As ADODB.Connection
Dim sConnection As String
Dim sSQL As String
sSQL = "{call test.mycur}"
sConnection = "Provider=MSDASQL;UID=" & sUserID & ";PWD=" &
sPassword & ";Driver={Microsoft ODBC for Oracle}; Server=" &
sInstance & ";"
Conn.Open sConnection
RS.CursorLocation = adUseClient
RS.Open sSQL, Conn, adOpenForwardOnly, adLockOptimistic,
adCmdStoredProc ' or adCmdText
but get:
?err.Number -2147217900
?err.Source Microsoft OLE DB Provider for ODBC Drivers
?err.Description [Microsoft][ODBC driver for Oracle]Syntax error
or access violation
The problem is not with the connection or permissions, since the
query works fine when I just use the select statement in the
package function as the string, instead of calling the function
in the package (eg sSQL = "Select * from table_A") and can
process the resulting recordset in VB.
I've also tried variations using:
Set RS = Conn.Execute("{call test.mycur}")
or using a Command object something like:
Dim com As ADODB.Command
Set com = New ADODB.Command
With Conn
.ConnectionString = sConnection
.CursorLocation = adUseClient
.Open
End With
With com
.ActiveConnection = Conn
.CommandText = sSQL
.CommandType = adCmdText
End With
Set RS.Source = com
RS.Open
But still get the same errors. Any help is appreciated. Also, in
my package body, is it necessary to explicitly close the cursor,
or does the function just exit when it executes the return and
not ever hit the close statement?
Thanks,
Ed HollomanHi
i don't know if you got your answer, but i work with VB and
Oracle.
the procedure in the DB should have the cursor like you writen
in your mail.
to call a procedure in Oracle and get the data back
into a recordset you shuld use a Command object like this:
Dim conn As ADODB.Connection
Dim cmd As ADODB.Command
Dim rs As ADODB.Recordset
Set conn = CreateObject("adodb.connection")
Set cmd = CreateObject("adodb.command")
Set rs = CreateObject("adodb.recordset")
With conn
.ConnectionString = ""
.CursorLocation = adUseClient
.Open
End With
'THE IMPORTENT SECTION IS THIS WHERE YOU SET THE COMMAND TO THE
STORE PROCEDURE TYPE
With cmd
.ActiveConnection = conn
.CommandText = "proc.fun"
.CommandType = adCmdStoredProc
End With
'Then you set the rs to the command
Set rs = cmd.Execute
Set conn = Nothing
Set rs = Nothing
Set cmd = Nothing -
Regarding Packaged function...!
Hi,
i have a packaged function which i am trying to use in my
report query....
i am passing 2 params for this function.....
one is report parameter and the other one is a col in the select query....
so i need to get rows returned based on the conditon satisfying in the query...!
i have a select stat for each condition which will return one column value to the
local variable which i am trying to check in the condition....
My problem is whenever i am running it it's get hanged or it takes a lot of time..
if iam hard coding the parameter value it's fetching records...
plz do the needful....
select
a.latest_version_no,
a.custom_ref_no,
d.customer_name1,
etc.....
etc.....
from
cstbs_contract a,
fxtbs_contract_master b,
cstbs_contractis c,
sttms_customer d
where
a.contract_ref_no=b.contract_ref_no
and
a.latest_version_no=b.version_no
and
b.contract_ref_no = c.contract_ref_no
and
d.customer_no=b.counterparty
and
NVL(b.netting_status,'N') ='N'
AND
b.VERSION_NO = (SELECT MAX(M1.VERSION_NO) FROM FXtbs_contract_master M1 WHERE M1.CONTRACT_REF_NO = B.CONTRACT_REF_NO)
AND
B.CONTRACT_REF_NO IN(SELECT PK_RET_ROWS.FN_RET_ROWS(:P_INST_CHANGE,'FXWFWXP023290102') FROM DUAL)Ravi
For one thing you could avoid the unnecessary select from dual:
AND B.CONTRACT_REF_NO IN(SELECT PK_RET_ROWS.FN_RET_ROWS(:P_INST_CHANGE,'FXWFWXP023290102') FROM DUAL)can be changed to:
AND B.CONTRACT_REF_NO = PK_RET_ROWS.FN_RET_ROWS(:P_INST_CHANGE,'FXWFWXP023290102')You could simplify further, to make sure you only evaluate the function once, and definitely drive off M1, then B:
AND (B.CONTRACT_REF_NO, B.VERSION_NO) = (
SELECT M1.CONTRACT_REF_NO, M1.VERSION_NO
FROM FXtbs_contract_master M1
WHERE M1.CONTRACT_REF_NO = PK_RET_ROWS.FN_RET_ROWS(:P_INST_CHANGE,'FXWFWXP023290102')
)As for the speed: if you still have a problem, check you have the right indexes (eg on CONTRACT_REF_NO and (LATEST_)VERSION_NO for M1, A, B, C and on D.CUSTOMER_NO)?
HTH
Regards Nigel -
Using packaged functions in Apex
Hi,
I'm fairly new to apex and I am about to write an app which needs to access a SQL server database. My local dba has set up the transparent gateway and I can select from and update the SQLServer database no problem via a db link. What I need to decide is whether to code the sql for reports etc directly into the apex page or to call a pl/sql function returning a select statement. I would like to have all the code in packages as a lot of it will be used by multiple apps in future but is there any extra overhead in doing this:
declare
l_sql varchar2(4000);
begin
select package.function into l_sql from dual;
return l_sql;
end;
rather than coding the SQL directly in the page? Also is there a more efficient way of using packaged functions to select data rather that just have it returning sql statements.
Thanks in advance.
DaveHi
I only use function returning select when I have a strong reason to do so, because it is so much more difficult to test and maintain. Not sure about performance, but I think it is not that much worse.
If you simply want to reuse SELECT statements, you could use views instead.
Anyway, if you decide to use the package solution, at least you can make it much simpler -- just code like this in the page:
return package.function;
I hope this helps.
Luis -
Problem with generate sine 50 Hz
I have a problem with generate sine voltage with freq 50 Hz.
I form waveform with this frequency and sent in to the "AO Write" with update rate equal waveform lenght*frequency. And so I have a cycle of my program 20 ms, but I need a cylce 5 ms.
How I can make it right?
I forming my waveform "Basic Function Generator" with sampling Info equal my waveform lenght.
Message Edited by Unk on 09-28-2005 02:36 PMThe
amplitude
phase
frequency
of the signal are independent parameters.
You can generate the relevant signal using Basic Function Generator VI, then supply this waveform to your AO operation (DAQmx write is polymorphic and allows you to use a waveform directly as the input - those guys at NI are clever ) -
Problem with oracle packages CREATE PACKAGE some packagename in MaxDB
Hi All,
I am having Problems in Creating Packages from MaxDB ..Does MaxDB supports the CREATE PACKAGE <some packagename>concept ? if so please help me how to achieve in creating packages ..
My sample Oracle package Creation is as follows:
CREATE OR REPLACE PACKAGE BODY acs
AS
FUNCTION add_user (
user_id IN users.user_id%TYPE DEFAULT NULL,
object_type IN acs_objects.object_type%TYPE DEFAULT 'user',
creation_date IN acs_objects.creation_date%TYPE DEFAULT sysdate,
creation_user IN acs_objects.creation_user%TYPE DEFAULT NULL,
creation_ip IN acs_objects.creation_ip%TYPE DEFAULT NULL,
) RETURN users.user_id%TYPE
IS
v_user_id users.user_id%TYPE;
v_rel_id membership_rels.rel_id%TYPE;
BEGIN
v_user_id := acs_user.new (user_id, object_type, creation_date,
creation_user, creation_ip, email, ...
RETURN v_user_id;
END;
END acs;
show errors Can you Please Explain me how to write the same Package in MaxDB?
Thanks & Regards,
Shanmukh
Edited by: shanmukh babu on May 16, 2008 10:11 AMHi Shanmukh,
MaxDB does not have packages like you'll find them in Oracle.
But you can define your own functions and procedures.
From the code-example you posted, I would say that a procedure will do it ...
I suggest that you first read the documentation on procedures [CREATE DBPROC Statement|http://maxdb.sap.com/doc/7_6/a7/41ee11605911d3a98800a0c9449261/frameset.htm]
There you'll also find an example in the Tutorial section.
Be aware that the procedural capabilities of MaxDB are far less enlarged as in Oracle - but they do exist and work in their realm.
So porting a full PL/SQL application layer to MaxDB procedures may turn out to be quite difficult and/or not the best choice at all.
KR Lars -
Calling a package function inside a sql
Hi friends!!!
First of all happy Christmas! And them please help! :)
We have a query calling a package function:
SELECT * FROM DW025H WHERE DW025H_NR=MPPCI.ENCR ('0000000000000000');There is a primary key just with one column DW025H_NR and the problem is that is not accessing by INDEX UNIQUE SCAN,
it's accessing by TABLE ACCESS FULL.
May be the problem is that we are calling a procedure inside the query?
I have been able to run that query accessing by primary key from my computer but a workmate hasn't!
We both are connecting the same data base 10.2.0.4 and using Oracle SQL Developer!
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 5343K| 1406M| 15670 (7)| 00:02:43 |
|* 1 | VIEW | DW025H | 5343K| 1406M| 15670 (7)| 00:02:43 |
|* 2 | FILTER | | | | | |
| 3 | TABLE ACCESS FULL| DW025H | 5343K| 1406M| 15670 (7)| 00:02:43 |
Predicate Information (identified by operation id):
1 - filter("DW025H_NR"="MPPCI"."ENCRIPTAPAN"('0000000000000000'))
2 - filter(CASE "OPS$SISINFO"."IS_USER_DNI"() WHEN 1 THEN
SYS_AUDIT('OPS$SISINFO','DW025H','CMINFOGR001',3) ELSE NULL END IS
NULL)
The correct path would be:
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 1 | 276 | 3 (0)| 00:00:01 |
|* 1 | FILTER | | | | | |
| 2 | TABLE ACCESS BY INDEX ROWID| DW025H | 1 | 276 | 3 (0)| 00:00:01 |
|* 3 | INDEX UNIQUE SCAN | PK_DW025H | 1 | | 2 (0)| 00:00:01 |
Predicate Information (identified by operation id):
1 - filter(CASE "OPS$SISINFO"."IS_USER_DNI"() WHEN 1 THEN
SYS_AUDIT('OPS$SISINFO','DW025H ','CMINFOGR001',3) ELSE NULL END IS NULL)
3 - access("DW025H_NR"="MPPCI"."ENCR"('0000000000000000'))
Please any ideas!?!?!
Thanks a lot!
José
Edited by: jamv on Dec 20, 2011 10:50 AMHello
Have a read of this and try to pull together the information in it and post it up here. That will help immensely with getting to the root of your problem...
HOW TO: Post a SQL statement tuning request - template posting
In the mean time:
From the execution plan you have extra predicates that aren't present in the query you supplied, so that's either not the SQL or you have something like VPD switched on.
Anyway, there could be lots of reasons for the difference in execution plan. Sorry if this is very basic and possibly patronising question but it's always worth checking the basics I think - are you both definitely connecting to the same database? If so, have a look in v$sqlarea for this SQL statement and find the SQL_ID, use this to query v$sql and look at the child_number column.
select
sql_id
from
v$sqlarea
where
sql_text like '%SELECT * FROM DW025H WHERE DW025H_NR=MPPCI.ENCR%(''0000000000000000'')%'
and
sql_text not like '%v$sqlarea%'
select child_number from v$sql where sql_id='<enter the sql id returned by the query above>'as an example...
XXXX> select /* my sql statement*/ rownum id from dual;
ID
1
1 row selected.
Elapsed: 00:00:00.10
XXXX> select sql_id from v$sqlarea where sql_text like '%my sql statement%'
and sql_text not like '%v$sqlarea%';
SQL_ID
a6ss4v79udz6g
1 row selected.
Elapsed: 00:00:03.56
XXXX> select child_number from v$sql where sql_id='a6ss4v79udz6g'
2 /
CHILD_NUMBER
0
1 row selected. If you have more than one row in v$sql there could be differences in the optimiser environment. The supplied like shows you how to gather the information that should help find what the differences are if any.
Also as a side note if you're calling PL/SQL functions from SQL, you can take advantage of subquery caching to help reduce the number of calls (depending on your version). As it stands, your function is most likely going to be called for every row - when there is only a single row returned, that's not necessarily a problem but for multiple rows, the overhead can quickly grow. If there's no way to get rid of the function call, select the function from dual instead i.e.
SELECT * FROM DW025H WHERE DW025H_NR= (SELECT MPPCI.ENCR%('0000000000000000') FROM dual);This also (as I learnt a couple of weeks ago) works when you're using columns in the table your selecting from as parameters to the function.
HTH
David -
ESB problem when use merge function in master/detail relationship
I have some problem with the merge function in database adapter.
details:
I have 2 tables in master/detail relationship, both have GUID column as a primary key (GUID generated by ESB).
'car_group' table
pk : guid
unique : group_no, datadate, datatime
===============================
guid, group_no, datadate, datatime, group_detail
===============================
1, 1, 01/01/2008, 09:00, groupdetail01
2, 1, 01/01/2008, 10:00, groupdetail02
'car_group_detail' table
pk : guid
fk : car_group_guid link to car_group.guid
==================
guid, car_group_guid, detail
==================
1, 1, detail01
2, 1, detail02
3, 2, detail03
4, 2, detail04
I used a file adapter as a input, here is an example text file
M, 1, 01/01/2008, 09:00, groupdetail01
D, detail01
D, detail02
M, 1, 01/01/2008, 10:00, groupdetail02
D, detail03
D, detail04
Because I used merge function so I need to specify the columns that will be a condition for the insert/update,
but I have generate GUID as a primary key in the tables, I can't used it, so in toplink I map my unique key as a primary key.
The insert operation work fine but when update is required (for example, try to change 'group_detail' column of the master table in text file),
an SQLException thrown, the log file shown the adapter try to update the GUID column of master table but the constraint not allowed.
And yes, cause of GUID generate everytime so ESB try to update this column also, but I don't want to do like that, I need something
like when update operation required, just ignored the GUID column.
I try to mark read-only to the GUID column in Toplink mapping file but still have the same problem, it still generate UPDATE statement
with the GUID column, and also I try to let the database trigger to generate GUID instead of ESB function, but it not works in master/detail
relationship (I think the Toplink manage the relationship, is it right ?)
Please advise, thanks for advance.somebody please help, thanks !!!
Maybe you are looking for
-
Replicate sales orders from ecc to crm
Hi experts, We are creating sales orders in ECC and want to replicate them into CRM. Can you please tell me the configuration steps required in the middleware to replicate the orders from ecc to crm. thanks in advance Andy
-
How to make iCloud work with Outlook Calandar
I am trying to get iCloud to work with Outlook calandar. It will not show my appointment on the Outlook page.
-
help
-
Problem in dynamic internal table
hello experts, i have developed a report the out put is as shown: first screen: i will be entering one 'z' or 'y' table name dynamically. second screen: a popup screen with checkboxes and the field names of above particular table entered.
-
Please i have Blackberry 8900, i have Gmail adress , i can send and take email, but to my email go email with text : This message is used to carry data between the BlackBerry handheld and an associated server. Please do not delete, move or respond to