Pass parameter to a view
We are using Oracle 7.3. Can I pass a parameter such as a date to a view ?? If so how?
Are you looking for something like this ?
SQL> ed
Wrote file afiedt.buf
1 CREATE OR REPLACE VIEW MY_EMP_VIEW AS
2 SELECT e.ename,e.deptno,d.dname
3 FROM emp e,dept d
4 WHERE e.deptno=d.deptno
5* AND USERENV('CLIENT_INFO')=e.deptno
SQL> /
View created.
SQL> select *from MY_EMP_VIEW;
no rows selected
SQL> EXECUTE dbms_application_info.set_client_info(30);
PL/SQL procedure successfully completed.
SQL> select *from MY_EMP_VIEW;
ENAME DEPTNO DNAME
ALLEN 30 SALES
WARD 30 SALES
MARTIN 30 SALES
BLAKE 30 SALES
TURNER 30 SALES
JAMES 30 SALES
999999 30 SALES
7 rows selected.Here, we can set dynamically the department number we want to view from the view created. These technique is used (in a more complex way) in multi-org system in Oracle Apps 11i with database 9i/10G.
But now VPD and FGA is more powerful with latest oracle database.
Similar Messages
-
How to pass parameter when create view link
Hi,
I used R12 to implement OAF. I create a VO with paramenter such as SELECT item_code,parent_item_code,month_budget_id
FROM cux_ce_month_budget_lines_t
where month_budget_id=:1
But when I create VL for this VO. It seems the parameter :1 can not be passed.
Could some one to help lookinto this?
Best Regards,
EileenYou donot need to pass parameter while creating the View Link. Once the view link is created then you assign the bind parameter to the master VO and execute the View link. The Child VO would automatically be executed.
-
How Pass parameter with Activex Viewer
Developper enviroment:
- Crystal Report XI
- Visual Basic 6.3
- Access 2007
Installa library : CRAXDDRT, CrystalActiveXReportViewerLib11_5
I need to pass some Value to the parameter field of my reports.
I use this code that working well to show the report and I need to add the right code to pass some parameter to the Report.
Dim CRXApplication As CRAXDDRT.Application
Dim CRXReport As CRAXDDRT.report
Private Sub Form_Load()
Set CRXApplication = CreateObject("CrystalRuntime.Application")
Set CRXReport = CRXApplication.OpenReport("C:\GR&A_Trend\R1_analisi.rpt", 0)
CrystalActiveXReportViewer4.ReportSource = CRXReport
CrystalActiveXReportViewer4.ViewReport
CrystalActiveXReportViewer4.EnableSearchControl = True
CrystalActiveXReportViewer4.Zoom (100)
End Sub
Can You help me to add the right code to pass some parameter to the Report.
Thank's
Regards
Giovanni RoiGiovanni,
I would love to help you on this however I only work under 2008 environment. Saying that, I am sure if you can re-arrange your coding you will get the desired result.
Here is the code which I used in my VS2008 to set the parameters under VB.net
'declaring all the parameter value fields
Dim crParameterFieldDefinitions As ParameterFieldDefinitions
Dim crParameterFieldDefinition As ParameterFieldDefinition
Dim crParameterValues As New ParameterValues
Dim crParameterDiscreteValue1 As New ParameterDiscreteValue
Dim crParameterDiscreteValue2 As New ParameterDiscreteValue
'the two text boxes which will carry the discrete parameter value
crParameterDiscreteValue1.Value = TextBox1.Text
crParameterDiscreteValue2.Value = TextBox2.Text
crParameterFieldDefinitions = _
cryRpt.DataDefinition.ParameterFields
'Start code parameter value
crParameterFieldDefinition = _
crParameterFieldDefinitions.Item("startcode")
crParameterValues = crParameterFieldDefinition.CurrentValues
crParameterValues.Clear()
crParameterValues.Add(crParameterDiscreteValue1)
crParameterFieldDefinition.ApplyCurrentValues(crParameterValues)
'End code parameter value
crParameterFieldDefinition = _
crParameterFieldDefinitions.Item("endcode")
crParameterValues = crParameterFieldDefinition.CurrentValues
crParameterValues.Clear()
crParameterValues.Add(crParameterDiscreteValue2)
crParameterFieldDefinition.ApplyCurrentValues(crParameterValues)
Hope this helps
Regards
Jehanzeb -
Pass parameter to new view in air desktop app
Hi Guys,
Have developed a mobile app that uses this code .....
public function generalList_ChangeHandler(event:IndexChangeEvent):void
navigator.pushView(Detail, list.selectedItem);
.... to pass data from a list item that the user clicks to a new view called Detail.
This is a very common requirement. ie Scroll a list, and then click on an item to go to a new view where the
details about the item selected are rendered.
..but, I cannot see how to do this in a classic air desktop app.
It must be pretty simple but it is not im Tour de Flex and I can't find a solution on the web.
What would the equivalent code for an air app please?
Thanks,
RichardOh, I see.
Your right if I remember correctly you implemented your own version of a ViewNavigator for your AIR application.
If you want to use the mobile components in your AIR application you need to add the swc to your project 'mobilecomponents.swc'.
You do this right click project->propertie, then select Flex Build Path and focus on the Library Path tab. Then click "Add SWC" and browse to 'C:\Program Files (x86)\Adobe\Adobe Flash Builder Burrito\sdks\4.5.0\frameworks\libs\mobile' and select the mobilecomponents.swc.
That should allow you to leverage the ViewNavigator in your AIR application. However, as your AIR app is not a MoblieApplication you will have to instanciate your own instance of ViewNavigator to use and push views to.
Hope that helps.
Greg -
Passing parameter to the i18n text from xml view in fiori app
Hi,
Could somebody let me know how to pass parameter to get the i18n text inside xml view of a Fiori app.
For e.g. inside my i18n properties file i have a entry like:
PEC_ISSUE={0}issues of total{1}
inside xml i use it like {i18n>PEC_ISSUE}
but now how do i pass those 2 parameters to this ??
i know in javascript it works with , (comma) but does not work in xml. Any help...
Thanks,
AshishHi Michele,
I found it. Below is the example from my coding.
<Text text="{parts: [{path: 'i18n>PEC_to'}, {path: 'promoprocsteps>RetailPromotionSalesFromDate_E'},
{path:'promoprocsteps>RetailPromotionSalesToDate_E'}],
formatter: 'retail.promn.promotioncockpit.utils.Formatter.formatDatesString'}" />
So you have to create a formatter and pass all the strings to the formatter and then do it inside JS.
In JS you do it in this way:
i18n.getText(i18String, [newString, string2]);
i hope this helps.
Regards,
Ashish -
How to pass parameter [bind variable or substitution variable] to a view?
How can I pass a parameter [bind variable or substitution variable] to a view in Oracle?
Some will tell me that this is not necessary, that I can only pass the parameter when I query the view, but I found some case where this cause performance issue. In long view where I use subquery factoring [WITH], it's necessary to pass the parameter many time through different subqueries and not only to the resulting view.
In other database (SQL Server, Access), we can pass parameters through query. I can't find how to do that in Oracle. Can some one tell me what is the approach suggest by Oracle on that subject?
Thank you in advance,
MB
What I can do:
CREATE VIEW "HR"."EMP_NAME" ("FIRST_NAME", "LAST_NAME")
AS
SELECT FIRST_NAME, LAST_NAME FROM EMPLOYEES;
What I want to do:
CREATE VIEW "HR"."EMP_NAME" ("FIRST_NAME", "LAST_NAME")(prmEMP_ID)
AS
SELECT FIRST_NAME, LAST_NAME FROM EMPLOYEES WHERE EMPLOYEE_ID IN (:prmEMP_ID);Blais wrote:
How can I pass a parameter [bind variable or substitution variable] to a view in Oracle?
Some will tell me that this is not necessary, that I can only pass the parameter when I query the view, but I found some case where this cause performance issue. In long view where I use subquery factoring [WITH], it's necessary to pass the parameter many time through different subqueries and not only to the resulting view.Yes, there can be performance issues. Views are a form of dynamic SQL and it is hard to predict how they will perform later.
You can't pass parameters to a view. They are not functions. The mechanism to put the values in is what you mentioned, passing the parameter when you query the view.
In other database (SQL Server, Access), we can pass parameters through query. I can't find how to do that in Oracle. Can some one tell me what is the approach suggest by Oracle on that subject? This functionality is not supported.
What I can do:
CREATE VIEW "HR"."EMP_NAME" ("FIRST_NAME", "LAST_NAME")
AS
SELECT FIRST_NAME, LAST_NAME FROM EMPLOYEES;
What I want to do:
CREATE VIEW "HR"."EMP_NAME" ("FIRST_NAME", "LAST_NAME")(prmEMP_ID)
AS
SELECT FIRST_NAME, LAST_NAME FROM EMPLOYEES WHERE EMPLOYEE_ID IN (:prmEMP_ID);Include the bind value when you use the view in a SELECT. The value will be applied to the view at run-time, somthing like
CREATE VIEW "HR"."EMP_NAME_VW" ("FIRST_NAME", "LAST_NAME","EMPLOYEE_ID")(prmEMP_ID)
AS SELECT FIRST_NAME, LAST_NAME FROM EMPLOYEES;
select *
from emp_name_vw
WHERE EMPLOYEE_ID IN (:prmEMP_ID);To use EMPLOYEE_ID I added it to your list of columns in the view so it can be referenced in the WHERE clause. If you don't want to see that value don't select it from the view. -
Can i pass parameter or global variable in view from 6i form
hi master
sir can i pass parameter or global variable in view from 6i form
i use view for some diff column calculation within the date then i use
where date between data1 and date2
in view but view not create
please give me idea how i pass external value in view
thank
aamirHi Antony!
I feel it may not produce the right results if you
dont include the where clause and using only group by
in view.You felt? Please clear, logical thoughts put here, not feelings.
(It may very well have all the Debit, Credit
for all the Accid where as the user wants only for
r some date range)Data range is determinated in Form by user, so if view should give final data set then you must back
on Ranjana first question: How to pass parameter or global variable to view from 6i form?
And also as Ranjit pointed out, If you have only
accid, sum(debit), sum(credit) in View, wheres this
enddate ??Of course, column entdate (or enddate?) must be included in view...
Cheers! -
Using Go URL to Pass parameter between dashboard
Hi All,
I am trying to pass parameter using GO URL functionality from one dashboard analysis field to another dashboard.
The navigation is working properly but the parameter is not getting passed, I am not sure why.
The Called dashboard has a analysis which has IS PROMPTED filter attached to it for the passing filter. I tried various ways to make this work
Option 1
In the calling analysis, I am using a Narrative View and inside I have used the below code.
<a href="saw.dll?Go&Path=/shared/MI/_portal/Client-MI&Page=Supplier%20Detail%20Tab&Action=Navigate&P0=1&P1=eq&P2=Dim%20Supplier.Supplier%20Name%20Current&P3=1+%22STR%20LTD%22"> @2[br/]
This one navigate but filtering is not happening
Option 2 (My first preference will be this option)
Also I tried to provide custom Data Format under the column Properties
[html]"<font class="nav" onclick=\"JavaScript:GoNav(event, '/shared/MI/_portal/Client-MI/Supplier Detail Tab','Dim Supplier','Supplier Name Current','"@"');\">"@"</font>
This ends up giving error
Type mismatch of catalog object /shared/MI/_portal/Client-MI/Supplier Detail Tab -- expected , got .
Error Details
Error Codes: UVWDR6UA
Also, both the tabs (Called and Calling are under the same Dashboard)
Can anyone please let me know, were I am making mistake. I tried refereeing Oracle documentation but still no result.
ThanksLooks like you've got it almost right - just an extra unneeded "
<a href="two.jsp"?ant=<%= ant %>"><%=antName%></a>
which should render on the page as something like
My Ant Task
When you click the link, it should pass that parameter, and you can get it via request.getParameter(). -
Error while passing parameter in Oracle Jdeveloper
Hi All,
I was passed Crystal report viewer object From Servlet it is Running fine but one problem in that while passing parameter from that page to data base it is not supporting (The ok Button on page).
can any one tell me how to find Action Button (.Jsp page)
Because i am using .jsp page That was made in CR4E
in that i found only jsp code I have not get how to work Action of that button
Also another problem while making Viewer.jsp pge ..rpt-Crystal reports--->>Create Viewer Jsp->>Insert CrysatlReport viewer API code------->>>1.Connectparameterinthat report 2.connect the crystalreportPageViewer while makin this page i was running on Apache tomcat Server it is not displaying Anything only Displaying Blank Browser
Can Any one help me...
Sincerly
AmolFor your first question can you please be a little more clear as to what you are referring to? I am not familiar with an action button for the parameter pages.... what I can tell you is that we don't have any jsp code for the viewer controls, all of that is generated dynamically at runtime. We do have a viewer SDK that you can use to set properties on the viewer; information about this can be found in the [Developer Library|https://boc.sdn.sap.com/developer/library] in the Viewer SDK documentation book.
For your second question, I assume you are referring to generating a viewer page from a report in Crystal Reports for Eclipse. You will need to uncomment the viewer code (for some reason when the page is generated, the viewer code has block comments surrounding it). You will probably want to make sure the parameter code is uncommented as well.
In addition to this, there is a helper file called JRCHelperSample.java that contains all of the helper methods for the automatically generated viewer page. This can be modified in whatever way you wish to suit your needs. -
hi i have a situation where i have to pass parameter to my method i don't what to pass the parameter define from the viewO because am not using parameter to query from the view,i just what to pass it to my procedure,my method is
public void submit_agr(String par_id,String dref_id,String tas_id,String agr_id){
ViewObject sub = this.findViewObject("AGR1");
i don't what to use this-> sub.setNamedWhereClauseParam("tas_id", tas_id); the tas_id is not in AGR1 VIEWO
// sub.
sub.executeQuery();
Row row = sub.first();
par_id = (String)row.getAttribute("par_id");
agr_id = (String)row.getAttribute("id");
callPerformSdmsLogon("SMS_FORM_TO_ADf.delete_agr(?)", new Object[] {par_id,dref_id,tas_id,agr_id});
}i try this AM IN jDEVELOPER 11.1.2.1.0
public void submit_agr(String par_id,String dref_id,String tas_id,String agr_id){
ViewObject sub = this.findViewObject("AGR1");
Row row = sub.first();
sub.setNamedWhereClauseParam("tas_id", new Number(10));-how will i pass this to my procedure
sub.setNamedWhereClauseParam("dref_id", new Number(10));-how will i pass this to my procedure
par_id = (String)row.getAttribute("par_id");
agr_id = (String)row.getAttribute("id");
sub.executeQuery();
callPerformSdmsLogon("SMS_FORM_TO_ADf.delete_agr(?)", new Object[] {par_id,dref_id,tas_id,agr_id});
}how will i pass the two prameter to my procedure
Edited by: Tshifhiwa on 2012/07/01 3:14 PM -
How to pass parameter /1BCDWB/DOCPARAMS from webdynpro?
Hi Experts,
We create a wdp view and indert an adobe form into it. And this form has an interface based on XML schema.
Now we want to translate this form into multi-language, and in wdp side, we will display diffenent language version of form for different regions.
I found that there is a paramater /1BCDWB/DOCPARAMS-LANGU, and it seems can control the language version in processing.
But I donot know how to pass parameter /1BCDWB/DOCPARAMS from wdp to adobe form.
Its my 1st to use adobe form and wdp, i really have no way out. Any advice will be Appreciated.
Thank you.
Richard@sahai: Hey no , I am using very very simple example without any query or complex statement. I just have 2 radio buttons in VIEW1. On clicking the radio button, the naviagtion to view2 is done and the value of selected radio button is passed as a parameter in the plug.
In the view2 , i just have a caption in my layout where i am displaying the parameter value by setting the attribute.THe warning i get is in view2. Here is the code. Apart from this there is no coding in view2.
METHOD HANDLEPLUG_IN_V2 .
DATA:
NODE_CAPT_MSG TYPE REF TO IF_WD_CONTEXT_NODE,
ELEM_CAPT_MSG TYPE REF TO IF_WD_CONTEXT_ELEMENT,
STRU_CAPT_MSG TYPE IF_VIEW2=>ELEMENT_CAPT_MSG ,
ITEM_MSG LIKE STRU_CAPT_MSG-MSG.
* navigate from <CONTEXT> to <CAPT_MSG> via lead selection
NODE_CAPT_MSG = WD_CONTEXT->GET_CHILD_NODE( NAME = `CAPT_MSG` ).
* get single attribute
NODE_CAPT_MSG->SET_ATTRIBUTE(
EXPORTING
NAME = `MSG`
VALUE = PAR_1 ).
ENDMETHOD. -
How to pass parameter to the Query String of the Named Queries'SQL
Firstly to say sorry,I'm a beginner and my English is very little.
Now I want to know
How to pass parameter to the Query String of the Named Queries'SQL in the Map editor.
Thanks.benzi,
Not sure if this is on target for your question, but see #5 in the link below for some web screencasts that show how to pass an input text form field value to the bind variable of a view object. If you're looking for something different, maybe provide some more details such as what you are trying to accomplish and what technology stack you are using - for example, ADF BC, JSF, etc.
http://radio.weblogs.com/0118231/stories/2005/06/24/jdeveloperAdfScreencasts.html
Also see section 5.9 and chapter 18 in the developer's guide.
thanks -
How can i pass parameter from a JSP form (depends on what user chooses from a select box to a Servlet.
I need to call multiple query based on what parameter choosen and display the result in table view.
Example :
1. User select choice1 from JSP form -> Servlet : call query Select * from Table1 where cond = choice1;
2. User select choice2 from JSP form -> Servlet : call query Select * from Table1 where cond = choice2;
Any sample code?
Thanks for any help.Thanks melondck.
I have this Servlet which i want it to run queries and display results in table format. I know there's something wrong with the code. But i am new to Servlet/Java. Thanks for anyone who point me the mistakes. Thanks.
<code>
package mypackage;
import java.sql.*;
import javax.servlet.http.*;
import java.io.*;
import javax.servlet.*;
public class DisplayServlet extends HttpServlet {
public void doGet(HttpServletRequest req, HttpServletResponse rsp)
throws ServletException, IOException {
rsp.setContentType("text/html");
String url="jdbc:mysql://localhost/smdb";
Connection con = null;
Statement stmt = null;
ResultSet rs = null;
String query;
ServletOutputStream out = rsp.getOutputStream();
PrintWriter out1 = rsp.getWriter();
String answer = req.getParameter("answer");
out1.println("<html>");
out1.println("<head><title> Inventory: </title></head>");
out1.println("<body>");
if (answer == null) {
StringBuffer action = HttpUtils.getRequestURL(req);
out1.println("<form action=\"" + action + "\" method=\"POST\">\n");
out1.println("<p><b>Please select:</b></p>");
out1.println("<p><input type=\"radio\" name=\"answer\" " +
"value=\"A\" /> Display All <br />");
out1.println(" <input type=\"radio\" name=\"answer\" " +
"value=\"B\" /> Device <br />");
out1.println(" <input type=\"radio\" name=\"answer\" " +
"value=\"C\" /> Manufacturer <br />");
out1.println(" <input type=\"radio\" name=\"answer\" " +
"value=\"D\" /> Location <br />");
out1.println(" <input type=\"submit\" value=\"Submit\" /></p>");
out1.println("</form>");
} else {
try {
Class.forName("com.mysql.jdbc.Driver");
con = DriverManager.getConnection (url, "user", "mypass");
stmt = con.createStatement();
if (answer.equals("A")) {
query = "SELECT Device, LocFloor FROM Inventory";
esleif (answer.equals("B)) {
query = "SELECT Device, LocFloor FROM Inventory where ....";
ResultSet result = stmt.executeQuery(query);
//Display the result set in a HTML table
out.println("<HTML><HEAD><TITLE>List</TITLE></HEAD>");
out.println("<BODY>");
out.println("<FORM NAME='form' ");
out.println("METHOD='GET'><TABLE BORDER='1' CELLSPACING='2' CELLPADDING='2'>");
out.println("<TR><TH></TH><TH>Device Type</TH><TH>Floor</TH></TR>");
while(result.next()) {
String type = result.getString("Device");
String flr = result.getString("LocFloor");
out.println("<TD>" + type + "</TD>");
out.println("<TD>" + flr + "</TD>");
catch(ClassNotFoundException e) {
out.println("Could not load database driver: " + e.getMessage());
catch(SQLException e) {
out.println("SQLException caught: " + e.getMessage());
finally {
//close the database connection.
try {
if (con != null) con.close();
catch (SQLException e) {}
out.println("</body></html>");
</code> -
Declaratively set the value of a bind parameter in a view query
Can I declaratively set that I want the value of the bind parameter in the view query to be the value of a specific field in the current row of a specific iterator in my data bindings? Thanks :D
user11976105 wrote:
Hm I guess I should mention I'm doing the retrieval in Java, using a ValueChangeListenerIn this case, you will still need to bind an ExecuteWithParams action to your page definition and execute it from your ValueChangeListener after supplying its named data.
In the code spinet, the new value from the ValueChangeEvent is passed to the bind variable.
public void yourValidChangeListener(ValueChangeEvent valueChangeEvent) {
// get the ExecuteWithParameters operation binding from the bindings
OperationBinding executeWithParameters = ADFUtils.findOperation("yourExecuteWithParametersBindingId");
// setup bind variable using the new value from the valueChangeEvent
executeWithParameters.getParamsMap().put("yourParameterId", valueChangeEvent.getNewValue());
// execute
executeWithParameters.execute();
// check for errors
if(executeWithParameters.getErrors().size() != 0) {
// error(s) occured
} -
Pass parameter to ADF application
Hi
My Englisg isn't very good.
I use jdeveloper 11.1.1.3.0
I want to pass some parameters from outer to my ADF application and access these parameters in application. I only have a jspx page.
How can I do it?
HabibHi
there are several solutions
1-If you want use these parameter in a view object ,You can define a method in application module that and pass that parameter to this method.
You can define this method in jspx managed bean.
2-You can define a view critera in your view object and call that view criteria in your page
Maybe you are looking for
-
Dear Gurus, multiprovider got 10cubes and we added recently new cube to that we created some queries on the multiprovider when we run the queries it doest shown any data do we have to do anything after changes done to multiprovider. the queries for o
-
Mac Mini running a second monitor
Does anyone know the possibilites of running a second monitor off the Mac Mini (I am currently running a Mac Mini Dual Core)? I was just reading about this USB to SVGA adapter that was in works by this company called Tritton (http://www.trittontechno
-
I have a Win 64 bit machine with LV 2009 When I try to turn on web server it won't let me. When I Choose tools/Web publishing tool a dialog box opens that says must correct all error before starting Web Service. The error list box says "NO ERRORS"!
-
Which table has Responsibility Name and Description?
FND_RESPONSIBILITY has RESPONSIBILITY_KEY and RESPONSIBILITY_ID but I cannot find table where it has Responsibiliy name, Description. Where that would be? Thanks, Data
-
Pasting in place to different layers?
in Illustrator CS5: I have a base layer. I have copied the one object on the layer, Comm C. My goal is to place it in exactly the same spot, one layer above. If I don't lock the original layer and PASTE IN FRONT via command F, it will only paste it d