Interval Literal in PLSQL Parameter
Are there special requirements with Interval Literal in PLSQL?
I have a procedure accepting interval parameters:
SQL> CREATE OR REPLACE PROCEDURE inttest( p_int INTERVAL DAY TO SECOND)
2 IS
3 v_ts TIMESTAMP;
4
5 BEGIN
6 v_ts:=SYSTIMESTAMP+p_int;
7 DBMS_OUTPUT.PUT_LINE(TO_CHAR(v_ts,'HH24:MI:SS.FF3'));
8 END;
9 /
Procedure created.
But it seems that interval literals must use DAY TO SECOND syntax even if my precision requirement is just MINUTE TO SECOND.
SQL> exec inttest(INTERVAL '0 00:23:12.111' DAY TO SECOND);
14:00:39.652
PL/SQL procedure successfully completed.
SQL> exec inttest(INTERVAL '03:12' MINUTE TO SECOND);
BEGIN inttest(INTERVAL '03:12' MINUTE TO SECOND); END;
ERROR at line 1:
ORA-06550: line 1, column 15:
PLS-00167: keyword BULK is used in a wrong context
However, SQL does support the MINUTE TO SECOND syntax for Interval literal:
SQL> SELECT INTERVAL '03:12' MINUTE TO SECOND+ SYSTIMESTAMP FROM DUAL;
INTERVAL'03:12'MINUTETOSECOND+SYSTIMESTAMP
09-MAY-06 01.43.35.144000000 PM +08:00
SQL> select version from v$instance;
VERSION
9.2.0.1.0
Would that be a bug in 9.2.0.1.0?
Hi
It could be written like this also:
SQL> create or replace procedure intset(vt in varchar2,v in varchar2) as
2 v_ts timestamp(3);
3 begin
4 execute immediate
5 'select systimestamp+interval '''||vt||''''||' '||v||' to second from dual'
6 into v_ts;
7 DBMS_OUTPUT.PUT_LINE(to_char(v_ts,'hh24:mi:ssxff'));
8 end;
9 /
Procedure created.
SQL> exec intset('0 00:23:12.111' ,'day');
12:49:06.111000000
PL/SQL procedure successfully completed.
SQL> exec intset('3:12' ,'minute');
12:29:14.000000000
PL/SQL procedure successfully completed.
SQL> exec intset('5:25:30','hour');
17:54:14.000000000
PL/SQL procedure successfully completed.
Similar Messages
-
How to set default value for vc2_255_arr in plsql parameter directive?
Hi,
I would like to set a default values for a plsql parameter which is of vc2_255_arr type. How to do that?
Below is the example from PL/SQL Server Page.
+" To set a default value, so that the parameter becomes optional, include a default="expression" attribute in the directive. The values for this attribute are substituted directly into a PL/SQL statement, so any strings must be single-quoted, and you can use special values such as null, as in the following example:+
+<%@ plsql parameter="p_last_name" default="null" %> "+
My plsql parameter is p_arr which is of "TYPE vc2_255_arr IS TABLE OF VARCHAR2(255) INDEX BY BINARY_INTEGER"
*<%@ plsql parameter="p_arr" type="PMP_LIB.VC2_255_ARR" %>*
Thanks in advance!
kwongMy plsql parameter is p_arr which is of "TYPE vc2_255_arr IS TABLE OF VARCHAR2(255) INDEX BY BINARY_INTEGER"You need to declare it in a package specification and initialize in the package body:
SQL> create or replace package pmp_lib
as
type vc2_255_arr is table of varchar2 (255)
index by binary_integer;
vc2_255_arr_default vc2_255_arr;
end pmp_lib;
Package created.
SQL> create or replace package body pmp_lib
as
begin
vc2_255_arr_default (1) := 'abc';
vc2_255_arr_default (2) := 'def';
end pmp_lib;
Package body created.
SQL> declare
arr pmp_lib.vc2_255_arr := pmp_lib.vc2_255_arr_default;
begin
for i in 1 .. arr.count
loop
dbms_output.put_line (arr (i));
end loop;
end;
abc
def
PL/SQL procedure successfully completed.so in your case it would probably be sth like (assuming pmp_lib is a package):
<%@ plsql parameter="p_arr" type="PMP_LIB.VC2_255_ARR" default = "PMP_LIB.vc2_255_arr_default" %> -
Count number of columns in query passed as PLSQL parameter
Hi All,
I am using a PLSQL package to generate excel file in a Database directory, to generate file i am passing sql query and number of columns manually in a parameter.
Now i want to automate it and do not want to pass "Number of Columns" as parameter.
HOW CAN I CALCULATE NUMBER OF COLUMNS IN PASSED QUERY.
Note: query can contain functions ( to get description or any other data)
Many Thanks in advancehttp://saubbane.blogspot.com/2011/01/how-to-find-column-count-of-query.html
Along with Re: Dynamic Fetch on dynamic Sql and just below this post, Blushadow's original run_query (from which I nicked!). -
Timer Expression - Interval Literals Issue
Hi
JDeveloper 11.1.1.6, WLS 10.3.6, BPM 11.1.1.6
I am trying to use XPATH expressions in the Timer Catch Event
I tried giving the Interval Literal as in the 26.12.3 section of Writing Expressions - 11g Release 1 (11.1.1.6.1)
All I want to do is set the timer value to 1 minute.
I gave the XPATH expression as '1m'
I have even tried giving the expression value as a variable from process data object and still it does not work.
I selected Time Cycle, and Use Expression, XPath Exp : bpmn:getDataObject('timerData')/ns:timerValue
The following post also mentions that it works if we give the literal as 2h
https://forums.oracle.com/message/11067100#11067100
I tried the timer as a catch event in the process and boundary event on a human task, but both are not working.
The process comes to the timer event and stops there. The Audit Trail/Flow in EM does not show it entered the timer event.
Can you please let me know if I am missing anything.
Thanks and Regards
SameerHi Sameer,
With timer event logic, part of the confusion stems from the two syntaxes you can have based on the "Time Date" (elapse at some time in the future) or "Time Cycle" (elapse after the time period specifies elapses).
If all you want to do is to have the event time out after one minute, you could use this syntax if the Time Cycle radio button is selected:
string(‘PT1M’)
This won't work without casting it to a string as shown above. The upper case "M" above is correct and does not mean month in this case because it is after "T" in the expression.
If you wanted one year, 3 months, 5 days, 7 hours, 10 minutes and 3.3 seconds the syntax would be:
string(‘P1Y3M5DT7H10M3.3S’)
If you wanted the event to expire after one minute and wanted to use the Time Date syntax (by selecting the Time Date radio button), the syntax would instead be:
xp20:add-dayTimeDuration-to-dateTime(xp20:current-dateTime(),'PT1M')
This logic is for the Timer events. Strangely, the deadline syntax that you use to set in a Human Task's deadline is slightly different. Human Task deadlines are important because they establish the value that will appear to end users in the Workspace's Expires column.
Dan -
How to import from CSV file into INTERVAL DAY TO SECOND column?
Hello,
I need to import data from a csv file that has a column that stores time-intervals (e.g. 2:06:02 Hours:Minutes:Seconds) into a table column INTERVAL DAY TO SECOND.
Does any of you know what format I should apply?
I tried HH:MI:SS but it didn't work.
Any suggestion is welcomed (including changing the column type to something else that might hold time-intervals in it....).
Thanks,
AndreiAndrei,
There is no native support for the INTERVAL datatype in the Text loading facilities of Application Express.
To work around this known limitation, I suggest either creating a temporary table or a shadow column in your existing table. You could then upload your data for the interval as a VARCHAR2 and then use SQL to convert to an appropriate interval value.
For example:
1) Create a table with:
create table foo (id number primary key, i interval day to second, shadowi varchar2(4000) )2) Using your sample data set, load this data into table FOO, loading the second column of this data into column SHADOWI
1 01:06:02
2 02:06:02
3 03:01:013) Issue the following SQL to convert the value in your shadow interval column to your actual interval column
update foo set i = to_dsinterval( '0 ' || shadowi )Note that you'll need to prepend the '0' to formulate a valid interval literal value.
Joel -
BANNER
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
PL/SQL Release 11.2.0.3.0 - Production
CORE 11.2.0.3.0 Production
TNS for HPUX: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Productionis there a way to assign an interval datatype variable from a table?
CREATE TABLE mytable
AS
(SELECT '4' num_of_days FROM DUAL);
DECLARE
myinteverval INTERVAL DAY TO SECOND;
BEGIN
myinterval := INTERVAL '4' DAY; --happy
SELECT num_of_days INTO myinteverval FROM mytable;
myinteverval := interval myinteverval day; -- not happy
end;Hi,
pollywog wrote:
BANNER
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
PL/SQL Release 11.2.0.3.0 - Production
CORE 11.2.0.3.0 Production
TNS for HPUX: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Productionis there a way to assign an interval datatype variable from a table?
CREATE TABLE mytable
AS
(SELECT '4' num_of_days FROM DUAL);
DECLARE
myinteverval INTERVAL DAY TO SECOND;
BEGIN
myinterval := INTERVAL '4' DAY; --happy
The reason why it's happy is that
INTERVAL '4' DAYis a perfectly formed INTERVAL literal. By itself
'4'would be a VARCHAR2 interval, but it is not by itself; immediately before the first single-quote is the keyword INTERVAL, which means the expression is an INTERVAL literal, and an INTERVAL literal must contain a number in single-quotes; not any kind of string expression.
SELECT num_of_days INTO myinteverval FROM mytable;
myinteverval := interval myinteverval day; -- not happy
end;Use the NUMTODSINTERVAL function:
myinterval := NUMTODSINTERVAL (4, 'DAY'); -
Buliding a SELECT in PSP using fields from html form
Hi everyone, first of all forgive me my poor english.
I'm making "CV Base" in PSP as a school project. And I've got a search html form like this (simple version):
select list: Profession
text field: Age
And my question is... How to build a select in psp which will parse only given parameters? For example. I'm looking for C Programmer in any age so i select C Pogrammer from the list and leave afe field blank. So the SELECT should be sth like this: select * from Person where Profession like 'C Programmer'; But in another search i need a programmer who is 25 years old... So select has one more WHERE... I'm sure You all know what I mean
Please help me.
MartinHey, i wanna open cursor and don't know how to do this. Got this:
<%@ plsql parameter="f_wyk" type="varchar2" default="NULL" %>
<%! sel_str varchar2(1000) := 'SELECT imie, nazwisko, wiek, ulica, nr_domu, nr_lokalu, kod_pocz, miasto, nazwa_woj FROM Uczelnia ucz, Stanowisko stan, Jezyk jez, Wojewodztwo woj, Wyksztalcenie wyk, Adres adr, Osoba os, os_wyk ow, os_jez oj, os_sta ost, os_ucz ou WHERE nazwa_wyk LIKE :1 ...
<% OPEN cur FOR sel_str USING 'pod%'; %>
<% LOOP %>
<% FETCH cur INTO rosoba; %>
<% EXIT WHEN cur%NOTFOUND; %>
<%= rosoba.imie %>
<% END LOOP; %>
<% CLOSE cur; %>
and when i put <% OPEN cur FOR sel_str USING *'pod%'; %>* it works but i'cant use parameter <% OPEN cur FOR sel_str USING *<%=f_wyk%>*; %>
I have
Projekt\psp>loadpsp -replace -user system/system szukaj2.psp
ORA-20006: "szukaj2.psp": compilation failed with the following errors.
"szukaj2.psp", line 100, pos 31: PLS-00103: Encountered the symbol "<" when expecting one of the following:
( - + case in mod new not null out <an identifier>
<a double-quoted delimited-identifier> <a bind variable> avg
count current exists max min prior sql stddev sum variance
execute forall merge time timestamp interval date
<a string literal with character set specification>
<a number> <a single-quoted SQL string> pipe
<an alternatively-quoted string literal with character set specification>
<an alternatively-q
please help -
How to set default value for Price Change Indicator in Purchase order
Hi,
While creating the service purchase order with item category "D" the price change indicator in the services tab of the purchase order is getting checked by default. I want to uncheck this by default.Where can we set the default property for this.
Thanks in Advance!
SuryaMy plsql parameter is p_arr which is of "TYPE vc2_255_arr IS TABLE OF VARCHAR2(255) INDEX BY BINARY_INTEGER"You need to declare it in a package specification and initialize in the package body:
SQL> create or replace package pmp_lib
as
type vc2_255_arr is table of varchar2 (255)
index by binary_integer;
vc2_255_arr_default vc2_255_arr;
end pmp_lib;
Package created.
SQL> create or replace package body pmp_lib
as
begin
vc2_255_arr_default (1) := 'abc';
vc2_255_arr_default (2) := 'def';
end pmp_lib;
Package body created.
SQL> declare
arr pmp_lib.vc2_255_arr := pmp_lib.vc2_255_arr_default;
begin
for i in 1 .. arr.count
loop
dbms_output.put_line (arr (i));
end loop;
end;
abc
def
PL/SQL procedure successfully completed.so in your case it would probably be sth like (assuming pmp_lib is a package):
<%@ plsql parameter="p_arr" type="PMP_LIB.VC2_255_ARR" default = "PMP_LIB.vc2_255_arr_default" %> -
Hi,
I have ACE 4701 with c4710ace-mz.A3_2_2.bin image. In the current setup ACE is located in the center of network where all the WAN, Intenret and LAN is connected and ACE has default towards Internet and All other segment has default route towards ACE appliance. ACe is only redirecting the port 80 traffic to my Proxy server and bypass my lan subnet on port 80.
Internet
i
i
i
i
i
ACE--------------------------------WAN
i
i
i
i
LAN
I want to use ACE for the load balancing of two servers. Today I did the load balancing configuration but as soon as I applied the policy map on the interface vlan 200 and 300, my complete network reachability went down. When I remove the policy my network came back to normal.
192.168.200.66 FAX Server-1
192.1168.200.67 FAX Server-2
192.168.200.65 Virtual IP address
Attached is the configuration that I did on ACE for the load balancing and below is the current configuration of the ACE appliance.
access-list acl-in remark ACCESS LIST FOR ACE-INSIDE
access-list acl-in line 1 extended permit ip any any
access-list acl-out remark ACCESS LIST FOR ACE-OUTSIDE
access-list acl-out line 1 extended permit ip any any
access-list acl-proxy remark ACCESS LIST FOR PROXY SEGMENT
access-list acl-proxy line 1 extended permit ip any any
access-list acl-wan remark ACCESS LIST FOR WAN SEGMENT
access-list acl-wan line 1 extended permit ip any any
probe tcp PROBE_5050
port 5050
interval 15
passdetect interval 60
open 1
probe tcp PROBE_5101
port 5101
interval 15
passdetect interval 60
open 1
probe tcp PROBE_TCP
port 80
interval 15
passdetect interval 60
open 1
parameter-map type http PARAMAP_CASE
case-insensitive
no persistence-rebalance
rserver host RS_BCPR01
ip address 192.168.0.103
inservice
rserver host RS_BCPR02
ip address 192.168.0.104
inservice
rserver host RT_fax1
description Right Fax Server-1
ip address 192.168.200.66
rserver host RT_fax2
description Right Fax Server-2
ip address 192.168.200.67
serverfarm host SF_BCPR
transparent
probe PROBE_5050
probe PROBE_5101
probe PROBE_TCP
rserver RS_BCPR01
inservice
rserver RS_BCPR02
inservice
serverfarm host SF_RT_fax
rserver RT_fax1
rserver RT_fax2
sticky ip-netmask 255.255.255.255 address source STICKY-SOURCE
replicate sticky
serverfarm SF_BCPR
sticky ip-netmask 255.255.255.255 address source FAX-STICKY
replicate sticky
serverfarm SF_RT_fax
class-map type management match-any CM_ALL
2 match protocol snmp any
3 match protocol http any
4 match protocol https any
5 match protocol icmp any
6 match protocol telnet any
class-map match-any CM_BYPASS_FOR_LAN
3 match virtual-address 100.1.1.0 255.255.255.0 tcp eq www
8 match virtual-address 10.0.0.0 255.0.0.0 tcp eq www
9 match virtual-address 172.16.0.0 255.255.0.0 tcp eq www
10 match virtual-address 192.168.0.0 255.255.0.0 tcp eq www
class-map match-any CM_BYPASS_SUBNET
9 match virtual-address 100.0.0.0 255.0.0.0 tcp eq www
13 match virtual-address 10.0.0.0 255.0.0.0 tcp eq www
14 match virtual-address 172.16.0.0 255.255.0.0 tcp eq www
15 match virtual-address 192.168.0.0 255.255.0.0 tcp eq www
class-map match-any CM_IM
2 match virtual-address 0.0.0.0 0.0.0.0 tcp eq 5050
3 match virtual-address 0.0.0.0 0.0.0.0 tcp eq 1080
4 match virtual-address 0.0.0.0 0.0.0.0 tcp eq 5101
class-map match-all CM_SF_BCPR
255 match virtual-address 0.0.0.0 0.0.0.0 tcp eq www
class-map match-any RT_FAX
2 match virtual-address 192.168.200.65 0.0.0.0 any
policy-map type management first-match PM_ALL
class CM_ALL
permit
policy-map type loadbalance http first-match PM_L7_BYPASS_FOR_LAN_HTTP
class class-default
forward
policy-map type loadbalance http first-match PM_L7_BYPASS_HTTP
class class-default
forward
policy-map type loadbalance first-match PM_LB_RT_FAX
class class-default
sticky-serverfarm FAX-STICKY
policy-map type loadbalance http first-match PM_LB_SF_BCPROXY
class class-default
sticky-serverfarm STICKY-SOURCE
policy-map multi-match PM_BYPASS_FOR_LAN_HTTP
class CM_BYPASS_FOR_LAN
loadbalance vip inservice
loadbalance policy PM_L7_BYPASS_FOR_LAN_HTTP
policy-map multi-match PM_BYPASS_HTTP
class CM_BYPASS_SUBNET
loadbalance vip inservice
loadbalance policy PM_L7_BYPASS_HTTP
policy-map multi-match PM_MAIN_BCPROXY
class CM_SF_BCPR
loadbalance vip inservice
loadbalance policy PM_LB_SF_BCPROXY
loadbalance vip icmp-reply active
appl-parameter http advanced-options PARAMAP_CASE
class CM_IM
loadbalance vip inservice
loadbalance policy PM_LB_SF_BCPROXY
policy-map multi-match PM_RT_FAX
class RT_FAX
loadbalance vip inservice
loadbalance policy PM_LB_RT_FAX
service-policy input PM_ALL
interface vlan 100
description FW-INSIDE CONTEXT RACK1
ip address 192.168.0.5 255.255.255.224
alias 192.168.0.11 255.255.255.224
peer ip address 192.168.0.6 255.255.255.224
mac-address autogenerate
no icmp-guard
access-group input acl-out
no shutdown
interface vlan 200
description WAN-VLAN CONTEXT RACK1
ip address 192.168.0.33 255.255.255.224
alias 192.168.0.43 255.255.255.224
peer ip address 192.168.0.34 255.255.255.224
mac-address autogenerate
access-group input acl-wan
service-policy input PM_BYPASS_HTTP
service-policy input PM_MAIN_BCPROXY
no shutdown
interface vlan 300
description ACE-INSIDE CONTEXT RACK1
ip address 192.168.0.65 255.255.255.224
alias 192.168.0.73 255.255.255.224
peer ip address 192.168.0.66 255.255.255.224
mac-address autogenerate
access-group input acl-in
service-policy input PM_BYPASS_FOR_LAN_HTTP
service-policy input PM_BYPASS_HTTP
service-policy input PM_MAIN_BCPROXY
no shutdown
interface vlan 301
description BC-VLAN CONTEXT RACK1
ip address 192.168.0.97 255.255.255.224
alias 192.168.0.107 255.255.255.224
peer ip address 192.168.0.98 255.255.255.224
mac-address autogenerate
access-group input acl-proxy
no shutdown
ft track interface TRACKING_FOR_FT_VLAN
track-interface vlan 300
peer track-interface vlan 300
priority 255
peer priority 255
ip route 0.0.0.0 0.0.0.0 192.168.0.1
Please help me out what i am missing. Is there any limitation on policy map or my bypass subnet list is creating problem.I did these changes this time nothing disconnected but I am not able to do the Remote desktop on the virtual IP address. Real IP has Remote desktop enabled even VIP is not ping able for me.
rserver host RT_fax1
description Right Fax Server-1
ip address 192.168.200.66
inservice
rserver host RT_fax2
description Right Fax Server-2
ip address 192.168.200.67
inservice
serverfarm host SF_RT_fax
rserver RT_fax1
inservice
rserver RT_fax2
inservice
policy-map type loadbalance rdp first-match PM_LB_RT_FAX
class class-default
serverfarm SF_RT_fax
policy-map multi-match PM_RT_FAX
class RT_FAX
loadbalance vip inservice
loadbalance policy PM_LB_RT_FAX
loadbalance vip icmp-reply active
interface vlan 200
description WAN-VLAN CONTEXT RACK1
ip address 192.168.0.33 255.255.255.224
alias 192.168.0.43 255.255.255.224
peer ip address 192.168.0.34 255.255.255.224
mac-address autogenerate
access-group input acl-wan
service-policy input PM_BYPASS_HTTP
service-policy input PM_MAIN_BCPROXY
service-policy input PM_RT_FAX
no shutdown
interface vlan 300
description ACE-INSIDE CONTEXT RACK1
ip address 192.168.0.65 255.255.255.224
alias 192.168.0.73 255.255.255.224
peer ip address 192.168.0.66 255.255.255.224
mac-address autogenerate
access-group input acl-in
service-policy input PM_BYPASS_FOR_LAN_HTTP
service-policy input PM_BYPASS_HTTP
service-policy input PM_MAIN_BCPROXY
service-policy input PM_RT_FAX
no shutdown
But nothing is working for me. Please help me out. This time i didnt configure the sticky. But in real I will go with sticky and complete IP protocol will be use a VIP. Please help me out. -
Current DateTime in Database polling 'WHERE Clause'
Hi,
I am trying to explore the usage of polling option with Database adapter in SOA Suite 11g.
I am doing a sample process which will poll the data from a database table which has 2 fields, one is ID and the other one is UpdatedDate which is of type TIMESTAMP. I am trying to delete the records after polling, whose UpdatedDate is less than the current date. I am using the where clause in polling option to set the condition of UpdatedDate < CurrentDate.
The problem is I am not getting, how to get the current date in the right side of the expression. To provide the right side option, we have 3 options of Literal, Query and parameter. I have tried will all the options; when I am trying with Literal, the right side is updated with Null value.
Could any one help me to resolve this issue. I need the value of current dateTime as the right side expression of the where clause.
Thanks.Hi,
You're maybe over complicating this... The DbAdapter should be able to delete processed records automatically for you since you use one of the defined polling strategies...
http://docs.oracle.com/cd/E28280_01/integration.1111/e10231/adptr_db.htm#CHDEFACG
Cheers,
Vlad -
Problems with pre-mapping process operator in owb 9i
Hi,
I was trying to use the pre-mapping process operator in owb 9i. Problem is that the manual does not specify how the inputs need to be connected to this operator.
Following is what I went through -
I created a mapping table operator and a mapping dimension operator and connected these two. Then i created a pre-mapping process operator selecting the LTRIM function. Further I connected one of the table attributes to this pre-mapping operator as input and connected the output of this pre-mapping operator to the appropriate dimension operator attribute.
On performing Validate, following error message was flashed -
VLD-2451 : Illegal connection to pre-mapping process operator
I am trying to learn how to use OWB 9i from the manual. So my interpretation of the use of the pre-mapping process operator may be wrong.
In any case kindly help,
Thanks,
SajuPre-mapping process is use to perform some operations preceding to mapping operation itself.
For example, if your mapping is designed to incrementally append data to table for the definite time interval (witch is a parameter of the map operation) you might want to perform the table data cleanup for that period. That will allow for reload data number of time.
In this case you have to define the procedure witch perform cleanup and than include the call to that procedure as a pre-mapping process.
Other examples of pre- and post mapping process is disabling referential integrity before loading and re-enabling them after loading.
Anyway, OWB documentation has clear definition for pre- and post-mapping processes. -
I have plsql code looking something like that:
if v_state_flag = 'S' and v_next_query = 'Y' then
PKG_COMMON.DEBUG ('GET_ADDRESS_LEVEL_LIST.30, fill o_state_list');
-- kui #postal_flag = 'Y' ja #postalcode on antud, siis lisada klausel
if v_postalcode_flag = 'S' and i_postal_code is not null then
open o_state_list for
select reg.CODE, reg.NAME from V_REGION_LANG reg
where reg.LANGUAGE = PKG_SESSION.LANGUAGE_CODE
and reg.COUNTRY = i_country
and reg.REGION_LEVEL = 'STATE'
and reg.CLOSED_TIME is null
-- kui #postal_flag = 'Y' ja #postalcode on antud, siis lisada klausel
and reg.CODE in (
select r.REGION_CODE1 from REGION r, POSTALCODE p
where r.COUNTRY = p.COUNTRY
and r.CODE = p.REGION_CODE
and p.POSTALCODE = i_postal_code
and p.CLOSED_TIME is null
); View "v$sqlarea" shows this query as:
select * from v$sqlarea where
last_active_time > sysdate - 2
and sql_text like '%REG.CODE, REG.NAME%'
SELECT REG.CODE, REG.NAME FROM V_REGION_LANG REG
WHERE REG.LANGUAGE = PKG_SESSION.LANGUAGE_CODE
AND REG.COUNTRY = :B1 AND REG.REGION_LEVEL = 'STATE' AND REG.CLOSED_TIME IS NULL
;We have " :B1" in query, it stands for plsql parameter "i_country". But we have call to package function "PKG_SESSION.LANGUAGE_CODE" in v$sqlarea query- why wasn't this function replaced with ":B15" for example?
Why plsql parameters are replaced with ":B5" but package functions not?
Does the "PKG_SESSION.LANGUAGE_CODE" in query makes the query slower?PL/SQL variables by default act as Bind Variables when you use them in SQL. But PACKAGE functions or standalone functions are not bind variables.
If you dont want the package name to appear in the SQL area then you need to change the SQL to use a bind variable.
Something like this
if v_state_flag = 'S' and v_next_query = 'Y' then
PKG_COMMON.DEBUG ('GET_ADDRESS_LEVEL_LIST.30, fill o_state_list');
my_value := PKG_SESSION.LANGUAGE_CODE;
-- kui #postal_flag = 'Y' ja #postalcode on antud, siis lisada klausel
if v_postalcode_flag = 'S' and i_postal_code is not null then
open o_state_list for
select reg.CODE, reg.NAME from V_REGION_LANG reg
where reg.LANGUAGE = my_value
and reg.COUNTRY = i_country
and reg.REGION_LEVEL = 'STATE'
and reg.CLOSED_TIME is null
-- kui #postal_flag = 'Y' ja #postalcode on antud, siis lisada klausel
and reg.CODE in (
select r.REGION_CODE1 from REGION r, POSTALCODE p
where r.COUNTRY = p.COUNTRY
and r.CODE = p.REGION_CODE
and p.POSTALCODE = i_postal_code
and p.CLOSED_TIME is null
);By doing this you execute the package function only once. But when you use it in a SQL directly you execute it for every row. -
Calling a function in DBMS_JOB
Hi All,
I have to create a job using DBMS_JOB where the interval should be a parameter, meaning to change the interval whenever needed.
I have a table with fields
PARAMETER_NAME varchar2(1000)
VALUE varchar2(1000)
How do I write a function that fetches value from this table and I should call the function in DBMS_JOB.
Please help. Let me know if I am not clear with the requirements.Is this what you want ?
declare
jobno number;
what varchar2(100);
start_day varchar2(100);
next_day varchar2(100);
begin
what := 'TEST;';
start_day:=sysdate;
next_day := 'SYSDATE+(59/(24*60*60))';
DBMS_JOB.SUBMIT (jobno,what,start_day,next_day);
COMMIT;
end;
Aalap Sharma :) -
Partitioning on the base of date
hi,
im having a PROBLEM IN CREATING A TABLE containing a date column having range partitioning on it. my table an accompanying error is :
CREATE TABLE A123 (A NUMBER, B DATE)
PARTITION BY RANGE (B)
(PARTITION B1 VALUES LESS THAN (TO_DATE((SYSDATE - INTERVAL '30' DAY),'DD-MON-YYYY')))
(PARTITION B1 VALUES LESS THAN (TO_DATE((SYSDATE - INTERVAL '30' DAY),'DD-MON-YYYY')))
ERROR at line 3:
ORA-14019: partition bound element must be one of: string, datetime or interval literal, number, or MAXVALUE
i'v also tried it as:
CREATE TABLE A123 (A NUMBER, B DATE)
PARTITION BY RANGE (B)
(PARTITION B1 VALUES LESS THAN (TO_DATE(SYSDATE - INTERVAL '30' DAY,'DD-MON-YYYY')))
(PARTITION B1 VALUES LESS THAN (TO_DATE(SYSDATE - INTERVAL '30' DAY,'DD-MON-YYYY')))
ERROR at line 3:
ORA-14019: partition bound element must be one of: string, datetime or interval literal, number, or MAXVALUE
as shown above,,i want to create partitions of the table A123 column b which is of date datatype,,i want to have a partition which stores data of SYSDATE - 30,.
Any suggestions/recommendations would be appreciated.
thanx
Regardshi,
sorry im calling u again for support,,
the way u told for creating a table based on date column partitions creates a table with fixed date as a HIGH/UPPER BOUND,,for example if i create a table A123 as :
begin
execute immediate 'CREATE TABLE A123 (A NUMBER, B DATE)
PARTITION BY RANGE (B)
(PARTITION B4 VALUES LESS THAN (TO_DATE(('''||to_char(SYSDATE - INTERVAL '90' DAY,'DD-MON-YYYY')||'''),''DD-MON-YYYY''))
,PARTITION B3 VALUES LESS THAN (TO_DATE(('''||to_char(SYSDATE - INTERVAL '60' DAY,'DD-MON-YYYY')||'''),''DD-MON-YYYY''))
,PARTITION B2 VALUES LESS THAN (TO_DATE(('''||to_char(SYSDATE - INTERVAL '30' DAY,'DD-MON-YYYY')||'''),''DD-MON-YYYY''))
,PARTITION B1 VALUES LESS THAN (MAXVALUE))';
end;
ALTER TABLE A123 ENABLE ROW MOVEMENT
now the HIGH VALUE for partition B2 is January 03,2005...
while i want it to be dynamic.
means after 2 months the high value for B2 partition should be (Jan 03,2005 + 2 months)..
can we do this in oracle??
Regards. -
Webi - Pass Hierarchy Filter via Document Link
Hi
I am creating WEBI reports on BO 4.0 SP2 patch 8.
I want to pass the parameters from Webi report 1 via document link to Webi report 2.
Within report 1 you can filter the data by the following:
Parameter 1: Customer
Parameter 2: Calender Month
Parameter 3: Profit center Hierarchy
Parameter 1 & 2 work perfectly the selected customer and month passes to report 2.
However Parameter 3: hierarchy is giving me hassles.
I enter the Hierarchy into the document prompt text and key in editing the document link.
On selecting the hyperlink I get the error message:
" Invalid answer 0HIER [ ] for variable ZPCTR_GRP error message WIS 00013."
Has anybody been able to pass a filtered Hierarchy via Document Links on BO 4.0?
Regards
GrahamHi,
I haven't seen this particular issue come through support.
the warning seems to suggest that an invalid selection has been made, however the brackets [ ] show nothing! So perhaps the string's been provided in the wrong format, or text is being returned when infact it needs key. (i'm speculating)
a few questions to begin:
- Are you passing a hiearchy interval as a range parameter ? (i.e. 2 or more nodes/members from different levels in the hierarchy)
- Do you notice a difference when using the other viewer technology: DHTML (WEB) vs JAVA (Rich) ?
It might be worth using the TraceLog service on the webi processing server and DSL_bridge (APS) to capture your workflow, and get more details error messaging. Also, RSTT trace in BW may catch something of interest.
Good luck
Regards,
H
Maybe you are looking for
-
TV-Out on Mega 180 (Composite)
Hi there, I just received my Mega 180 some days ago. So far I'm really satisfied. I just have one problem an perhaps you could help me. I at first used the S-Video out from Mega to my S-Video-Scart-In of my TV. That worked without problems. Now I wan
-
Shockwave addon stopped working, but addon manager says it is fine, what to do?
Whenever I am at a website it freezes and error message pops up to say adobe shockwave is not working do I wish to turn it off or wait. This has been going on for several days. I checked the addon manager and it says that the shockwave is fine and re
-
Help : my JSP page work in 8i but not in 10g. Any idea ?
Hello, We have a 10g environment with Portal and SSO. When we were under 8i, I built a JSP file to display data from our DB via IE. Now that we are under 10g, I noticed that the JSP file doesn't work anymore... I located the JSP file in a similar dir
-
Smoothing Options in FCPX Stabilization
Can someone please tell me what the SMOOTHing options refer to? There's Translation, Rotation, and Scale. I can't find anything online or in help videos or aticles referring to what each option corrects. For what motions do you use each one? I have a
-
Post Author: karramarro CA Forum: General I used Crystal Reports 8.5 and I have a field with this text "<font size=1><font face="Courier New (Europa central)"><br><b>grupoCGM_12 = CGM 12 Kv</b><br>Esta modificado = true......" and in the Crystal I vi