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
Similar Messages
-
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.
-
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 -
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 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. -
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 -
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. -
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
AbhinavHi
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 -
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 -
Hello.
Is there a cross-platform way to get values of enviromental variables?
For example, on Win98 we set up variables in autoexec.bat
SET %myvar%=value
On winNT we use enviroment variables properties.
On Linux it is profile files.
Is there a general way to get those values in Java programs?
Many thanks!Hi Kevin
The answer is yes and no. You can retrieve some information re the java environment, the os and user settings from System.getProperty(String s) but I've not found a way of accessing all vars. If there is a SecurityManager in place you may find that you cannot even access these. See the doc for System.getProperties() for a full list of the default props that you can normally access.
Hope that this helps -
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 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)
-
Bind input field value to a variable fails
Business need : The user wants to re-evaluate lines by a percentage value which he fills via his BI-IP screen.
I created an INPUT FIELD in WAD and I am trying to link a variable value (initially created in BI-IP through transaction RSPLAN)
to this INPUT FIELD.
Whenever I fill the input field with a value, the value is not being transferred to the variable.
Please help how to bind an INPUT field value to a variable to be transmitted to a planning function.
I have made many trials but in vain.
Please help.Hi.
I will present my scenario (it works in my system). From this scenario you may "cut" implementation for your scenario.
Lets sat I have an input fileld item and I want to read value (in my case numeric value) and pass this value to any planning sequence.
1. Create in Bex variable (in my case it is formula variable) lets say Z_INPUT_VAR
2. In WAD, when you executin planning sequence (lets say by pressing button execute) in command EXEC_PLANNING_SEQUENCE_SIMPLE define data binding.
When you clicked data binding->variable input MANUALY your variable name (Z_INPUT_VAR) in popup window.
3. In variable type select (ITEM_INPUT) type
4. In web item select your input field item.
This way you will pass inputed value to vaariable and planning sequence.
Then in planning function you also may use VARV() to read value of Z_INPUT_VAR variable.
Regards. -
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) -
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
Maybe you are looking for
-
How to get names of all Windows in a Form Application at runtime
Dear All, I want to get the name of all windows in a form module programatically at run time. How to get it? Any help or comments will be highly appreciated. Thanks in Advance. Best Regards Bilal
-
FTP - FCC - GUILDFTPd - Unable to pick up multiple files with Wildcard char
Hi All, I am not sure if my issue is strange or i may be missing something here. I am using FTP - FCC and using GUILDFTPd to connect to my local machine. This is working perfect if i don't use wildcard characters in file name but if i use them it is
-
Report Pinter : need library for cash flow
Hi Friends, i have a requirement to change the cash flow using report painter. i'm finding dificulty in which library do i have to use for this requ. please suggest me . ans also please provide imp. links where i can uderstand and learn more. thanks!
-
Getting certificate errors using hotmail
I'm getting certificate errors intermittently when using hotmail. This has been happening for the 3 days I've had my Mac. Here's the error: Safari can't verify the identity of the website "secure.shared.live.com". The certificate for this website is
-
Need Text data table for GBSTA field(ref VBUP table)
Hi frns, Can anyone suggest me the table to extract text data for the field GBSTA . Cheers, Shana