Values of bind Variables
Hi All
I got the SQL text from the v$_SQL etc view, now i want to know th values of th bind variables that was submitted alongwith the query.
How do I query to get those values.
Regards
Abhinav
Hi
There is a view V$SQL_BIND_DATA which have a column VALUE.
Else, try the following select statement to obtain your bind values.
select
sql.sql_text line,
sqlbd.cursor_num,
sqlbd.position,
sqlbd.datatype,
'xx' || sqlbd.value || 'xx'
from
v$sql sql,
v$sql_cursor sqlc ,
v$sql_bind_data sqlbd
where
sql.address=sqlc.parent_handle and
sqlbd.cursor_num = sqlc.curno;
Firstly, v$sql includes all cursors on the database.
Secondly, v$sql_cursor is just those cursors for the current session.
Thirdly, v$sql_bind_data relates to all bind positions for all cursors on the database.
Since we are joining v$sql_cursor (just the current session cursors) with the v$sql and v$sql_bind_data we get the sql statement and bind position, type, value for each of the bind variables as well.
-Priya
Similar Messages
-
Dynamically assign value to bind variable in a view object before pageload
I found that it is extreamely hard to find an example to assign the bind variable in View object at runtime using a data attribute defined in Human task activity. Most of the available samples use a Literal value to do the assignment. In my case, I want to dynamically display the content by assigning the data attribute in Human task to the bind variable in view object before a pageload.
I do not want to bind the view object to some command component to click a button or link in order to make it work (Unnecessary components in my page).
The issue is how to access the data attribute in Human task in the java code of client interface in AppModule? or is there a way that I can access the data attribute in Groovy script expression of the bind variable? or if I can access the process data object defined in my BPM process to do the assignment at runtime?
Really need help on the issue, and I cannot believe that it is so hard to accomplish.
Thank you very much,chk this
Passing default value to bind variable on page load.
http://adfcodebits.blogspot.com/2010/03/bit-2-setting-bind-variable-value.html -
Passing value to bind variable of another table from one table
hi,
I have a multi select table. When one row is selected from this table (no button is clicked, only selection is done), an attribute from that selected row (say userid) should be passed to the bind variable of another table and the corresponding details of that particular userid should be displayed in the other table. When more than one row is selected, the other table should display no rows.
My main problem is what code has to be written to pass value to bind variable and where it should be written.
Please give me a detailed explaination as soon as possible.
Thank you.Sorry, didnot add this. The table is multi select table.
-
How to pass pageFlowScope variable value as bind variable for VO
Hi,
I have one fixed lov (not based on datasource), if i select any value in that lov i want to pass this value to a pageFlowScope variable.
After this i want to use this value as bind variable for VO. whenever the vo executes thereafter this bind variable should filter that vo results.
My jdev version: 11.1.0.0
Thanks in advance,
SANsan-717,
can you elaborate on the use case instead of the implementation you don't get done? I understand you have data displayed in a tree: so lets assume the tree structure is Locations, Departments and Employees according to the Oracle HR sample schema.
1. What is the LOV supposed to do ?
2. Where is the LOV located ?
3. What values does the LOV show ?
4. Is the LOV a select choice component or a real LOV (with search dialog)
5. Where is the bind variable used ?
To me it sounds like you want to filter the tree data based on the select choice value. However, you wont do this by passing the bind parameter to all View Objects involved as they may not have the attribute in their query. So your use case is important to answer the question
Frank -
How to use List of values with bind variables on item?
Hi
I made a dynamic list of values with a bind variable as a provider. I tried to run the list, and it worked fine - i filled inn the bind variable when asked for, and i got a list of values to choose from.
I would very much like to use this list of values as an attribute on a custom made item. My wish is that when creating the item you someplace write the bind variable, and the list will then turn up as wanted. (I could f.ex add the variable as an attribute on the page type)
I tried to create a custom attribute and assign the list of values to it. It created an error when I then tried to add the attribute to the item.
Does anyone have any idea on how to solve this?
Any help appreciated!
Maja R. AnjerHi
i am getting error as
oracle.apps.fnd.framework.OAException: oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation. Statement: SELECT * FROM (SELECT meaning, lookup_code,lookup_type
FROM fnd_lookup_values
WHERE view_application_id = 200) QRSLT WHERE (lookup_type=:1 AND ( UPPER(MEANING) like :2 AND (MEANING like :3 OR MEANING like :4 OR MEANING like :5 OR MEANING like :6)))
Thanks
Mateti -
Reading value of bind variable
Hi,
I have been debugging a java application and in the process I wanted to know which values the application passed as bind variables. So i checked v$sql_bind_capture and enabled trace on the session. Unfortunately the datatype was TIMESTAMP, so the view did not show a value and all I got from the trace was a memory dump that is not of much use to me:
Bind#1
oacdty=180 mxl=11(11) mxlc=00 mal=00 scl=00 pre=00
oacflg=03 fl2=1000000 frm=01 csi=873 siz=0 off=24
kxsbbbfp=fffffd7ffdb6fbd0 bln=11 avl=07 flg=01
value=
Dump of memory from 0xFFFFFD7FFDB6FBD0 to 0xFFFFFD7FFDB6FBD7
FFFFFD7FFDB6FBD0 0D0B6C78 00010101 [xl......]Is there a function/way to convert this into a timestamp or at least the other way around?Just ran this little test:
SQL> CREATE TABLE t (c1 TIMESTAMP);
Table created.
SQL> INSERT INTO t VALUES (TRUNC(SYSTIMESTAMP));
1 row created.
SQL> COMMIT;
Commit complete.
SQL> SELECT TO_CHAR(c1) FROM t
2 UNION
3 SELECT DUMP(c1) FROM t;
TO_CHAR(C1)
13-NOV-08 00.00.00.000000
Typ=180 Len=7: 120,108,11,13,1,1,1Converting those decimals to hex gives you 78,6C,0B,0D,01,01,01 which accounting for reverse byte order is the same as your memory dump. So I think the bind value is 13-NOV-2008 00:00:00:000000.
Not quite sure how to get from the hex directly back to the date/time, but I'm sure someone knows!
Actually, Google was quite useful... take 100 off the first two decimal values: 120-100 = 20; 108-100 = 08, to give you the year: 2008. Then the 11 and 13 are the month and day. The remainder are hour + 1, minute + 1, second + 1. So just convert your hex to decimal and you should be able to see the value clearly!
Edited by: Mike Pargeter on 13-Nov-2008 16:54 -
How to see values for bind variables in statspack output
Hi all.
Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production
PL/SQL Release 9.2.0.4.0 - Production
CORE 9.2.0.3.0 Production
TNS for Solaris: Version 9.2.0.4.0 - Production
NLSRTL Version 9.2.0.4.0 - Production
Running sprepsql.sql to get full sql and explain plan from hash value...
SQL comes back with bind variables :1, :2, :3 etc.
How can I find out what the values are for the bind variables so i can plug them in and run them in test db?
Thanks for all your help.I don't have a trace file...
I need to know what the values are and if there is anyway to see them from the output of the sprepsql...
currently looks like:
select
r.status,
NVL(r.required_date, to_date('12/31/3999', 'MM/DD/YYYY')),
r.calc_qty,
r.issued_qty,
r.workorder_type,
r.workorder_base_id,
r.workorder_lot_id,
r.workorder_split_id,
r.workorder_sub_id,
r.operation_seq_no,
r.piece_no,
r.warehouse_id,
0,
wbs_code
from
REQUIREMENT r
where r.part_id = *:1*
and r.workorder_type = 'W'
and r.calc_qty > r.issued_qty
and r.subord_wo_sub_id is null
AND STATUS IN ('R', 'S','U','H','F')
AND WAREHOUSE_ID = *:2*
Thanks for your help. -
The new value of bind variable does not show up after changed by PL/SQL
Hi,
I am running APEX 3.2. I use PL/SQL process to assign a new value to a bind variable, say, :P2_TEST := 123. The new value does not show up on the page although I can see it in the Session status.
How can I make the new value to be displayed on the page immediately after the process is run?
Kind regards,
TeeMaybe you could use an ajax routine to refresh the item in your pl/sql routine?
Thank you,
Tony Miller
Webster, TX -
Error when Setting value to Bind variable in View Link used in HGrid
Hi
I have requirement to pass profile id as bind variable, I have created a VO based on below Query.
select 'N' Is_Selected, 'N' Is_Already_Selected, 'N' Is_Selected_Copy, a.*
from XXPA_STATE_CONST_DTLS_V a, xxpa_state_const_dtls b
where a.child_id = b.child_id(+)
and b.profile_id(+) = :1
View Link Query that is being generated is
SELECT * FROM (select 'N' Is_Selected, 'N' Is_Already_Selected, 'N' Is_Selected_Copy, a.*
from XXPA_STATE_CONST_DTLS_V a, xxpa_state_const_dtls b
where a.child_id = b.child_id(+)
and b.profile_id(+) = :1) QRSLT WHERE PARENT_ID = :Bind_ChildId
it Shows Errors as
## Detail 0 ##
java.sql.SQLException: Missing IN or OUT parameter at index:: 1
could anyone tell what could be the wrong. Do we need to set bind variable in view link Explicitly? or any other alternative.
Its very Urgent.
Regards
VimalHi,
I have faced similar problem some time ago. I could not find any solution except removing bind parameters in where clause. I tried to change binding style but it also didn't work. I think the problem is caused by view link's where clause. -
Hide new/old value of bind variable in SQL*Plus
Hi,
I have a SQL*Plus script to create a new user. It asks for username & password and then passes these values to a SP to do some checks and finally create the user.
The output is currently the following :
New user will be created in ORCL LAB
Enter the requested username : fleet2
Enter the password for fleet2 : *****
Re-enter the password for fleet2 : *****
old 2: labadmin_cr_user('&username', '&pswd', '&pswd2');
new 2: labadmin_cr_user('fleet2', 'fleet', 'fleet');
The requested username is already in use in the database. Please choose another username.
As you can see the passwords are now exposed when the procedure is called. This is not what I want off course. I cannot do termout off as the serveroutput is not shown as well in that case. I use dbms_output to show error messages to users. (see example above in case of an existing user).
Can anybody tell me how to hide these 2 lines (old 2, new 2) without hiding my dbms_output.
Thanks!
Krisset verify offhttp://download-uk.oracle.com/docs/cd/B10501_01/server.920/a90842/ch13.htm#1013382
-
How to pass a value to a bind variable in a query report in oracle apex
Hi Guys,
I have requirement to send weekly reports via email to some users. The users should receive their own records in the report. The user details is stored in a table. What I am planning to do is to create a report query in oracle apex to generate the report and then run a function/procedure via a scheduler to email the report to respective users. Now my query is ............. is it possible to pass a value (user name) to the report query to pull records of only that user? I know we can have bind variables in the report query but I have no idea how to pass a value for bind variables from a function/procedure.
Can anyone help me on this issue or suggest a better approach?
Thanks,
SanYou need to use dynamic sql
But please keep in mind that since you're using Oracle you may be better off posting this in some Oracle forums
This forum is specifically for SQL Server
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs -
How to use bind variable value for table name in select statement.
Hi everyone,
I am having tough time to use value of bind variable for table name in select statement. I tried &p37_table_name. ,
:p37_table_name or v('p37_table_name) but none worked.
Following is the sql for interactive report:
select * from v('p37_table_name') where key_loc = :P37_KEY_LOC and
to_char(inspection_dte,'mm/dd/yyyy') = :P37_INSP_DT AND :p37_column_name is not null ;
I am setting value of p37_table_name in previous page which is atm_state_day_insp.
Following is error msg:
"Query cannot be parsed, please check the syntax of your query. (ORA-00933: SQL command not properly ended) "
Any help would be higly appreciated.
RajInterestingly enough I always had the same impression that you had to use a function to do this but found out from someone else that all you need to do is change the radio button from Use Query-Specific Column Names and Validate Query to Use Generic Column Names (parse query at runtime only). Apex will substitute your bind variable for you at run-time (something you can't normally do in pl/sql without using dynamic sql)
-
Passing values in a vector list as bind variables in sql query.
Hi,
I have a vector list containing values 12,13,14.
vector<string> v;
v has values 12,13 and 14.
Here the number of values in vector list are not fixed.
I want to pass these values as bind variables to sql query.
Can anyone suggest me how to do this.
Thanks in advance!!Ah, the it's the classic 'Varying In-List' again
See:
The Tom Kyte Blog: Varying in lists...
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:110612348061 (started more than a decade ago, so scroll down for more recent examples) -
Hi,
I need to get bind variables on SIEBEL to test the performance of query and my problem is on BIND :3 because it's impossible to interprete this.
NAME POSITION LAST_CAPTURED VALUE_STRING
:1 1,00 02/17/2010 11:54:25 1-15BVYY
:2 2,00 02/17/2010 11:54:25
:3 3,00 02/17/2010 11:54:25 W1B 1AH%
:1 1,00 02/17/2010 12:48:04 1-15BVYY
:2 2,00 02/17/2010 12:48:04
:3 3,00 02/17/2010 12:48:04 TQ3 3BJ%
Thanks for your helpI have no erros.
I just want to get the real value of bind variable to run my query, but the problem is on bind 2.
When i run this
select name,position,last_captured,value_string
from DBA_HIST_SQLBIND
where sql_id='&SQLID'
i obtain this
NAME POSITION LAST_CAPTURED VALUE_STRING
:1 1,00 02/17/2010 11:54:25 1-15BVYY
:2 2,00 02/17/2010 11:54:25
:3 3,00 02/17/2010 11:54:25 W1B 1AH%
:1 1,00 02/17/2010 12:48:04 1-15BVYY
:2 2,00 02/17/2010 12:48:04
:3 3,00 02/17/2010 12:48:04 TQ3 3BJ%
What is the value of bind :2
Thanks -
LOV(af:selectOneChoice) with bind variable in af:table
Hi All,
I have a table where a column is defined as dropdown(af:selectOneChoice). The query for selectOneChoice has a bind variable which needs to be set as a value from the base view Object corresponding row.
Suppose a table Employee
EmpId EmpName EmpType Authorization
101 John Temp No
The above table is created as af:table and 'Authorization' is implemented as dropdown(af:selectOneChoice) . The selectOneChoice has a query(AuthorizationLovVVO) with bind variable . For each row of af:table(EmployeeVO) , af:selectOneChoice query(AuthorizationLovVVO) requires
the corresponding row(EmployeeVO) 'EmpType' to be set as value of bind variable.
Can you please suggest how can we achieve this functionality.
Edited by: 907302 on Oct 17, 2012 7:22 AM
Edited by: 907302 on Oct 17, 2012 7:22 AMI have checked the following post where it has been suggested to access the the current row value as groovy expression.
groovy for bind variable
Suppose my AM name is 'TestAM' , i have tried the below expressions for value of bind variable but it does not work :
1) adf.object.TestAM.findViewObject('EmployeeVO1').currentRow.EmpType
2) adf.object.TestAMDataControl.findViewObject('EmployeeVO1').currentRow.EmpType
None of the above expressions work and i get the error while running the page as 'Variable NotesAM is not recognized.' / 'Variable NotesAMDataControl is not recognized.' .
Can you please suggest if we can achieve the functionality using this approach . Also let me know if i am missing something in the above expression.
Maybe you are looking for
-
Mail attachment with UDF in SAP PI 7.1
Hello, I need to reproduce this solution in PI 7.1 /people/samuel.chandrasekaran2/blog/2008/10/06/xi-mail-adapter-dynamically-building-attachment-and-message-body-content-using-a-simple-udf It is about adding lines of a message as an attachment to a
-
Performance problem in File to ABAP Proxy scenario
Hi gurus, I have a scenario where the sender is sending a file and the receiver is ABAP Proxy.The file is a simple DAT file containing banking data.The file sample is as belo 00000MM21901 PYM0901021531 704401020100005510000040000D0002 704401
-
What router would work best for my app?
Hi, I have been looking at two Cisco routers for my home/work network. They are the 1811 and the 871 series. My network consists of 1 2K3 SBS (It dose my DHCP, Domain Controller, Wins, and active directory.), 2 Cad stations, 1 Email/web PC, 1 Noteboo
-
Query with subquery containing group clause doesn't return any rows - WHY ?
Hi, My query doesn't return any values : select g1.NTRX from gtrx g1 where exists (SELECT b.cfunctrx, b.cpro1trx, b.nmsgitrx, b.nmrc, b.ncrd, b.namtstrx, b.dltimtrx, b.nrtrftrx,count(*) FROM gtrxacq a, gtrx b WHERE a.ntrx = b.ntrx AND a.acq_bus_date
-
When I type on the iPad the cursor disappears
If I am typing in an email or a google document And have to go back to change something, I am unable to do so. If it lets me go back, I can't move the cursor back to the end of the sentence. Anyone else have this problem? I don't see the cursor at