Using bind variables in creating new recordgroup
hi
i am creating a new recordgroup and assigning it to the LOV using forms personalization in new item instance trigger .
when i use the bind variables in the record group query i am getting errored out. if i remove the bind variables in the query then RG is creating and is assigned to the LOV and i can use it.
can anyone help me how to refer the values from the exising form to build a dynamic record group query.
Can you please send me the code you used in Forms Personalization to create new RecordGroup and attach it to an item. my mail id is [email protected]
Similar Messages
-
BUG ? : ADF creating extra VO instance using bind variables in a LOV query
ADF 11.1.1.1.0
After "playing around" with bind variables Setting bind variables in view objects for LOV I've come across something strange that I've reproduce using the HR schema and tables Employees and Departments. Its a bit long but here goes :
Using the HR schema tables departments and employeesI'm trying to create a LOV (selectOneChoice) for the
employee department, the LOV having a bind variable that limits the values returned in this case returning only DepartmentId = 50
I've create a VO lovDepartment (not based on an EO) with the following query :
SELECT Departments.DEPARTMENT_ID,
Departments.DEPARTMENT_NAME,
Departments.MANAGER_ID,
Departments.LOCATION_ID
FROM DEPARTMENTS Departments
where DEPARTMENT_ID = :pDeptIdA LOV has been defined on the DepartmentId attribute of the EmployeesView.
The lovDepartmentImpl overrides the executeQueryForCollection to set the bind variable value.
@Override
protected void executeQueryForCollection(Object object, Object[] object2,
int i) {
setNamedWhereClauseParam("pDeptId", "50");
super.executeQueryForCollection(object, object2, i);
}When using an ADF form to create a new employee the DepartmentId lov is empty.
Enabling SQL tracing shows the following :
[370] _LOCAL_VIEW_USAGE_model_EmployeesView_lovDepartment1_0 ViewRowSetImpl.doSetWhereClause(-1, pDeptId, null)
[371] _LOCAL_VIEW_USAGE_model_EmployeesView_lovDepartment1_0 ViewRowSetImpl.execute caused params to be "un"changed
[372] Column count: 4
[373] _LOCAL_VIEW_USAGE_model_EmployeesView_lovDepartment1_0 ViewRowSetImpl.doSetWhereClause(-1, pDeptId, null)
[374] _LOCAL_VIEW_USAGE_model_EmployeesView_lovDepartment1 ViewRowSetImpl.setNamedWhereClauseParam(pDeptId, 50)
[375] ViewObject: _LOCAL_VIEW_USAGE_model_EmployeesView_lovDepartment1 Created new QUERY statement
[376] _LOCAL_VIEW_USAGE_model_EmployeesView_lovDepartment1>#q computed SQLStmtBufLen: 235, actual=195, storing=225
[377] SELECT Departments.DEPARTMENT_ID,
Departments.DEPARTMENT_NAME,
Departments.MANAGER_ID,
Departments.LOCATION_ID
FROM DEPARTMENTS Departments
where DEPARTMENT_ID = :pDeptId
[378] Bind params for ViewObject: _LOCAL_VIEW_USAGE_model_EmployeesView_lovDepartment1
[379] For RowSet : _LOCAL_VIEW_USAGE_model_EmployeesView_lovDepartment1_0
[380] Binding null of type 12 for "pDeptId"
[381] No Resource Bundle found but null value id:LOV_DepartmentId_LOVUIHints_NullValueId is defined in an ListBinding Definition.It would seem that 2 lovDepartment instances are used one at line 370 LOCALVIEW_USAGE_model_EmployeesView_lovDepartment1_0
and one at line 374 LOCALVIEW_USAGE_model_EmployeesView_lovDepartment1
The one at line 374 LOCALVIEW_USAGE_model_EmployeesView_lovDepartment1 gets the variable bound at line 374
however LOCALVIEW_USAGE_model_EmployeesView_lovDepartment1_0 gets a null value and would explain the empty LOV
Can anybody explain what is happening here ? (and how to use bind variables in LOV queries)
Regards
Paul
(bump)
Edited by: Paul (MITsa) on Jul 14, 2009 10:46 AM
I've now tried all types of LOV from ChoiceList to Radio groupe by testing the application module - none of them work.....
Edited by: Paul (MITsa) on 14-Jul-2009 22:52when you rinvoke executeQueryForCollection the bind variables are allready set and they exist in Object[] object2 method parameters.
in order to change them you need something like:
private void changeGenericBindVariable(Object[] params, String paramName, Object paramValue) {
for (int i = 0; i < params.length; i++) {
if (paramName.equals(((Object[])params)[0].toString()))
((Object[])params[i])[1] = paramValue;
* executeQueryForCollection - overridden for custom java data source support.
protected void executeQueryForCollection(Object qc, Object[] params,
int noUserParams) {
changeGenericBindVariable(params, "pDeptId", "50")
super.executeQueryForCollection(object, object2, i);
But its better to set bind variables before you executeQueryForCollection. like when you invoke LOV.
For cascading LOVs and the problems i have check:
[http://adfbugs.blogspot.com/2009/07/jdeveloper-11-r1-cascading-lov-bugs.html] -
Csv no data found when using bind variables
Hi,
I have created a report, that uses 2 date variables to limit the query and rows display as they should. But clicking the csv link opens csv having one row stating 'No data found...'. If I set static values in place of variables, I get the right result. How could I use bind variables and get the right answer in csv (without coding my own function)?
KajaI am having the same problem.
The export link opens a new session without submitting the current page. The page item values are therefor not saved to cache before the export is undertaken.
Any report using page item bind variables in the where clause will not export correctly as the bind values are either null or those of the previous page submit.
Any ideas on how to get round this?? -
Using bind variable with IN clause
My application runs a limited number of straight up queries (no stored procs) using ODP.NET. For the most part, I'm able to use bind variables to help with query caching, etc... but I'm at a loss as to how to use bind variables with IN clauses. Basically, I'm looking for something like this:
int objectId = 123;
string[] listOfValues = { "a", "b", "c"};
OracleCommand command = new OracleCommand();
command.Connection = conn;
command.BindByName = true;
command.CommandText = @"select blah from mytable where objectId = :objectId and somevalue in (:listOfValues)";
command.Parameters.Add("objectId", objectId);
command.Parameters.Add("listOfValues", listOfValues);
I haven't had much luck yet using an array as a bind variable. Do I need to pass it in as a PL/SQL associative array? Cast the values to a TABLE?
Thanks,
NickNevermind, found this
How to use OracleParameter whith the IN Operator of select statement
which contained this, which is a brilliant solution
http://oradim.blogspot.com/2007/12/dynamically-creating-variable-in-list.html -
Trying to pass array to stored procedure in a loop using bind variable
All,
I'm having trouble figuring out if I can do the following:
I have a stored procedure as follows:
create procedure enque_f826_utility_q (inpayload IN f826_utility_payload, msgid out RAW) is
enqopt dbms_aq.enqueue_options_t;
mprop dbms_aq.message_properties_t;
begin
dbms_aq.enqueue(queue_name=>'f826_utility_queue',
enqueue_options=>enqopt,
message_properties=>mprop,
payload=>inpayload,
msgid=>msgid);
end;
The above compiles cleanly.
The first parameter "inpayload" a database type something like the following:
create or replace type f826_utility_payload as object
2 (
3 YEAR NUMBER(4,0),
4 MONTH NUMBER(2,0),
83 MUSTHAVE CHAR(1)
84 );
I'd like to call the stored procedure enque_f826_utility_q in a loop passing to it
each time, new values in the inpayload parameter.
My questions are:
First, I'm not sure in php, how to construct the first parameter which is a database type.
Can I just make an associative array variable with the keys of the array the same as the columns of the database type shown above and then pass that array to the stored procedure?
Second, is it possible to parse a statement that calls the enque_f826_utility_q procedure using bind variables and then execute the call to the stored procedure in a loop passing new bind variables each time?
I've tried something like the following but it's not working:
$conn = oci_pconnect (....);
$stmt = "select * from f826_utility";
$stid = oci_parse($conn, $sqlstmt);
$r = oci_execute($stid, OCI_DEFAULT);
$row = array();
$msgid = "";
$enqstmt = "call enque_f826_utility_q(:RID,:MID)";
$enqstid = oci_parse($conn, $sqlstmt);
oci_bind_by_name($enqstid, ":RID", $row); /* line 57 */
oci_bind_by_name($enqstid, ":MID", $msgid);
while ($row = oci_fetch_array($stid, OCI_RETURN_NULLS+OCI_ASSOC))
++$rowcnt;
if (! oci_execute($enqstid)) /* line 65 */
echo "Error";
exit;
When I run this, I get the following:
PHP Notice: Array to string conversion in C:\Temp\enqueue_f826_utility.php on l
ine 57
Entering loop to process records from F826_UTIITY table
PHP Notice: Array to string conversion in C:\Temp\enqueue_f826_utility.php on l
ine 65
PHP Warning: oci_execute(): ORA-06553: PLS-306: wrong number or types of argume
nts in call to 'ENQUE_F826_UTILITY_Q' in C:\Temp\enqueue_f826_utility.php on lin
e 65
PHP Notice: Undefined variable: msgnum in C:\Temp\enqueue_f826_utility.php on l
ine 68
Error during oci_execute of statement select * from F826_UTILITY
Exiting!Thanks for the reply.
I took a look at this article. What it appears to describe is
a calling a stored procedure that takes a collection type which is an array.
Does anyone from Oracle know if I can pass other database type definitions to a stored procedure from PHP?
I have a type defined in my database similar to the following which is not
an array but a record of various fields. This type corresponds to a payload
of an advanced queue payload type. I have a stored procedure which will take as it's input, a payload type of this structure and then enqueue it to a queue.
So I want to be able to pass a database type similar to the following type definition from within PHP. Can anyone from Oracle verify whether or not this is possible?
create or replace type f826_utility_payload as object
YEAR NUMBER(4,0),
MONTH NUMBER(2,0),
UTILITY_ID NUMBER(10,0),
SUBMIT_FAIL_BY VARCHAR2(30),
MUSTHAVE CHAR(1)
); -
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 use bind variables in desc flexfields in OA pages?
Use case: In EBS 11i we have a DFF on po_vendors and one of the segment has a table validated value set that is referencing a forms variable i.e :VENDORS.VENDOR_ID. Now after upgrading to R12 this won't work as the vendor pages moved to OA framework. Is there any way to reference the vendor_id column in OA framework?
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. -
I am very much new to PL/SQL to pardon my neivte.
I would like to have some PL/SQL code that uses
bind variables for insert statements and than issue
commit's after a specific number of inserts.
For example.
desc xxx.taba
a number
b varchar2(20)
I want to do someting like this:
declare
l_start number default dbms_utility.get_time;
create or replace procedure insert_xxx(commit in number)
begin
for i in 1 .. 1000
loop
:a:=i;
:b:=dbms_random.string('P', 20);
intert into xxx :a :b;
if i/mod=(number passed into to proc)
commit
end loop;
dbms_output.put_line
(round((dbms_utility.get_time-l_start)/100, 2) ||
' Seconds...' );
end;
end;
Can somebody help me out with the correct syntax
as I know it's incorrect.A few remarks
- procedures don't have hidden variables defined in the outside world, as procedures are black boxes, which communicate only with the outside world
using the actual parameter list
- procedures don't commit. The caller should always commit!!!
- procedures don't commit every <n> records. A commit finalizes a logical unit of work, not a technical one.
If I would have been your supervisor and you would have presented this code, I would have fired you on the spot.
Committing inside a loop also increases the likelihood of ora-1555 errors.
So: remove the current parameter
a and b should be formal parameters of the procedure
Inside the procedure it should read
insert into xxx values (a, b)
Sybrand Bakker
Senior Oracle DBA -
Hey Everyone,
I'm having a bit of trouble creating a report. I need the FROM part of the code to use bind variables. I have come up with this peice of code below but im getting the following error:
failed to parse SQL query:
ORA-06550: line 1, column 8:
PLS-00103: Encountered the symbol "" when expecting one of the following:
begin function package pragma procedure subtype type use
form
current cursor
The symbol "" was ignored.
ORA-06550: line 2, column 24:
PLS-00103: Encountered the symbol "" when expecting one of the following:
begin function package pragma procedure subtype type use
form
current
Can anyone see where im going wrong?
Thanks in advance,
-N.S.N.O.
Code*
DECLARE
x VARCHAR2 (4000);
BEGIN
x := x || 'select *';
x := x || 'from ';
x := x || :p13_schema;
x := x || '.ddl_log@';
x := x || :p13_db_name;
x := x || '_DBAAPEX.TNTEWW.COM';
RETURN (x);
END;Hey Roel and Daylocks,
After getting frustrated for a while i deleted the page and started again. I put in the exact same code and it worked just how i wanted in the first place :S
The only thing i did different is when i was creating the report region the first time around i used a normal SQL query, For Example:
select sysdate from dual;
Then i modified it to
DECLARE
x VARCHAR2 (4000);
BEGIN
x := x || 'select ';*
x := x || 'from ';
x := x || :p14_schema;
x := x || '.ddl_log@';
x := x || :p14_db_name;
x := x || '_DBAAPEX.TNTEWW.COM';
RETURN (x);
END;
Whereas on the second attempt i used the peice of code in question straight away. Its been a bit of a frustrating morning because i used a similar peice of code for a different application, nevermind tho :)
Thanks for your replys, much appreciated.
-N.S.N.O. -
How to use bind variables in the following query
CREATE OR REPLACE PROCEDURE MMDB.test IS
sel_qtn VARCHAR2 (10);
CURSOR PT_QUANTITY IS select * from mmdb.product_tree WHERE QUANTITY_CHECK ='E'
AND run_id = 100
a PT_QUANTITY%ROWTYPE;
BEGIN
FOR i IN PT_QUANTITY
loop
sel_qtn := i.quanttity-1;
While sel_qtn>=1
loop
insert into mmdb.product_tree (BILLING_ACCOUNT_NO ,S_CODE) values (i.BILLING_ACCOUNT_NO ,i.S_CODE||'E');
sel_qtn :=sel_qtn -1;
End loop;
commit;
end;Don't duplicate threads: How to use bind variables in the following query
-
Performance when using bind variables
I'm trying to show myself that bind variables improve performance (I believe it, I just want to see it).
I've created a simple table of 100,000 records each row a single column of type integer. I populate it with a number between 1 and 100,000
Now, with a JAVA program I delete 2,000 of the records by performing a loop and using the loop counter in my where predicate.
My first JAVA program runs without using bind variables as follows:
loop
stmt.executeUpdate("delete from nobind_test where id = " + i);
end loop
My second JAVA program uses bind variables as follows:
pstmt = conn.prepareStatement("delete from bind_test where id = ?");
loop
pstmt.setString(1, String.valueof(i));
rs = pstmt.executeQuery();
end loop;
Monitoring of v$SQL shows that program one doesn't use bind variables, and program two does use bind variables.
The trouble is that the program that does not use bind variables runs faster than the bind variable program.
Can anyone tell me why this would be? Is my test too simple?
Thanks.[email protected] wrote:
I'm trying to show myself that bind variables improve performance (I believe it, I just want to see it).
I've created a simple table of 100,000 records each row a single column of type integer. I populate it with a number between 1 and 100,000
Now, with a JAVA program I delete 2,000 of the records by performing a loop and using the loop counter in my where predicate.
Monitoring of v$SQL shows that program one doesn't use bind variables, and program two does use bind variables.
The trouble is that the program that does not use bind variables runs faster than the bind variable program.
Can anyone tell me why this would be? Is my test too simple?
The point is that you have to find out where your test is spending most of the time.
If you've just populated a table with 100,000 records and then start to delete randomly 2,000 of them, the database has to perform a full table scan for each of the records to be deleted.
So probably most of the time is spent scanning the table over and over again, although most of blocks might already be in your database buffer cache.
The difference between the hard parse and the soft parse of such a simple statement might be negligible compared to effort it takes to fulfill each delete execution.
You might want to change the setup of your test: Add a primary key constraint to your test table and delete the rows using this primary key as predicate. Then the time it takes to locate the row to delete should be negligible compared to the hard parse / soft parse difference.
You probably need to increase your iteration count because deleting 2,000 records this way probably takes too short and introduces measuring issues. Try to delete more rows, then you should be able to spot a significant and constant difference between the two approaches.
In order to prevent any performance issues from a potentially degenerated index due to numerous DML activities, you could also just change your test case to query for a particular column of the row corresponding to your predicate rather than deleting it.
Regards,
Randolf
Oracle related stuff blog:
http://oracle-randolf.blogspot.com/
SQLTools++ for Oracle (Open source Oracle GUI for Windows):
http://www.sqltools-plusplus.org:7676/
http://sourceforge.net/projects/sqlt-pp/ -
How to use bind variables with XMLTABLE?
I tried to use bind variables with xmltable statment. Here, my testcase:
create or replace function wsdltest return xmltype as
l_dummy xmltype;
l_stt clob;
l_name varchar2(500);
l_xml clob;
BEGIN
l_xml :=
'<definitions name="F1" targetNamespace="http://xmlns.oracle.com/orawsv/XFILES/F1" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://xmlns.oracle.com/orawsv/XFILES/F1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
<types>
<xsd:schema targetNamespace="http://xmlns.oracle.com/orawsv/XFILES/F1" elementFormDefault="qualified">
<xsd:element name="SVARCHAR2-F1Input">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="A-VARCHAR2-IN" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="F1Output">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="RETURN" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
</types>
<message name="F1InputMessage">
<part name="parameters" element="tns:SVARCHAR2-F1Input"/>
</message>
<message name="F1OutputMessage">
<part name="parameters" element="tns:F1Output"/>
</message>
<portType name="F1PortType">
<operation name="F1">
<input message="tns:F1InputMessage"/>
<output message="tns:F1OutputMessage"/>
</operation>
</portType>
<binding name="F1Binding" type="tns:F1PortType">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="F1">
<soap:operation soapAction="F1"/>
<input>
<soap:body parts="parameters" use="literal"/>
</input>
<output>
<soap:body parts="parameters" use="literal"/>
</output>
</operation>
</binding>
<service name="F1Service">
<documentation>Oracle Web Service</documentation>
<port name="F1Port" binding="tns:F1Binding">
<soap:address location="http://localhost:8080/orawsv/XFILES/F1"/>
</port>
</service>
</definitions>';
-- OK
l_stt := 'select * from xmltable(XMLNAMESPACES(''http://www.w3.org/2001/XMLSchema'' AS "XSD", default ''http://schemas.xmlsoap.org/wsdl/''),
''//definitions/types/XSD:schema/XSD:element[@name="SVARCHAR2-F1Input"]''
passing xmltype(:1)
columns
ab xmltype path ''.'' ) t';
EXECUTE IMMEDIATE l_stt INTO l_dummy using l_xml;
-- ERROR ORA-01006
l_name := '"SVARCHAR2-F1Input"';
l_stt := 'select * from xmltable(XMLNAMESPACES(''http://www.w3.org/2001/XMLSchema'' AS "XSD", default ''http://schemas.xmlsoap.org/wsdl/''),
''//definitions/types/XSD:schema/XSD:element[@name=:2]''
passing xmltype(:1)
columns
ab xmltype path ''.'' ) t';
EXECUTE IMMEDIATE l_stt INTO l_dummy using l_xml, l_name;
return l_dummy;
END;
Any idea ?
Thanks in advance
CyrylWhy are you using dynamic SQL statements? Why not just use something like this instead in your PL/SQL. I also replaced the leading // in your Xpath with just / since you start from the root node.
select *
INTO l_dummy
from xmltable(XMLNAMESPACES('http://www.w3.org/2001/XMLSchema' AS "XSD", default 'http://schemas.xmlsoap.org/wsdl/'),
'/definitions/types/XSD:schema/XSD:element'
passing xmltype(l_xml)
columns
ab xmltype path '.' ) t;Also, the above returns two rows, which I suspect is not what you want. Here is the pure SQL version for you to debug.
select *
from xmltable(XMLNAMESPACES('http://www.w3.org/2001/XMLSchema' AS "XSD", default 'http://schemas.xmlsoap.org/wsdl/'),
'/definitions/types/XSD:schema/XSD:element'
passing xmltype('<definitions name="F1" targetNamespace="http://xmlns.oracle.com/orawsv/XFILES/F1" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://xmlns.oracle.com/orawsv/XFILES/F1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
<types>
<xsd:schema targetNamespace="http://xmlns.oracle.com/orawsv/XFILES/F1" elementFormDefault="qualified">
<xsd:element name="SVARCHAR2-F1Input">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="A-VARCHAR2-IN" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="F1Output">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="RETURN" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
</types>
<message name="F1InputMessage">
<part name="parameters" element="tns:SVARCHAR2-F1Input"/>
</message>
<message name="F1OutputMessage">
<part name="parameters" element="tns:F1Output"/>
</message>
<portType name="F1PortType">
<operation name="F1">
<input message="tns:F1InputMessage"/>
<output message="tns:F1OutputMessage"/>
</operation>
</portType>
<binding name="F1Binding" type="tns:F1PortType">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="F1">
<soap:operation soapAction="F1"/>
<input>
<soap:body parts="parameters" use="literal"/>
</input>
<output>
<soap:body parts="parameters" use="literal"/>
</output>
</operation>
</binding>
<service name="F1Service">
<documentation>Oracle Web Service</documentation>
<port name="F1Port" binding="tns:F1Binding">
<soap:address location="http://localhost:8080/orawsv/XFILES/F1"/>
</port>
</service>
</definitions>'
columns
ab xmltype path '.' ) t -
Using BIND VARIABLES in REF CURSOR(s)
Hello I am having trouble making my pl/sql program work using bind variables.
here is a little snipit from my code:
declare
type ref_type is REF CURSOR;
ref_cursor ref_type;
summation_table varchar2(4000);
begin
summation_table := 'table_sum tsum';
open ref_cursor for
select * from :summation_table
where tsum.revenue = 1000
USING summation_table;
end;
The Error that I get is
"bad bind variable 'summation_table'"
could someone please help? I think the way 'tsum' is used could be a problem, but I don't know.SQL> CREATE TABLE TABLE_SUM(REVENUE NUMBER(10),
2 OTHER NUMBER(10));
Table created.
SQL> INSERT INTO TABLE_SUM VALUES(1000,1);
1 row created.
SQL> INSERT INTO TABLE_SUM VALUES(1000,2);
1 row created.
SQL> variable alpha refcursor
SQL> INSERT INTO TABLE_SUM VALUES(2000,3);
1 row created.
SQL> DECLARE
2 summation_table varchar2(30) := 'table_sum tsum';
3 PROCEDURE MYTEST(p_out out sys_refcursor)
4 IS
5 BEGIN
6 OPEN p_out for 'select * from '||summation_table||
7 ' where tsum.revenue = :val' using 1000;
8 END;
9 BEGIN
10 MYTEST(:alpha);
11 END;
12 /
PL/SQL procedure successfully completed.
SQL> print alpha
REVENUE OTHER
1000 1
1000 2
SQL> -
How to use Bind Variables in Essbase data control
Hi,
I am trying to use Bind Variables in MDX query while creating the Essbase Data Control. I have used the below query with the Bind Variable.. this query is working in Essbase admin console..but it is throwing error (*Invalid MDX Query)* while creating Essbase Datacontrol in JDeveloper.
MDX Query : SELECT {[Measures].Msr_2} ON COLUMNS, [Time].Children ON ROWS FROM cube
where ($name)
Could any body suggest me on how to use bind variables with Essbase Data control.
Thanks,
SwathiHello Swathi, can you please help me how you created Essbase DataControl? Also were you able to figure out this?
Thanks, Praveen. -
Hi,
I have the below cursor 1 which is working already.For my requirement i want to use bind variable like second cursor.But its telling Bind Variable "p_col_list" is NOT DECLARED.Please any onehelp me on this.
How to use bind variable Here.
Cursor1:
DECLARE
emp_cv sys_refcursor;
iid NUMBER := 1;
i_sql varchar2(100);
p_col_list varchar2(2000) := 'aaa,bbb,ccc,ddd';
BEGIN
i_sql := 'select '''||REPLACE(p_col_list, ',', ''',''')||''' from dual '||CHR(10) ;
dbms_output.put_line(i_sql);
OPEN emp_cv FOR i_sql ;
END;
Cursor2:
DECLARE
emp_cv sys_refcursor;
iid NUMBER := 1;
i_sql varchar2(100);
p_col_list varchar2(2000) := 'aaa,bbb,ccc,ddd';
BEGIN
i_sql := 'select '''||REPLACE(:p_col_list, ',', ''',''')||''' from dual '||CHR(10) ;
dbms_output.put_line(i_sql);
OPEN emp_cv FOR i_sql using p_col_list;
END;hello,
the reports parameterform capabilities are limited. if you want
to create sophisticated parameterforms, you should do that with
oracle forms or html forms.
regards,
the oracle reports team --pw
Maybe you are looking for
-
I just upgraded to mountain lion and I can't figure out how to use messages... it wants me to use AIM or something like it, but I can't change the user... How do I do this??
-
I send a reset for security question and do not receive an email
please help much appreciated for help.
-
DISAPPOINTED AT THE LACK OF CUSTOMER SUPPORT IN TR...
Hi all, I want to share my BT experience with you. I have been up to now a happy BT Infitinty customer. At the start of July I informed BT of a house move at the end of July. I happily signed for a new package, NO BRAINER as far as I'm concerned
-
Cell phone signal looking icon in Safari?
When Safari loads a new page, I see an icon in the upper left of the page briefly that looks like a cell phone signal meter. What is this? I'm using Safari on a self built Windows 7 machine and was wondering if I had some sort of malware or adware. I
-
I would like to add a 2-3 minute segment of a longer movie to my web site. I use wordpress which only allows for a 2MB media clip to be uploaded. What compression in Compressor (or elsewhere) would give me such a small file? Or is there another ro