Using a dynamically assigned variable in a procedure ?
Hello every one ..
I had a small problem in writing a query..
Actually i had requirement of creating a tablespace using a procedure
My procedure is :
create or replace procedure datafile_test as
df_location varchar2(600);
begin
select distinct substr(file_name,1,instr(file_name,'/',-1)) into df_location from dba_data_files;
dbms_output.put_line(' Created data file location is' ||df_location);
end;
This procedure is working alright but now my requirement is to use that value stored in df_location variable in
create tablespace my_tbs <df_location>/tbs.dbf size 20m; // i need to write this statement in my procedure .. how can i bring df_location value in my query
is it possible to do it ?
thanks in advance..
Hello vinay raj
Ok, your original statement was not right and I have not checked it
Try this one, it should work:
create or replace procedure datafile_test
as
df_location varchar2(600);
v_statement VARCHAR2(4000);
begin
select distinct substr(file_name,1,instr(file_name,'/',-1)) into df_location from dba_data_files;
v_statement := 'CREATE TABLESPACE MY_TBS DATAFILE ' || CHR(39) || df_location || '/tbs.dbf' || CHR(39) || ' SIZE 20M '
--- This is optional, but I use this:
|| 'AUTOEXTEND OFF LOGGING ONLINE PERMANENT EXTENT MANAGEMENT LOCAL AUTOALLOCATE BLOCKSIZE 8K SEGMENT SPACE MANAGEMENT AUTO FLASHBACK ON'
EXECUTE IMMEDIATE v_statement;
dbms_output.put_line('Tablespace is created: "' || v_statement || '"'));
end;
I hope it helps you!
Similar Messages
-
Dynamically assigning variable in xml loop
I am trying to dynamically assign a variable name so I can
build an accordian nav from and XML doc. the code looks like this:
ACnav['depthChild0']._alpha = 0;
ACnav.setStyle("color", 0x0ffffff);
ACnav.setStyle ("openEasing",
mx.transitions.easing.strong.easeout);
ACnav.setStyle ("selectionDuration",
mx.transitions.duration.slow);
navXML = new XML();
navXML.ignoreWhite = true;
navXML.load("menu1.xml");
oY=5;
var currentSection = 0;
function buildNav () {
DisposableXML = new XML();
TempXML = new XML();
button = new Array();
//buttonNum = new Array();
subitem = new Array();
menuItem = new Array();
o = new Array ();
subitemlocation = new Array();
DisposableList = new Array();
buttonList = navXML.firstChild.childNodes;
i = 0;
sectionLength = buttonList.length;
while (i<=buttonList.length) {
if (buttonList
.nodeName.toLowerCase() == "button") {
DisposableXML = buttonList;
DisposableList = DisposableXML.childNodes;
buttonName = buttonList
.attributes.name;
set ("buttonNum", "buttonNumber"+i);
trace(buttonNum);
ii = 0;
//trace(buttonName+"-"+buttonNum);
//ACnav.createChild("View", buttonNum, {label: buttonName,
icon: "mainNav"});
button = ACnav.createChild("View", buttonNum, {label:
buttonName, icon: "mainNav"});
oY=5
while (ii<=DisposableList.length) {
TempXML = DisposableList[ii];
if (DisposableList[ii].nodeName.toLowerCase() == "subitem")
subitem = TempXML.attributes.name;
//subitemlocation = TempXML.attributes.location;
subitemNum="subitemNum"+[ii]+
//trace(buttonNum+"-"+subitemNum+"-"+subitem);
menuItem = ACnav.buttonNum.createChild("subNav",
subitemNum, {childText: subitem});
menuItem
.move(0, oY);
oY=(oY+25);
//trace(buttonNum);
ii = Number(ii)+1;
i = Number(i)+1;
//trace(button);
trace(menuItem);
redraw();
//gotoAndPlay('reload');
The problem lies with this line: button =
ACnav.createChild("View", buttonNum, {label: buttonName, icon:
"mainNav"});
If I quote the "buttonNum", it works, but jumbles the subnav
items together vs in the proper node. I need to have that declared
dynamically so that each parent node has a differentID and then
createchild goes under that. Anyway, I've tried alot of stuff over
the last few days and its getting frustrating.
Thanks for the help if anyone contributes!You shouldn't need to do a concat within the XQuery path parameter. Try the following:
bpws:getVariableData('inputVariable','payload','/ns1:Request/ns1:instance[bpws:getVariableData("j")]') -
Using a dynamic table variable in a stored procedure
SQL Server can do this where you declare a table variable and insert / modify / delete rows in that table without it ever being actually ON the database.
Can Oracle do this?
I know I can do things like pass in a unique user id, create the table in the procedure with the user ID appended, etc ...
but this procedure is going to be accessed via two modes, a batch job as well as online. The batch job may run this procedure 500 times.
What I'm trying to is figure out a way to return a recordset of errors that occured in the job, simple, 3 lines like so:
LineNumber NUMBER,
Severity VARCHAR(10),
Error_Msg VARCHAR(200)
is there any 3 dimensional way of storing these records when the errors occur, then returning them as a select statement at the end of the procedure?
Thanks,Why not create a table
CREATE TABLE error_log (
job_id NUMBER,
line_number NUMBER,
severity VARCHAR2(10),
error_msg VARCHAR2(200)
CREATE SEQUENCE seq_error_log_job_id
START WITH 1
INCREMENT BY 1
CACHE 100;In your procedure, you would get a new job_id from the sequence, insert whatever records you want in the error log table using that job_id and then return a REF CURSOR where you select from the error_log table using the job_id.
Justin
Distributed Database Consulting, Inc.
http://www.ddbcinc.com/askDDBC -
Dynamically assigning variables based on condition in pl/sql
I have a script which takes 6 input parameters but based on input 1 parameters 2 to 6 will be assigned to different variables. but the condition is not being checked during variable assignment phase. even if table_update is 'P' para,mater 2 is getting assigned to tariff_group instead of offer_id. Is there any way to solve this problem so that variables get assigned based on condition.
table_update := '&1';
if(table_update = 'T')
THEN
tariff_group := '&2';
gf_version := &3;
tariff_table_name := '&4';
flag := '&5';
if(no_rows_tariff(tariff_table_name, gf_version, tariff_group))
THEN
if(flag = 'I')
THEN
tariff_column_name := column_tariff(tariff_table_name);
ELSIF(flag = 'R')
THEN
max_gf_tariff(tariff_table_name, gf_version, tariff_group);
ELSE
DBMS_OUTPUT.PUT_LINE('Please enter correct option for update I- Insert R-Rollback');
END IF;
END IF;
ELSIF(table_update = 'P')
THEN
offer_id := &2;
gf_version := &3;
promotion_table_name := '&4';
flag := '&5';Although you do not say what your problem is, I suspect that it si something like this:
SQL> !cat t.sql
DECLARE
table_update VARCHAR2(1);
tariff_group VARCHAR2(3);
gf_version NUMBER;
tariff_table_name VARCHAR2(5);
offer_id NUMBER;
promotion_table_name VARCHAR2(5);
flag VARCHAR2(1);
BEGIN
table_update := '&1';
IF table_update = 'T' THEN
tariff_group := '&2';
gf_version := &3;
tariff_table_name := '&4';
flag := '&5';
ELSIF table_update = 'P' THEN
offer_id := &2;
gf_version := &3;
promotion_table_name := '&4';
flag := '&5';
END IF;
DBMS_OUTPUT.Put_Line ('TableUpdate: '||table_update);
DBMS_OUTPUT.Put_Line ('TariffGroup: '||tariff_group);
DBMS_OUTPUT.Put_Line ('GfVersion: '||gf_version);
DBMS_OUTPUT.Put_Line ('Tarifftable: '||tariff_table_name);
DBMS_OUTPUT.Put_Line ('OfferID: '||offer_id);
DBMS_OUTPUT.Put_Line ('PromoTable: '||promotion_table_name);
END;
SQL> @t T TG1 1 TTN1 F
old 10: table_update := '&1';
new 10: table_update := 'T';
old 12: tariff_group := '&2';
new 12: tariff_group := 'TG1';
old 13: gf_version := &3;
new 13: gf_version := 1;
old 14: tariff_table_name := '&4';
new 14: tariff_table_name := 'TTN1';
old 15: flag := '&5';
new 15: flag := 'F';
old 17: offer_id := &2;
new 17: offer_id := TG1;
old 18: gf_version := &3;
new 18: gf_version := 1;
old 19: promotion_table_name := '&4';
new 19: promotion_table_name := 'TTN1';
old 20: flag := '&5';
new 20: flag := 'F';
offer_id := TG1;
ERROR at line 17:
ORA-06550: line 17, column 19:
PLS-00201: identifier 'TG1' must be declared
ORA-06550: line 17, column 7:
PL/SQL: Statement ignoredAs you can see, the initial assignments for compilation purposes are done prior to actually running the code, and the assignment to offer_id is failing.
If I change offer_id to a varchar and quote the &2, then the compilation assignemnt works, and the actual logic of the script works:
SQL> !cat t.sql
DECLARE
table_update VARCHAR2(1);
tariff_group VARCHAR2(3);
gf_version NUMBER;
tariff_table_name VARCHAR2(5);
offer_id VARCHAR2(3);
promotion_table_name VARCHAR2(5);
flag VARCHAR2(1);
BEGIN
table_update := '&1';
IF table_update = 'T' THEN
tariff_group := '&2';
gf_version := &3;
tariff_table_name := '&4';
flag := '&5';
ELSIF table_update = 'P' THEN
offer_id := '&2';
gf_version := &3;
promotion_table_name := '&4';
flag := '&5';
END IF;
DBMS_OUTPUT.Put_Line ('TableUpdate: '||table_update);
DBMS_OUTPUT.Put_Line ('TariffGroup: '||tariff_group);
DBMS_OUTPUT.Put_Line ('GfVersion: '||gf_version);
DBMS_OUTPUT.Put_Line ('Tarifftable: '||tariff_table_name);
DBMS_OUTPUT.Put_Line ('OfferID: '||offer_id);
DBMS_OUTPUT.Put_Line ('PromoTable: '||promotion_table_name);
END;
SQL> @t T TG1 1 TTN1 F
30 /
old 10: table_update := '&1';
new 10: table_update := 'T';
old 12: tariff_group := '&2';
new 12: tariff_group := 'TG1';
old 13: gf_version := &3;
new 13: gf_version := 1;
old 14: tariff_table_name := '&4';
new 14: tariff_table_name := 'TTN1';
old 15: flag := '&5';
new 15: flag := 'F';
old 17: offer_id := '&2';
new 17: offer_id := 'TG1';
old 18: gf_version := &3;
new 18: gf_version := 1;
old 19: promotion_table_name := '&4';
new 19: promotion_table_name := 'TTN1';
old 20: flag := '&5';
new 20: flag := 'F';
TableUpdate: T
TariffGroup: TG1
GfVersion: 1
Tarifftable: TTN1
OfferID:
PromoTable:John -
Using Declare to assign variables
Hi All,
Database:Pubs
SQL Server 2012
Objective of Query: Creating a Store Procedure To Retrieve all authors by state.....but is not running properly.I 'm not sure whether my logic is sound or not.
Error Code(s): Msg 156, Level 15, State 1, Procedure Info, Line 7
Incorrect syntax near the keyword 'Declare'.
Thanks for your explanation and time. Below is the sample query.
Create procedure Info
Declare @state char(2)
Set @state='CA'
Begin
Select au_id,
state,
au_fname
FROM authors
Where state=@state
End
GO
Thank-you
SQL75Hi
Try this, u missed 'AS'
Create procedure Info
As
Declare @state char(2)
Set @state='CA'
Select au_id,
state,
au_fname
FROM authors
Where state=@state
GO
Seth Hop -
Dynamic assign in field symbols
dynamic assign in field symbols
Hi,
DYNAMIC ASSIGN:
If you do not know the name of the field that you want to assign to the field symbol when you write a program, you can use a dynamic ASSIGN statement:
ASSIGN (<f>) TO <FS>.
This statement assigns the field whose name is contained in the field <f> to the field symbol <FS>. You cannot use offset and length in a dynamic ASSIGN.
At runtime, the system searches for the corresponding data object in the following order:
If the ASSIGN statement is in a procedure, the system searches first in its local data.
If it cannot find the object in the local data (or if the ASSIGN statement is not in a procedure), it then looks in the local data of the program.
If the field does not exist in the global data of the program, the system looks in the table work areas declared with the TABLES statement in the main program of the current program group. A program group consists of a main program and all of the programs that are loaded into the same internal session as a result of other program calls.
If the search is successful and a field can be assigned to the field symbol, SY-SUBRC is set to 0. Otherwise, it is set to 4, and the field symbol remains unchanged. For security reasons, you should always check the value of SY-SUBRC after a dynamic ASSIGN to prevent the field symbol pointing to the wrong area.
Searching for the field in this way slows down the program. You should therefore only use the dynamic ASSIGN statement when absolutely necessary. If you know when you create the program that you want to assign a table work area to the field symbol, you can also use the following variant of the dynamic ASSIGN statement:
ASSIGN TABLE FIELD (<f>) TO <FS>.
The system then only searches within the table work areas in the main program of the current program group for the data object that is to be assigned to the field symbol. This addition is forbidden in ABAP Objects, since the latter does not support table work areas.
Suppose we have three programs. The main program:
REPORT demo_field_symbols_dynami_as_1.
TABLES sbook.
sbook-fldate = sy-datum.
PERFORM form1 IN PROGRAM demo_form1.
The other two programs are:
REPORT demo_form1.
FORM form1.
PERFORM form2 IN PROGRAM demo_form2.
ENDFORM.
and
REPORT demo_form2.
FORM form2.
DATA name(20) TYPE c VALUE 'SBOOK-FLDATE'.
FIELD-SYMBOLS <fs> TYPE ANY.
ASSIGN (name) TO <fs>.
IF sy-subrc EQ 0.
WRITE / <fs>.
ENDIF.
ENDFORM.
The output looks something like this:
02.06.1998
The program group in the internal session now consists of the programs DEMO, MYFORMS1 and MYFORMS2. The field symbol <FS> is defined in MYFORMS2. After the dynamic ASSIGN statement, it points to the component FLDATE of the table work area SBOOK declared in the main program DEMO.
REPORT demo_field_symbols_dynami_as_2 .
TABLES sbook.
DATA: name1(20) TYPE c VALUE 'SBOOK-FLDATE',
name2(20) TYPE c VALUE 'NAME1'.
FIELD-SYMBOLS <fs> TYPE ANY.
ASSIGN TABLE FIELD (name1) TO <fs>.
WRITE: / 'SY-SUBRC:', sy-subrc.
ASSIGN TABLE FIELD (name2) TO <fs>.
WRITE: / 'SY-SUBRC:', sy-subrc.
The output is:
SY-SUBRC: 0
SY-SUBRC: 4
In the first ASSIGN statement, the system finds the component FLDATE of the table work area SBOOK and SY-SUBRC is set to 0. In the second ASSIGN statement, the system does not find the field NAME1 because it is declared by the DATA statement and not by the TABLES statement. In this case, SY-SUBRC is set to 4.
Reference: http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb38d5358411d1829f0000e829fbfe/content.htm
reward points if helpful.
Regards,
Ramya -
Variable assignment error in stored procedure
i am writing this query giving me error
create or replace
PROCEDURE sp_AUDIT_ScrollAccepted
v_Date IN VARCHAR2 DEFAULT NULL ,
cv_1 IN OUT SYS_REFCURSOR
AS
BEGIN
IF v_Date IS NULL THEN
BEGIN
v_Date := to_CHAR(SYSDATE, 'DD/MM/YYYY') ;----------------error is coming in this line
END;
END IF;
error
Error(12,7): PLS-00363: expression 'V_DATE' cannot be used as an assignment target
what to doi have to assign value to this variable v_Date if its value in null then i am assigning system date as i am using
this variable for storing date
as this variable is used further in my query but i am getting this error
i cannot use new variable
create or replace
PROCEDURE sp_AUDIT_ScrollAccepted
v_Date IN VARCHAR2 DEFAULT NULL,
cv_1 IN OUT SYS_REFCURSOR
AS
BEGIN
IF v_Date IS NULL THEN
select to_CHAR(SYSDATE,'DD/MM/YYYY')---------error is coming in this line
into v_Date
from dual;
END IF;
END;
----------------now my v_Date is used in below query-----------------------------------
OPEN cv_1 FOR
SELECT User_Mst.UserName,
CashCollection_Statement.UpdatedOn Date_,
CashCollection_Statement.StatementNo,
CashCollection_Statement.TenderedCashAmt Due,
CashCollection_Statement.TenderedChequeAmt Cheque,
CashCollection_Statement.totalTenderAmount Cash,
SUM(StatementCashData.Amount) Total
FROM CashCollection_Statement
JOIN User_Mst
ON CashCollection_Statement.User_ID = User_Mst.UserID
JOIN StatementCashData
ON CashCollection_Statement.StatementID = StatementCashData.StatementID
WHERE TO_CHAR( CashCollection_Statement.UpdatedOn, 'DD/MM/YYYY') = v_Date----- this variable is used here---------
AND CashCollection_Statement.Accepted = 1
GROUP BY CashCollection_Statement.StatementNo,CashCollection_Statement.TenderedCashAmt
,CashCollection_Statement.TenderedChequeAmt
,User_Mst.UserName,CashCollection_Statement.totalTenderAmount
,CashCollection_Statement.StatementID,CashCollection_Statement.StatementFrom
,CashCollection_Statement.StatementTo,CashCollection_Statement.UpdatedOn
ORDER BY CashCollection_Statement.StatementID DESC;
END;
error is this
Error(15,12): PLS-00403: expression 'V_DATE' cannot be used as an INTO-target of a SELECT/FETCH statement
plz help -
What happens to dynamically declared variables when I'm not using them?
Hello, I'm making a game using Flash Pro cc. But I wonder what happens to aTile, which is dynamically declared MovieClip variable through a loop. And each aTile gets the 2 EventListener's.
for(var i:Number=0; i<pVector.length;i++){
var aTile:ATile=new ATile();
aTile.x=pVector[i].x;
aTile.y=pVector[i].y;
aTile.gotoAndStop(Math.ceil(Math.random()*Color));
nVector.push(aTile);
Spr.addChild(aTile);
aTile.addEventListener(MouseEvent.CLICK,Clicked,false,0,true);
aTile.addEventListener(Event.COMPLETE, stop,false,0,true);
// the current function ends here. what happens to aTile now ?? Is it going to be garbage collected? By the way, this piece of code runs whenever a player starts a new level of my game. And I don't make use of the aTile variable in other functions. I use only the nVector variable. And does declaring a dynamic variable in a loop mean a multiple of them are created? For example, if I loop the piece of code above 5 times, does it mean 5 aTile variables are created? Or each time you declare
var aTile:ATile=new ATile(); again, does it replace the 'old' aTile with the 'new' aTile and therefore only 1 aTile exists after the loop????I feel there is a gap in understanding of using variables by reference vs. by value. You should look it up.
1. new instructs Flash to create a distinct instance that per se has absolutely nothing to do with aTile variable.
2. REFERENCE to this new instance is assigned to variable aTile. aTile var is a temporary pointer to instance.
3. It does not replace old tile - it replaces reference.
4. If reference to the instance is not stored elsewhere - upon exiting of function this instance will be gced.
5. By creating another reference to the instance you prevent it from GC. One of the ways you preserve instance is by adding it to display list when using addChild.
You can look at this this way (it is a lame example but still it illustrates parts of the concept)
Say you have
1. basket;
2. basket is small and can hold only one apple;
3. table;
4. an apple;
5. apple can be placed into the basket or table;
6. dog who love apples.
7. Dog is trained not to take apples from baskets but table but is free to eat apples that are on the ground.
So, once apple is in the basket or on the table - it is safe.
If you move these entities into the realm of AS3, basket and table become declared variables, apple an instance and dog garbage collector.
What this example demonstrates is that apple exists independently of basket or table. You can put apple to the basket OR on the table OR you can put apple into basket and place basket onto the table.
1. Find apple instance (if you know whether apple is in the basket, on the table or in the basket on the table)
2. Prevent dog from eating apple.
3. Allow dog to eat it (destroy it when garbage collector kicks in) by assuring that apple is in neither basket or on the table. -
Using Bind Variable in a procedure
Hello all,
Aim - I wanted to set the value of a bind variable in a procedure
I was unsuccessful in doing so, pls help me (pls let me know if u need more info).
I have pasted the commands I executed in a SQL
SQL> VARIABLE x NUMBER;
SQL> EXEC :x := 5;
PL/SQL procedure successfully completed.
SQL> CREATE OR REPLACE PROCEDURE p1
2 IS
3 BEGIN
4 :x := 5;
5 END;
6 /
Warning: Procedure created with compilation errors.
SQL> show err
Errors for PROCEDURE P1:
LINE/COL ERROR
4/5 PLS-00049: bad bind variable 'X'The reason why the 2nd attempt failed is that in PL/SQL declared code (unlike anonymous blocks) you need to use PL/SQL (host) variables as bind variables and not SQL*Plus (host) variables.
To explain in more detail:
SQL> VARIABLE x NUMBER;
SQL> EXEC :x := 5;
The EXEC creates and transmits the following PL/SQL anonymous block to Oracle:
begin
:x := 5;
end;It also bind the SQL*Plus host variable (defined as X to the bind variable :x).
All well. But not the procedure P1 will not work. Numerous reasons - including that when I call the P1 proc from Delphi, or Joe calls it from Java, or Jack calls it from ASP - we do not have that SQL*Plus host variable X defined. That does not exist in the context when we make our PL/SQL calls to P1.
So how can you write P1 so that we all can use it - from any language?
You provide an input parameter for P1. This allows all of us to bind our host variables to the P1 call. E.g.
create or replace procedure P1( x IN OUT number ) is
begin
x := 5;
end;Now when you call it from SQL*Plus, you would do the following:
SQL> var x number
SQL> exec P1( x=>:X )
When I call it from Delphi, I will bind my Delphi (host) variable to the procedure call. Ditto for Joe and Jack.
Note that PL/SQL itself can also use host and bind variables when talking to the SQL engine. E.g.
create or replace procedure P2( nRows IN OUT number ) is
begin
select count(*) into nRows from all_objects;
end;In this case, nRows in the SQL statement is a SQL bind variable. It is also the PL/SQL host variable. As you can see, this is very similar to what SQL*Plus did with its host variable.
Bind variables (within PL/SQL) is explained in more detail in the Oracle® Database PL/SQL User's Guide and Reference guide. -
Creation of Dynamic Date Variables to be used in WebI reports
What we are trying to achieve is to create 4 optional filters (Current Day, Current Week, Last Week, Last Month) on 4 different dates which will allow the users to use them in WebI reports.
When using an optional SAP Customer Exit variable in BEx and creating a Universe on top, the filter becomes mandatory (i.e. the whole Universe is filtered by the SAP Exit, irrespective of whether the filter is used in the WebI report). Even if the filter is flagged as optional at the Universe level, it still behaves as mandatory.
If each filter becomes mandatory then we'll have to create 16 different Universes (for each optional filter and date combination)! This is not feasible.
I've seen in other posts that MDX Statements are not currently supported for Universes base on BW and SAP Exit should be utilized.
So with the existing BO version, is it possible to create optional dynamic date variables or is that a product limitation?
We are on XI3.1 SP3 FP3.1
ThanksHi Adam,
In BEx, I would create this query very easily using the "Amount" key figure twice in my results and restricting each with a different SAP standard out-of-the-box delivered variable. For your reference, the variables in BEx are: 0FPER and 0FYTLFP.
If I expose these variables in my OLE DB for OLAP query, they are not transfered into the universe, but rather act as filters on the entire universe. I've seen in documentation that only "Ready for Input" variables can be transfered as options into the universe which is not something that I have seen mentioned in this thread.
>> In the BEx Query you have the option to either make the variable "ready for input" or not. The behavior is the same in Bex or in the Universe / Web Intelligence. "Ready for input" means the user can actually provide an input and without the flag the user can not provide an input. Yes those variables are supported in the Universe.
Why this is a problem: I can't create separate universes based on potential variable periods that users might want to see. Additionally, many financial reports require concurrent use of these measures in the same report. Also, in reality it's not 2 variables, but dozens.
>> Which is a decision you make already on the BEx query level. if you decide that the variable is not ready for input then the user can change the timeframe in BEx either.
Also, I don't have a good way to mimic the standard out-of-the-box functionality given with BEx in BO. If I custom create all my variables in the universe, how do I do a lookup from the system date to the fiscal calendar that is stored on the BW server? In other words, how does BO know which date belongs in which period? (the same would be true with factory calendars for a different functional area).
>> Variable are created in the BEx query and the Universe will leverage those.
If you want a dynamic date range then EXIT variable as part of the BEx query - ready for input or not - is the solution.
regards
Ingo Hilgefort
The only work around I can see is to require users to enter the current fiscal period and have the BO reports filter based off that user entered value. This is unfortunate as the entire purpose of SAP Exit variables is to avoid having to require user input at report time. -
How to use bind variables in this procedure
Hi Experts,
How to use bind variables in this procedure for static queries.
PROCEDURE DELETE_MER_PROC (M_id IN NUMBER)
IS
BEGIN
V_date DATE;
SELECT PD_DATE INTO v_date FROM PD_MAINTAIN;
DELETE FROM MER_CLEAR
WHERE MER_DT < v_date
AND ID = M_ID;
COMMIT;
END;
How to use v_date and m_id as bind variables in this procedure to avoid hard parsing.
Please help me.
Thanks.976208 wrote:
How to use v_date and m_id as bind variables in this procedure to avoid hard parsing.
You cannot avoid hard parsing - as the 1st time a SQL statement (like the SELECT or DELETE statements in your code) is encountered, it does not reside in the server's Shared Pool, and needs to be added into the pool via a hard parse.
Bind variables does not prevent hard parsing. Hard parsing happens when the SQL statement (with or without bind variables) is a brand new statement encountered by the server.
Bind variables enables the same SQL cursor to be reused, by simply changing the bind variable value.
Not using bind variables means that each SQL statement is unique and not shareable - as the value is hardcoded into the statement and cannot be changed via a bind value. This typically means LOTS of different SQL statements (where the only difference is the changed value in the statement) are created - with each statement being a new statement not seen before in the Shared Pool and needing to be hard parsed.
One does not design one's code not to be hard parsed. There ALWAYS will be a hard parse in order to get a SQL statement into the Shared Pool. One designs one's code to REUSE cursors in the Shared Pool. -
How to dynamically assign Display Pattern using FormCalc in Adobe PDF Form
I am using Adobe PDF Form Designer. I am trying to dynamically assign a display pattern like MM/DD/YYYY to the Field tab - Display Pattern property. May I know how to do that?
I am using FormCalc scripting.hi,
After placing the date field in layout from data view, u will get tabs like field,layout,border etc..
In field tab under the edit pattern specify the pattern in which you want to display the date field.
hope this works.
Reward points if helpful. -
OBIEE | Using Dynamic Session Variable in Physical Layer
Hi All,
Any idea if we can use Dynamic Session Variables (I think they are also called Repository Variables) in our physical layer. I basically need to set the value of this variable from dashboard when a link is clicked, and then use this in my SELECT query at physical layer so that OBIEE does not pull all the data from the database tables.
Regards
Adeel Javed
Edited by: user10642426 on Apr 6, 2009 2:03 AMChristian,
Thanks for the quick response, ok we have actually moved to a different solution now, we are actually using Direct Database Request because one of our reports is supposed to be accessing direct transactional system i.e. for this report we are using OBIEE as a reporting tool. We are able to do that and even create links between different reports i.e. based on prompt in Report A filter Report B, but the scenario now is that we need to set a presentation variable from Report A when a navigation link gets clicked, because so far according to our knowledge direct SQL only allows presentation variables in its WHERE clause. So, any ideas how can we set a presentation variable when a navigation link is clicked. Thanks.
Regards
Adeel Javed
Edited by: adeeljaved on Apr 6, 2009 11:43 PM -
Dynamic publishing not enabling the use of dynamic variables (flashvars)
I'm have having issues with my website [url removed by moderator]. The Dynamic publishing is not enabling the use of dynamic variables. Standard magento 1.8.1 install.
Dear Yugandhar,
It's work. Thanks. This is a work around way to avoid retrieve list of values Error. I was suspected 2 reasons to cause this issues: 1. prompt option. 2. LOV option. So, the cause is not prompt option. The main cause could be LOV( list of values ).
After disable LOV, Republish universe, reset query filter in report, re-query report, restart server(Core, Webi) from CMC.
I restore LOV option back to universe and republish universe to server.
Run Query again. The report not retrieve list of values. The error not show up.
I try delete the cause problem dimension(year dim), add others dimension and add the cause problem dimension to query filter with prompt option back. The error not come up.
Query will not retrieve list of values.
Finally, the report come back normal status.
But. I doubt why only year dim will cause LOV retrieve problem but others dim.
Sam Sheen -
I want to use system and job variables to make the information dynamic in the Email Subject Line
Someone could mention the subject line character limitation needs to be expanded. 50 chars is not much to work with!
Is it possible to make SUBJECT Line to make , use system and job variables to make the information dynamic , Right now there is a limit for Characters in the Subject line ... is it possible to expand ???I've encountered the same issue and worked around it by using generic variables that would always be the same for a certain email alert. eg = "System XYZ -source file delay for :"
So a sample subject would then be:
Where ENV = DEV/UAT etc.
This functionality allows you to use generic alert templates for all filewait jobs, and just filling in the variables.
A slight problem is that although this works very well, the use of group variables in email / alert actions is (/ wasn't) officially supported by Cisco when I last ran it past then. Cisco, any update in this?
Maybe you are looking for
-
Itunes was deleted so I can no longer sync,is it possible to down load
is it possible to download ituns so I can sync?
-
Problem in loading multiple textures
hi guys i need some help form you in loading *.obj files into my scene. when i load a building into my scene only the white building is loading without any textures. when i tried to load a texture for eg: green...the whole building is in green color.
-
Can't print (Secured) document
I checked the security prefs under File >Prefs >Security and printing is allowed. All I get, however, is a blank page. I've had this problem before, but I can't remember what I did to work around it. I'm on a Mac, running Acro 9.5.2. Any suggestion
-
47 gigas of "other memory" I don't know where is the "other memory"
I have a MacBook Air 11" with only 64 GB of memory. I go to "About This Mac" and says... Audio - 2 GB Movies - 48.7 MB Photos - 418.3 MB Apps - 7.01 GB Backup - Zero KB Other - 42 GB Other - 42 GB ?????????? I don't know where are the archives of "Ot
-
Hi, I have a multi-threaded EWS app that is pushing email, appointments, and contacts to Exchange2010SP3. Each thread is using a separate instance ExchangeService and is working with a different mailbox on each thread. We are seeing that when