Using Built-in Functions
How do you reference a built in package from within a stored
procedure? I get errors that the package/procedure references
are not defined when compiling the stored procedure. How do I
get these built-ins into my database?
null
Dana Cleverdon (guest) wrote:
: How do you reference a built in package from within a stored
: procedure? I get errors that the package/procedure references
: are not defined when compiling the stored procedure. How do I
: get these built-ins into my database?
Err, you cant, if you mean refering to client side built ins,
text_io etc then you cant use these in DB packages, only native
in forms or in pll. Depending on what you are doing, either move
the package/procedure into your pll or split it between the db
and client elements and implement separate bits in db and pll,
but it all depends on what you are doing.
This is the case in forms 4.5 so I cant imagine that its changed.
Hope this helps.
Cheers
null
Similar Messages
-
Using built-in function in the definition of relation between two blocks...
Hi ,
Is it possible to define a relation between two form blocks(db based) ....
I have a master table such as:
table : strdet (cols: ms varchar2(10) , det varchar2(10))
materialized view : mv (cols : det varchar2(10) , sum_a number(5), sum_b number(5))
and data:
strdet
ms det
1 1.1
1 1.2
1.1 1.1.1
1.1 1.1.2
1.1.1 1.1.1.1
e.t.c.
and for the mv
det sum_a sum_b
1 500 300
1.1 100 200
1.2 540 150
e.t.c.
I have tried some versions of relations so as to create a master-detail relation(in reality , the two blocks are connected via ms.det
->mv.det... but the relation is one-to-one....) . I want a result such as:
Master block
1.1
Detail Block
1.1.1
1.1.2
e.t.c.Is it possible somehow...????
Note: I use Dev6i and Dev10g ...
Thanks ,,,
SimI think you'll have to use a from-clause-query for the detail block. If you join the master table and the mv on the DET column then you can give each row in the detail block a MS column (from the master table) which you can use in the relation.
-
How to use a mysql built-in function with dataprovider
hi.
I want to use a mysql built-in function, for example, MD5() on a column when updating a table with dataprovider.
Something like this doesn't work:
MyDataProviderOne.setValue("tablename.field_name", "MD5('some text')");
How should it be done?
thanks.
Mike.hi.
thanks. this helped, but I'd like to use also different functions, that's why, I'd rather do it by MySQL built-in functions with dataprovider... Is there any way to do that?
best regards.
Mike. -
Length of a string without using any built-in functions
code that returns the length of a string without using any built-in functions.
thanks
SamA string is internally represented by a character array. An array of characters will reside on the stack, not the heap. Yes, we always learned that String is a reference type, but what goes on in your memory might still surprise you...
A struct is internally represented by only it's private properties, sequentially on the stack.
So basically, what I thought is happening by messing with the structlayout: is only tricking our programming a bit into thinking that the top X bytes on the stack represent a chararray, while actually we put them there as a string.
Wrong. True. And wrong.
A string is internally represented by, in that order, an array length, a string length, the chars. None of them resides on the stack.
An array is internally represented by, in that order, an array length and the chars. None of them resides on the stack.
When you use the FieldOffset attribute to handle the string as a char array, you don't get anything right:
- the Length returned is the "array length" of the string, which is equal to the string length + 1.
- the chars returned by the array indexer are shifted by 2 chars (the length of the "string length" field).
You can use the FieldOffset to make that work, but it needs a little bit more work.
unsafe static int Test()
string myString = "This string may contain many string inside this string";
string testString = "string";
int countResult = 0;
fixed (char* myChars = new StringToChar { str = myString }.chr, testChar = new StringToChar { str = testString }.chr)
// The 2 first chars of the array are actually the string length.
int myCharsLength = myChars[1] << 16 | myChars[0];
int testCharLength = testChar[1] << 16 | testChar[0];
for (int i = 0; i < myCharsLength - testCharLength + 1; i++)
if (myChars[i + 2] == testChar[2])
for (int j = 1; j < testCharLength; j++)
var c = testChar[7];
if (myChars[i + 2 + j] != testChar[j + 2])
goto endOfCharAnalyses;
countResult++;
endOfCharAnalyses:
continue;
return countResult; -
Using SSRS Built in Functions in SharePoint
Hi there,
I currently have a number of reports deployed on a SharePoint site at work. I would like to monitor who actually uses which report and when they ran the report and also how long the report ran for. This is for auditing purposes and getting an idea
of the performance of these reports.
I came across the following built in functions on SSRS; UserID, ReportName, ReportServerUrl and ExecutionTime. Is it possible to use these functions somehow in SSRS & SharePoint whenever someone accesses a particular report and perhaps write this
information to a SharePoint list within our SharePoint site.
If this is possible, how would I go about doing this?
Also, some of our reports run off parameters, is it possible to capture what parameters were used as well?
Any help would be much appreciated. Thanks.you can get most of these information from executionlog tables available from reportserver database
http://www.mssqltips.com/sqlservertip/2722/sql-server-report-server-2008-r2-execution-log-reports/
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs -
Hi all,
I have the following xml file (books1.xml):
<bookstore>
<book>
<BookID>1</BookID>
<title>Everyday Italian</title>
<author>Giada De Laurentiis</author>
<year>2005</year>
<price>30.00</price>
</book>
<book>
<BookID>2<BookID>
<title>Harry Potter</title>
<author>J K. Rowling</author>
<year>2005</year>
<price>29.99</price>
</book>
<book>
<BookID>3<BookID>
<title>XQuery Kick Start</title>
<author>James McGovern</author>
<year>2003</year>
<price>49.99</price>
</book>
<book>
<BookID>4<BookID>
<title>Learning XML</title>
<author>Erik T. Ray</author>
<year>2003</year>
<price>39.95</price>
</book>
</bookstore>
In my Microsoft SQL Server 2012 Management Studio, I executed the following SQL Query code:
--XQuery w3schools example using books1.xml in C:\Temp folder
---SQL Query W3books Title
---9 March 2015
USE XML_XQUERY
GO
CREATE TABLE W3Books(
BookID INt Primary Key,
Title VARCHAR(30));
INSERT INTO W3Books (BookID, Title)
SELECT x.book.query('BookID'), value('.', 'INT'),
x.book.query('title'), value('.', 'VARCHAR(30)')
FROM (
SELECT CAST(x AS XML)
FROM OPENROWSET(
BULK 'C:\Temp\books1.xml',
SINGLE_BLOB) AS T(x)
) AS T(x)
CROSS APPLY x.nodes('W3Books/book') AS x(book);
SELECT BookID, Title
FROM W3Books;
I got the following error messages:
Msg 195, Level 15, State 10, Line 7
'value' is not a recognized built-in function name.
Msg 156, Level 15, State 1, Line 16
Incorrect syntax near the keyword 'AS'.
I don't know why I got the error of 'value' is not a recognized built-in function name. Please kindly help and tell me what is wrong in my code and how to correct the error.
Thanks, Scott Chang
P. S.
(1) I mimicked the xml file and SQL Qeury code of Import XML File to SQL Table in
http://pratchev.blogspot.com/2008/11/import-xml-file-to-sql-table.html. The xml file and the code of this sample worked in my SSMS 2012 program.
(2) I am learning the "CAST" and "CROSS APPLY" in the Create Instances of XML Data of Microsoft MSDN - it is very abstract to me.Hi Stan210, Thanks for your nice response.
I corrected my xml file as you pointed out.
I made some changes in some code statements of my SQLQueryW3BookTitle.sql as you instructed:
--XQuery w3schools example using books1.xml in C:\Temp folder
---SQL Query W3books Title
---10 March 2015
USE XML_XQUERY
GO
CREATE TABLE W3Books(
BookID INt Primary Key,
Title VARCHAR(30));
INSERT INTO W3Books (BookID, Title)
SELECT x.book.value('/BookID[1]', 'INT'),
x.book.value('/title[1]', 'VARCHAR(30)')
FROM (
SELECT CAST(x AS XML)
FROM OPENROWSET(
BULK 'C:\Temp\books1.xml',SINGLE_BLOB) AS T(x)
) AS T(x)
CROSS APPLY x.nodes('bookstore/book') AS x(book);
SELECT BookID, Title
FROM W3Books;
I executed my revised sql and I got the following Message and Results:
Msg 515, Level 16, State 2, Line 6
Cannot insert the value NULL into column 'BookID', table 'XML_XQUERY.dbo.W3Books'; column does not allow nulls. INSERT fails.
The statement has been terminated.
(0 row(s) affected)
Results:
BookID Title
I don't know why I just got the names of columns in Results and the "Cannot insert the value NULL into column 'BookID', table 'XML_XQUERY.dbo.W3Books'; column does not allow nulls, insert fails." in Messages. Please kindly help, advise me
how to correct the errors and respond again.
Many Thanks again,
Scott Chang -
Using User Defined Function is SQL
Hi
I did the following test to see how expensive it is to use user defined functions in SQL queries, and found that it is really expensive.
Calling SQRT in SQL costs less than calling a dummy function that just returns
the parameter value; this has to do with context switchings, but how can we have
a decent performance compared to Oracle provided functions?
Any comments are welcome, specially regarding the performance of UDF in sql
and for solutions.
create or replace function f(i in number) return number is
begin
return i;
end;
declare
l_start number;
l_elapsed number;
n number;
begin
select to_char(sysdate, 'sssssss')
into l_start
from dual;
for i in 1 .. 20 loop
select max(rownum)
into n
from t_tdz12_a0090;
end loop;
select to_char(sysdate, 'sssssss') - l_start
into l_elapsed
from dual;
dbms_output.put_line('first: '||l_elapsed);
select to_char(sysdate, 'sssssss')
into l_start
from dual;
for i in 1 .. 20 loop
select max(sqrt(rownum))
into n
from t_tdz12_a0090;
end loop;
select to_char(sysdate, 'sssssss') - l_start
into l_elapsed
from dual;
dbms_output.put_line('second: '||l_elapsed);
select to_char(sysdate, 'sssssss')
into l_start
from dual;
for i in 1 .. 20 loop
select max(f(rownum))
into n
from t_tdz12_a0090;
end loop;
select to_char(sysdate, 'sssssss') - l_start
into l_elapsed
from dual;
dbms_output.put_line('third: '||l_elapsed);
end;
Results:
first: 303
second: 1051
third: 1515
Kind regards
TaoufikI find that inline SQL is bad for performance but
good to simplify SQL. I keep thinking that it should
be possible somehow to use a function to improve
performance but have never seen that happen.inline SQL is only bad for performance if the database design (table structure, indexes etc.) is poor or the way the SQL is written is poor.
Context switching between SQL and PL/SQL for a User defined function is definitely a way to slow down performance.
Obviously built-in Oracle functions are going to be quicker than User-defined functions because they are written into the SQL and PL/SQL engines and are optimized for the internals of those engines.
There are a few things you can do to improve function
performance, shaving microseconds off execution time.
Consider using the NOCOPY hints for your parameters
to use pointers instead of copying values. NOCOPY
is a hint rather than a directive so it may or may
not work. Optimize any SQL in the called function.
Don't do anything in loops that does not have to be
done inside a loop.Well, yes, but it's even better to keep all processing in SQL where possible and only resort to PL/SQL when absolutely necessary.
The on-line documentation has suggested that using a
DETERMINISTIC function can improve performance but I
have not been able to demonstrate this and there are
notes in Metalink suggesting that this does not
happen. My experience is that DETERMINISTIC
functions always get executed. There's supposed to
be a feature in 11g that acually caches function
return values.Deterministic functions will work well if used in conjunction with a function based index. That can improve access times when querying data on the function results.
You can use DBMS_PROFILER to get run-time statistics
for each line of your function as it is executed to
help tune it.Or code it as SQL. ;) -
How to call the built in functions from flex?
I want to use some of the Built in functions like the twelvesprints.getActivityOwnerId() in flex. From the java example i could make out that we needed to import some classes to do this but was unable to find them for flex.
You can download the SWC file for Flex Method app here:
https://sandbox.12sprints.com/FlashMethodLib.swc
Java samples are located at
https://streamwork.com/api/Java.zip
Method exaples are available at:
https://streamwork.com/api/methods/com.streamwork.hello_world.zip
https://streamwork.com/api/methods/com.streamwork.constants.zip
https://streamwork.com/api/methods/com.streamwork.using_arrays.zip
com.streamwork.testFlash -
What are the Built-In-Functions in XSLT mapping?
what are the Built-In-Functions in XSLT mapping?
hi praveen
check the below blogs
XSLT MAPPING
Step u2013 By u2013 Step Simple Approach for XSLT Mapping
Step By Step Simple Approach for XSLT Mapping
XSLT mapping for multiple segments of XML
XSLT mapping for multiple segments of XML
IF - ELSE IF and XSLT - A Better work around ?
IF - ELSE IF and XSLT - A Better work around ?
Calling instance (object) method of ABAP Class into xslt mapping by using SAP: CALL-EXTERNAL
Calling instance (object) method of ABAP Class into xslt mapping by using SAP: CALL-EXTERNAL
xpath functions in xslt mapping
xpath functions in xslt mapping
Using XSLT Mapping within the J2EE Adapter Framework
https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/3823 [original link is broken] [original link is broken] [original link is broken]
EDIFACT to XML - Stylus Studio Solution
EDIFACT to XML - Stylus Studio Solution
Running NetWeaver's XSLT processor from XMLSpy
Running NetWeaver's XSLT processor from XMLSpy
generic xslt mapping part 1
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/01a57f0b-0501-0010-3ca9-d2ea3bb983c1
generic xslt mapping part 1 part2
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/9692eb84-0601-0010-5ca0-923b4fb8674a
xslt recursive templates
XSLT: Recursive Templates
Generating Generic XML / HTML files without using XSLT Mappings
Generating Generic XML / HTML files without using XSLT Mappings
regards
kummari -
Using advanced math functions in plugins
I have an application built in LabVIEW 8.5 that calls external VIs as PlugIns. Normally adding any subVIs of these PlugIns in the same directory as the plugin is located in (or a sub-directory of that) will enable the plugin to execute (I have several such plugins that do run properly).
The problem now however is that one of these PlugIns use a few math functions (linear fit etc.) and, although all the subVIs and dlls (including the ones from the vi.lib etc.) are located in the same directory - and the application is run on a machine that actually has the full professional LV 8.5 installed on it, it is still not executable (I've built a source distribution to get all the code it depends on out, with no exclusions). If I hit the broken run-button it says the full development system is required to resolve the issue.
The same plugin works fine in LV 7.1.1 (although then it is distributed as a top level VI in an llb with the support-VIs in it instead).
Is there still a way in LV 8.5 to distribute a plugin that uses the math functions without having to include the functions in the built application that will launch the plugin?
MTOHi, Mads,
My "Quick and Dirty" test shows that it should be no any problems. Just deselect "Exclude vi.lib" Vis in the Distribution, and select that dependecies should be deployed with PlugIn. See attachment, hopefully its will be helpful for you. Such distribution way produced huge llb (because not only linear fit embedded into library, but all math library), but at least it works.
best regards,
Andrey.
Attachments:
PlugInWithMathDistributionTest.zip 21 KB -
Hi,
Can anyone tell me how to get list of built in Oracle functions..eg(Sum,Count,Trim,etc)..
Thanx in adv
BalajeeHi,
When we install Oracle Discoverer, it loads a table EUL functions which has some built in functions and its parameters, whcih in turn is used by the Report of Dicoverer.so in that line can we have something which loads the built in fiunctions into a table..
Balajee -
How to use Spell-check functionality for textbox (like Orkut, gtalk)
How to use Spell-check functionality for tex Hello Friends,
I am working on a JSP application. I wanted to add Spell check for text box like we have here, when we post a message. It automatically shows red line under the word, when ever spelling is wrong. Please tell me how I can do this. If possible, the code too.
Thanks.I believe the spell checking you see here, or on any other site, is the spell checking built into Firefox. At least that's what I see. Are you using Firefox?
-
Built-in functions inside text_io
I am using text_io to get dir information. When inside the loop built-in functions such as to_date are not working. It is simply ignoring the function. However if I put a simply message box, it works.
Is there a limitation to using functions inside text_io.
Also, any code, including message boxes, outside text_io exit loop is ignored. Is there something I can do to fix it?
Thanks,
SrikanthBut if I want to compare 2 dates, I cannot assign it to variables. I need to something like
If to_date(a) - to_date(b) > 0 then
else
end if;
This is not working inside text_io. Any ideas?
thanks -
Use of Average Function in repository
Hi,
I need to use the average function on a derived column in the repository.
The requirement is to find different between two dates and then perform an average for a particular time period on the difference.
AVG(TIMESTAMPDIFF(SQL_TSI_DAY, Deposit_date, Withdrawal_Date))..This is the sample of my requirement in the repository.
I am not able to use it as I get the following error..
[38083] The Attribute defines a measure using an obsolete method.
How can I get past this and use the average function in the repository..I cannot pass this to the answers part as this is a adhoc reporting DM.
Any help will be greatly appreciated.
This requirement is for OBIEE 10.1.3
Thanks
Edited by: vjbez1 on Dec 3, 2012 6:24 AMOBIEE doesn't support aggregate functions in formulas that are built from logical columns. Use logical columns that already have an aggregate function defined to build formulas. Alternatively, add this under the General section of your NQSConfig.ini file: SUPPORT_OBSOLETE_MEASURES = YES;
Please mark if helpful/correct. -
Error using custom xpath function with XSL transformations in BPM
Hi,
We have created a custom xpath function for use with SOA Suite and BPM. This has been built as per specified within the http://docs.oracle.com/cd/E29597_01/dev.1111/e10224/bp_appx_functs.htm#SOASE11100. We have also reviewed the Oracle Sample for mapper-107-ExtensionFunctions (sample demonstrates the use of user-defined extension functions). This has been registered with jDeveloper and SOA within the oracle.soa.ext_11.1.1 (run ant to include in oracle.soa.ext.jar)
We ideally want to use this is BPM within an xsl. However when consuming this function is either BPEL or BPM using an xsl, the xsl fails with an error such as:
XPath expression failed to execute. An error occurs while processing the XPath expression; the expression is ora:doXSLTransformForDoc("xsl/Transformation_1.xsl", $inputVariable.payload). The XPath expression failed to execute; the reason was: javax.xml.transform.TransformerException: oramds:/deployed-composites/default/gwCustomXpathUtil_rev1.0/xsl/Transformation_1.xsl<Line 9, Column 113>: XML-22043: (Error) Extension function error: Method not found 'getWeekDayDate'. Check the detailed root cause described in the exception message text and verify that the XPath query is correct.
In an Assign it operates fine and returns the expected result. We have included a combination of both of the Config files (ext-mapper-xpath-functions-config.xml and ext-soa-xpath-functions-config.xml) in the META-INF folder, however neither allow the use of this function in the XSL.
I believe there may be an issue getting the custom xpath functions within XSL files. Hence I have also raised an SR. Has anyone experiences of this?
Our SOA / BPM suite environment is using 11.1.1.6.4 and has the following patches applied:
13801175
14406487 (11.1.1.6.4 SOA Bundle)
13896993
13088538
Regards Dave
Edited by: DavidGaskell on Mar 14, 2013 10:08 PMHi All,
I am also facing the same issue...Experts can you please help us.
hi DavidGaskell, did you find any resolution, if so can you share it with me.....
Thanks,
RR
Maybe you are looking for
-
Hi, I'm very new to Mac, been using it for a week :o) I have a windows 2000 server running AD and 6 XP Pro PC's. Using the Macbook Pro I can see the full network and I can log on to each PC by entering the usernames and passwords. I can also add fold
-
Weighing scale interface with SAP PI sheet
Dear all, I have questions related to SAP and weighing scale interface and PI sheet handling, seek for expert advise. As project rquirement we have to implement integration of weighing scale with SAP ECC 6.0 We have used the ERP scale pocket program
-
Experts: On the BI JAVA (i.e. EP for the BI ), usually BEX portfolio is in the KM content. However, in one of my BI Java system, I cannot find the BEX portfolio in KM content. I searched some other tabs but also failed to find it. could you please
-
Pxi655x automatic shut down due to over temperatur​e
I have a PXI-1045 chassis with the following pxi boards installed, 1. PXI 6602 x 1 2. pxi 6534 x 3 3. pix5411 x 1 4. pxi4070 x 1 The whole system works fine, however after I installed 3 pxi 6551 in the pxi chassis, I always encounter the problem that
-
Hi All, We are currently undergoing weblogic upgrade from 8.1sp6 to 10.0.1. We have successfully deployed the application. The application can be downloaded in two ways. 1) Using AppletWrapper 2) Using JNLP The application work fine when we launch us