Dynamic pages submitting data to stored procedure
Hi,
I am developing an Oracle Portal application and I am facing a problem, if anyone could help me I'd be very grateful.
I have the latest version of Portal 3.0.9, installed on a linux server. I'm using I.E. 6.0 to interface with Portal.
I have a dynamic page that have a <form> tag, like this:
<form name="MyFormName" action="MySchema.MyStoredProcedure" method="post">
I changed the form name and the stored procedure name, because I'm in Brazil and these names are in portuguese, it won't make much sense in english...
Well, problem is, when I click on submit button, instead of calling the stored procedure, the browser tries to load a page called "http://MyServer/pls/MyDAD/MySchema.MyStoredProcedure" instead of calling the actual stored procedure. The procedure have all the parameters defined on <input> tags within the html code of the dynamic page.
I don't know what else I can do, any help or hint would be greatly appreciated. Sorry for my bad english.
Thanks In Advance,
Tiago Rocha
Have you specified any value (greater than 0) in the Portlet expires in ... minutes field ?
If you have, then I guess your dynamic page is getting cached.
Before submitting the form, do a right click on the browser page and view the page source.
What does the <form> tag look like ?
Does it still show the old procedure name ?
Similar Messages
-
Set page item from a stored procedure
Dear reader
We would like to have a stored procedure to run every 10 minutes. When the procedure starts, the user has to be warned that the update process is running.
When the procedure is finished, the user should receive a message that the update process is finished.
What I had in mind was to set a Page 0 item 'P0_REFRESH' and set his value depending on the status of the update. Then add a dynamic action with a change event. So everytime the value of this page item changes, the user will receive a correct message.
Does anyone know if it is possible to set a page item from a stored procedure?
Kind regards
XnniAndyPol
I found a solution by querying the user_jobs table. In Apex, I created two page 0 items that hold the current status of the job (online, offline) and the old value of the job.
Online of offline in the current status item is determined by a decode on "this_sec".
The enext step was to include a html region in P0 that contains some javascript. This javascript will display a message when the values of the new status is different from the old status ;)
Many thanks for bringing up the ideas.
Greetz
Xnni -
Hi to all... What is a XML data provider,stored Procedure, personal data providers in deski. when we use these data provider in desk top intelligence.. and use of it.
Please give detail description of the above...
Thanks for reply..........Hi,
We can create Desktop Intelligence reports using XML Data Provider, Personal Data Files and Stored Procedure.
Following is some detailed information about these three.
Xml data provider:
Xml data provider is used for the integration of external data sources stored in XML format.
This is similar to HTML.
Stored Procedure:
A stored procedure is a set of SQL commands that has been compiled and stored on the database server.
Once the stored procedure has been "stored", client applications can execute the stored procedure over and over again without sending it to the database server again and without compiling it again.
Stored procedures improve performance by reducing network traffic and CPU load.
Personal data files:
u2022 *.prn files
A PRN file is a special type of file which contains instructions for a printer, it tells the printer what to print on the page and where as well as which paper tray to use, what the paper size is and a number of other controls.
u2022 *.asc files
Between the values of a row any number of carriage returns or blanks are allowed. In any case it is strongly recommended that the data table be stored in such a way that it can be read and edited easily.
The values may be stored in any format (integer, floating point, exponential notation) and they must be separated at least by one blank. The class information must be of integer type, the row identifiers are interpreted as strings. The lines can have any length and must not contain any comment.
u2022 *.csv files
A CSV file is a specially formatted plain text file which stores spreadsheet or basic database-style information in a very simple format, with one record on each line, and each field within that record separated by a comma.
Regards,
Pradnya Kokil -
Inserting data using stored procedure
Using SQL Server Express 2014, I'm creating a stored procedure to accept parameters and convert data from a staging table to a production table. The parameters specify the table names and a field to lookup in another table. This is the first stored procedure
I've tried to create by myself though and I'm basing it on a guide. Here's what I've got so far:
CREATE PROCEDURE [dbo].[stp_UpdateAggregatePerf]
@prod_tbl NVARCHAR(250), @stg_tbl NVARCHAR(250), @customer NVARCHAR(20)
AS
BEGIN
DECLARE @p NVARCHAR(250), @s NVARCHAR(250), @c NVARCHAR(20), @cid int, @sql NVARCHAR(MAX)
SET @p = @prod_tbl
SET @s = @stg_tbl
SET @c = @customer
SET @cid = 'SELECT [dbo].[Customers].[CustomerID]
FROM dbo.customers
WHERE [dbo].[Customers].[CustomerName] LIKE ' + @c
SET @sql = 'INSERT INTO ' + @prod_tbl + '
SELECT CONVERT (datetime,TimeIndex,103) AS TimeIndex,
CONVERT(decimal(10,3),user_reads,3) AS Reads,
CONVERT(decimal(10,3), user_writes,3) AS Writes,
CONVERT(decimal,10,3),total_transfers,3) AS Total,
CONVERT(decimal(10,3),cp_reads,3) AS CPReads,
SUBSTRING(AggregateName,1,25),
SUBSTRING(ControllerName,1,25),
SUBSTRING(@cid,1,25)
FROM' + @stg_tbl
EXEC sp_executesql @sql
SET @sql = 'DROP TABLE' + @stg_tbl
EXEC sp_executesql @sql
END
So it should accept the parameters, take the customer name parameter and look up the customer ID field from another table to use in the last column, then generate and run the INSERT INTO statement to convert and transfer data, then drop the staging table.
I'm not sure how to go about using the INSERT statement with variables though, or even if I'm concatenating the string together correctly.
Here's my CREATE statements for the tables:
prod table:
CREATE TABLE [dbo].[AggregatePerf](
[AggrPerfID] [int] IDENTITY(1,1) NOT NULL,
[AggregateName] [varchar](25) NOT NULL,
[TimeIndex] [datetime] NOT NULL,
[Reads] [decimal](10, 3) NOT NULL,
[Writes] [decimal](10, 3) NOT NULL,
[Total] [decimal](10, 3) NOT NULL,
[CPReads] [decimal](10, 3) NOT NULL,
[ControllerName] [varchar](25) NOT NULL,
[CustomerID] [varchar](10) NOT NULL,
CONSTRAINT [PK_AggregatePerf] PRIMARY KEY CLUSTERED
[AggrPerfID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
Staging:
CREATE TABLE [dbo].[$tablename] (
[TimeIndex] VARCHAR(100)
, [user_reads] VARCHAR(100)
, [user_writes] VARCHAR(100)
, [cp_reads] VARCHAR(100)
, [total_transfers] VARCHAR(100)
, [AggregateName] VARCHAR(100)
, [ControllerName] VARCHAR(100)
The staging table is generated from PowerShell to import CSVs but I'm past that stage of the project now. I hope you can help me get an understanding here as once I wrap my around one table I can apply the same technique to others.
Thanks in advance
AdamWhy do you provide a tables as a parameters? I think you may avoid using dynamic sql and simple use a static one.
Where do you use @cid
variable?
Static SQL may look like
SELECT @cid=
[dbo].[Customers].[CustomerID]
FROM dbo.customers
WHERE [dbo].[Customers].[CustomerName] LIKE '%'+@c+'%'
Best Regards,Uri Dimant SQL Server MVP,
http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting:
Large scale of database and data cleansing
Remote DBA Services:
Improves MS SQL Database Performance
SQL Server Integration Services:
Business Intelligence -
Export data using stored procedure to excel
How to export and save data from SQL Server to MS Excel using stored procedure.
Thanks in advance
AbhinavYou can use multiple options
1. distributed query like OPENROWSET/OPENDATASOURCE
http://www.excel-sql-server.com/excel-import-to-sql-server-using-distributed-queries.htm
2. Using linked server /OPENQUERY
http://sqlwithmanoj.com/2010/11/12/query-excel-file-source-through-linked-server/
also see
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=49926
Please Mark This As Answer if it solved your issue
Please Mark This As Helpful if it helps to solve your issue
Visakh
My MSDN Page
My Personal Blog
My Facebook Page -
Displaying data from stored procedure into textbox fields based on user input.
I have a stored procedure that is selecting data from a table called "Vendor" in my database. The data that is being returned are vendor names, vendor addresses, vendor Id's, etc...In my stored proc, I have one parameter that allows
the user to enter a vendor name and then return all the data for that specific vendor. The report that I'm building is going to look like a basic form with a bunch of textboxes on the screen labeled Vendor Address, Vendor Id, Vendor City, Vendor State,
etc...In the report I'm trying to build, the user will enter in a vendor name and then it will return all of the vendor's data based on what the user searches for. However, the report will only return ONE vendor's data at a time.
The problem is that some of the data in the database has very similiar vendor names, but different vendor addresses, vendor Id's, etc...In some instances the vendor name is actually
exactly the same, but the vendor address, vendor city, vendor Id, is all different. So what I did was added another parameter in my report that shows a drop down list of vendor names based on the wildcard search the user just did and
allows the user to select the exact vendor name that he/she is looking for based on what they searched. The problem I'm having is that I don't know what expression I need to put in each one of my textboxes to retrieve the correct data from
the vendor table that the user selects from the drop down list. So what I want to do is return the exact data from the vendor table based on the selection that the user makes from that drop down list. It's like I somehow have to compare the
drop down list parameter directly to the dataset but I don't know what expression needs to go in the textbox. I've tried...=First(Fields!VendorName.Value, "DataSet1").EqualsParameters!DropDownList.Value(0) but I keep getting an error message.
--Here is an example of the kind of thing the user might search for...when the user searches the word "sprint" it returns three different vendor names to the drop down list.
1. sprint
2. sprint
3. sprint co
Each one of those three vendor names has a different vendor address, vendor city, vendor ID, etc...but the vendor names are extremely similar and in some cases
exactly the same. In my report now I can't get the textboxes to return the correct data based on what the user selects. Any advice at all is greatly appreciated.
P.S. I didn't even know what SQL Server was a month ago and had zero knowledge of SSRS at all. I've learned a lot recently, but if you could explain a solution in the easiest way possible I would appreciate it. Thanks!Hi Jrcowles,
If I understand you correctly, you wnat to list all the Vendor Name which like the user typed Vendor Name on a drop-down list, right? If in this case, we can use a cascading parameters to achieve your requirement. I have tested it on my local environment,
the steps below are for you reference.
Create an other stored procedure using the query below.
CREATE PROCEDURE GetVendorName
@VendorName NVARCHAR(50)
AS BEGIN
exec( 'SELECT * FROM Vendor WHERE VendorName LIKE ''%'+@VendorName+'%''')
END
Create another dataset DataSet2 and using the new created procedure.
Create another parameter VendorName2 and check "Allow Multiple Values" for this parameter.
On the Available Values tab, check "Get values from a query". Select corresponding dataset and field.
On the Default Values tab, check "Get values from a query". Select corresponding dataset and field.
The screenshots below are for you reference.
Reference
http://technet.microsoft.com/en-us/library/aa337169(v=sql.100).aspx
http://www.msbiguide.com/2012/02/adding-cascading-parameters-to-ssrs-reports/
Regards,
Charlie Liao
TechNet Community Support -
Web Service receives no data from Stored Procedure call.
Issue: When calling a Stored Procedure from a Web Service no data is returned.
Lead up: I can call the SP 100 times a day for 3-4 days then for some reason the Web Service no longer get the data from SQL. I have ran a trace and I can see the SP running though all of its steps and returning the data, but the Web Service
is not getting it.
Fix: None yet.
Work around: Before the Web Service calls the SP, I am sending an SP_Recompile to the SP in question. For now this seems to have resolved the issue.
Detail:
1. SP is querying data from another DB on the same server.
2. SP is storing query data in Temp Tables.Hello,
Does your Stored Procedure have parameters? If so, the issue may be cause by parameter sniffing. Please refer to the following blog about Paraemeter Sniffing:
http://www.sommarskog.se/query-plan-mysteries.html
The recommended fix for most situations is to not use parameters directly in queries, but rather store them into local variables and then use those variables in the queries.
Regards,
Fanny Liu
If you have any feedback on our support, please click here.
Fanny Liu
TechNet Community Support -
Preventing saved web pages submitting data
Hi,
whilst someone was messing around with a simple site I built
(literally just a guestbook thing using all the DW behaviours) they
found something I hadn't really thought about.
They could save the web page with the form on, to their
desktop. They could then use this saved form to submit data to the
webserver.
This got me thinking. If I was to use hidden form elements to
control the behaviour of the submitted data (for example, <input
name="dataaction" value="add">), in theory someone could save
the page, change the value to 'delete' and I don't really need to
say any more!
So my question is this - what's the best way to make sure
only pages served by the webserver can do anything (to disable
pages being able to be saved and edited)? I guess this can also
apply to URL tampering...
HTTP_REFERRER seems to be a little unreliable!
I'd rather know how to do this using DW behaviours or
something, but if not then any solution will do.
I'm interested in solutions for ASP and PHP.
Thanks in advance.quote:
Originally posted by:
Newsgroup User
New Guy wrote:
> they shouldn't be able to download your whole page- just
the html part.
> Hence- No functionality.
Not true. All that the attacker needs to do is to change the
value of
the action attribute to the URL, and the form data will be
accepted.
Using a hidden field that would permit anyone to change the
SQL query
from from INSERT to DELETE is simply asking for trouble.
Permission to
delete should be restricted to registered users on a
password-protected
part of the site.
David Powers, Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/
David,
I agree with the permissions thing and I think for the most
part what I'm thinking about is probably redundant.
I guess this is more of an exercise to see if there's a way
to make sure form submissions only come from the "correct" place as
a means of adding extra security.
Thinking about the original example I gave, using hidden form
fields to change the query type is not really an issue as a) all
query types would only execute depending upon user credentials
(login, user level, session, etc), and b) I tend to use different
database connections depending upon the userlevel and query type.
But I do still have an interest in resolving how to make sure
forms only "work" when submitted from a certain place.
Cheers,
- B -
How to retrive data through stored procedure in mysql from remote machine?
Hello everybody,
I am having problem in accessing data of mysql through stored procedure. It works fine if I use "jdbc:mysql://localhost:3306/[database name]" instead of "jdbc:mysql://[IP address]:3306/[database name]". The connection is fine for both, but when stored procedure is called the system stops at "stmt.execute();" line in java file while debuging. In case of localhost there is no any problem. The code for connecting procedure is:
stmt = dbConn.prepareCall("{? = call testing()}"); stmt.registerOutParameter(1, Types.VARCHAR); stmt.execute();
I have to connect java application running in Windows to the mysql database running in remote machine(RHEL 5).
I am using "mysql-connector-java-5.1.5-bin.jar", jdk 1.5.0 and remote database Mysql version : 5.0.22.
There is no exception and application hangs at stmt.execute();
Can anybody help me with this problem?
Thank you.I got it. its about connection...
-
OIM: Retrieve data from stored procedure, pre populate it in Resource form
Hi,
I need to retrieve data form a stored procedure that i have created . This data needs to be per populated in the Iplanet resource from. The stored procedure will have one input string and one output string.
Thankz,
Sanjay Rulez1. Prepare OIM Admin Console to interact with an Oracle Database, by adding jdbc jar files in the lib Directory of OIM Console.
2. Restart OIM Console and Create a database Resource
3. Create an Pre-populate adapter Task with a "Stored Procedure" Type
4. Invoke you Procedure.
The main problems can be around datatype conversion between Java and Oracle database.
For instance, all Oracle NUMBER type are mapped on java LONG type, and you need to deal every time with conevsrion between INTEGER and LONG in the adapter task. -
URGENT : Return Bulk data from Stored Procedure
Hi,
Tell me, how do I return a bulk of data which
does not exist in the data base
but is concluded while the Stored Procedure is executed
from the Stored procedure
to the C++ program.
For Example:
Table ABC
Field1 Field2 Field3
A 1 3
B 1 5
C 2 10
Table DEF
Field1 Field2 Field3
D 10 24
E 3 16
F 8 19
SP_TESTING
Depending on the values in both the tables
for some range of conditions,
a conclusion X is derived for each range value of the
condition range.
Now I need to return this bulk of data X with the
condition they belong to
back to the C++ code calling it....
NOTE : A stored procedure is requited as there is a lot
of processing
required before we conclude the result X for each value
in the condition range.
If I execute this code from C++ instead of Stored
procedure
it is very slow and speed is a prime requirement of my
system.
Also i'm not using any MFC class to access database.
I'm using ConnectionPtr, RecordsetPtr and _CommandPtr
from msado15.dll for database access...
One solution to this could be use of Temp tables.
As this process is used by a lot of different stored
procedures having a common
temp table to all will need something like 50 NUMERIC
fields, 50 VARCHAR fields
and so on, which doesn't seem like a very good solution
to this problem.
Sounds like something I would have done while in school,
implement a dumb solution.
So, please suggest me a solution as to how do I return
bulk data in the form
of recordsets from stored procedure.
Regards
ShrutiUse Out parameter mode
SQL> CREATE OR REPLACE procedure a1 (x OUT NUMBER, y OUT NUMBER) AS
2 BEGIN
3 x:= 1;
4 y:= 2;
5 END;
6 .
SQL> /
Procedure created.
SQL> SET SERVEROUTPUT ON
SQL> DECLARE
2 a NUMBER :=3;
3 b NUMBER :=4;
4 BEGIN
5 a1 (a,b);
6 DBMS_OUTPUT.PUT_LINE( 'a = ' || a );
7 dbms_output.put_line( 'b = ' || b );
8 END;
9 .
SQL> /
a = 1
b = 2
PL/SQL procedure successfully completed.By default parameters are copied to the OUT parameter mode .
COPY hint in PLSQL don’t send a pointer to calling program unit but NOCOPY
does.
Khurram -
Ora-06550 returning data from Stored Procedure and Entity Data Model
Hi.
I'm creating an application that uses a WCF Service to return data. I also created a proyect with the EDMX design and mapped most of my DBModel to a classes context. I have added some of the procedures as well. One of them receive some parameters and return a Sys_RefCursor, that is populated according to the parameters.
I have declared the "<add >" tags in the Web.Config and imported the function of the Procedure. When I call the Asyncronous function I get different exceptions:
1. If I call the function, with all of the parameters i get:
Oracle.DataAccess.Client.OracleException: ORA-06550: línea 1, columna 8:
PLS-00306: número o tipos de argumentos erróneos al llamar a
'SP_HECHOSJURITER'
ORA-06550: línea 1, columna 8:
(wrong number or types of arguments in call to 'SP_HECHOSJURITER')
2. If i just set 1 parameter in the SP, returning the same type of data, I get:
Error al recibir la respuesta HTTP a
http://localhost/Procalculo.CGFM.SIGOC.DatosServices/ServiceDatos.svc.
(failed to receive http response. error 12152)
3. If I don't set any parameters in the procedure, it works fine, and return correct data.
It exclusively happen with one entity.
Any clue?
I appreciate any help.When you return result sets from stored procedures to Entity Framework, you are very likely using implicit result sets. Implicit result sets don't need to be declared as a parameter in code, only in the <add> tags to define the metadata in the .NET config file.
For example, in the EF Oracle By Example, you'll see that the stored procedure in the function import has three parameters, but only two are declared in the code. The third one was defined in the config file.
http://download.oracle.com/oll/obe/EntityFrameworkOBE/EntityFrameworkOBE.htm -
JDBC - How to Get Data from Stored Procedure?
Gurus,
I am using Oracle Thin JDBC driver. A stored procedure has an IN parameter and an OUT parameter. The type of OUT parameter is TABLE of RECORD which is defined in the PL/SQL package in which the stored procedure is included. My question is if there is any way to call this stored procedure and process the data returned by the OUT parameter in my Java code.
Thanks.
Larrydefine in the pl/sql block as a cursor
register the out parameter as an oracle.cursor
on the java program get an object (from the statement), casting it to an resultset and then you can work on it -
Accessing Data from Stored Procedure using CallableStatement
I have created a Stored Procedure as shown , IS it possible to access these data inside my JDBC Program ??
CREATE or replace PROCEDURE getEmpName(EMP_NUM IN NUMBER)
is
CURSOR C1 is select from emp ;*
C2 c1%rowtype;
BEGIN
open c1;
loop
fetch c1 into c2;
exit when c1%NOTFOuND;
end loop;
END ;
*CallableStatement cs = conn.prepareCall("{call getEmpName(?)}");*What do you mean by :
IS it possible to access these data inside my JDBC Program ??JDBC provide/helps to execute a stored proc. when we say executing a proc, it actually executes on DB. So if a proc is written which has in and out parameter. and if does some work based on in parameter and returns the result in out parameter. Here if you mean, like can i read the out parameter and check what it has returned, then yes you can access this data from JDBC.
CREATE or replace PROCEDURE getEmpName(EMP_NUM IN NUMBER)
is
CURSOR C1 is select from emp ;*
C2 c1%rowtype;
BEGIN
open c1;
loop
fetch c1 into c2;
exit when c1%NOTFOuND;
end loop;
END ;
/But in your above proc it has only in parameter, no out parameter and has only select. so you could execute the proc using JDBC. -
Dynamic pages created from content stored in relation db - suggestions?
I'm involved in the early stages of a project and need some guidance on the best approach
to solve it. The idea is fairly simple. Users will access data stored in a relational database
and see the data presented to them as conventional web pages. The only dynamic part
of the web page is the query results returned to the user. The results will be wrapped in
HTML and JavaScript also stored in the database.
I've assumed that we'd just be using the browser, start page, Java applets, a JDBC and
the relational database to handle this.
Questions:
1. Once the applets have received all of the content back, in the correct order, from the
database, how is this fed to the browser so that it can be interpreted as a page?
2. Will be necessary to use servlets, and if so, at what point does this become a good idea?
I'm comfortable with the database issues, and have written a lot of HTML by hand. The part
I'm fumbling with here is the stuff in between. All suggestions are welcome, even those that
suggest that I RTFM - as long as the manual is named.
Thanks.hi,
1. Once the applets have received all of the content back, in the correct order, from the
database, how is this fed to the browser so that it can be interpreted as a page?
Well you dont actually need to use a Applet if you are just going to retrieve data from the Database for presentation in a Web page, you could use either Servlets or JSP for that, given that you already know HTML and java i dont think either of them is going to take time to learn.
Well you could a Servlet for eg and in the Servlet write the server-side logic for generating the dynamic html content which is to be presented in the client side, if you are doing lotz of HTML work in the Servlet, you could write a JSP (a JSP will allow you to embed java code along with HTML tagz, much like ASP). I would suggest you use servlets initially though and when you become comfortable enough with servlets, you could also use JSP with JavaBeans.
2. Will be necessary to use servlets, and if so, at what point does this become a good idea?
I think itz a better idea to use Servlets to Applets for what you have in mind, for you can get inherant support for sessions, etc also if you write an applet with all that logic, itz going to take time to download that. Also the applet will be only a part of the page, all HTML for eg will be outside of the applet, if you plan to do output using HTML, i think you should use Servlets/JSP instead of Appletz.
hope that helpz
cheerz
ynkrish
Maybe you are looking for
-
Error: 16 when trying to start trial version of elements 9
Hi. I might have posted this in the wrong forum the first time around (my first post on adobe ever...), so I try this one instead... I have been using pse6 for a few years, and because this version didn't support .NEF-files from my new Nikon D7000, I
-
Access migration - handling really silly field and table names
Hi All, I'm working through migrating an ** interesting ** Access database that has been hacked together over the years by a number of ... talented amateurs. I've noticed a difference in the way the migration wizard translates some of the really sill
-
Hi all, I want to use Ole2 object in my web dynpro. But i doesn't works. I think that i need to use [OfficeControl|http://help.sap.com/saphelp_nw70ehp1/helpdata/en/d1/af8841349e1909e10000000a155106/frameset.htm]. I know how to use OLE2, but I don't k
-
Use loadrunner to test Web Dynpro Java Application
Hi Gurus, I'm using Loadrunner 11.0 to do load test to Web Dynpro Java Application. At first, I used web(http/html) protocel script, and I could record the whole business process successfully. But the script seems very hard to understand. F
-
Credit Check on Ship to Party.
Hi Mark, For my Client, we are implementing Credit Check on Ship-to-Party. For a Sold-To-Party, we will have one or multiple Ship-to-Party Customers. When a Customer is created in ECC for Account Groups Sold-to and Ship-To, we are creating those ECC