Crystal Reports 9 and Stored Procedures using supplied parameters from user
Hi,
I have a Crystal Reports 9 report that prints and works fine. It requests from the user 2 pieces of data which both are String data and not nulls. I want to use the same report in a Visual Basic.Net 2003 program. I can pull the report onto the form and it runs wonderfully. I want to make it run programatically with out prompting for the user to key in the parameters. I can supply them from an existing data file. I have tried many things but have lacked the solution.
How can I pass the parameters from VB.Net 2003 to the stored procedure which runs the Crystal Report with in the VB.Net 2003 program.
I appreciate all help and comments.
Can this be done or do I need to just re-write the report in VB.Net 2003?
Thanks,
Norman
Hi, Norman;
It sure is possible to pass parameters to a Stored Procedure via our .NET SDK.
Have a look at these samples:
https://www.sdn.sap.com/irj/boc/index?rid=/library/uuid/9043bbbc-ae66-2b10-ce96-b48f9e25a450
There are samples showing passing parameters.
Regards,
Jonathan
Similar Messages
-
Crystal Report and stored procedure calls
Hi,
1. I am trying to access a Stored Procedure through Crystal Reports 2008. I have 3 Parameters in it and now I need the 2 Parameters from the stored Procedure to be given by User and the 3rd Parameter should be passed from the backend code. Please help me with the setps that would help me do this.
2.I also have another Stored procedure where I have 3 parameters and in addition to that I should provide two other parameters for user to enter. Now the total number of parameters will be 5 Parameters. Can any one let me know how to implement all these parameters.
3. In another Storedprocedure I have two Parameters which are discrete and multi select and both of them are cascaded. How do I implement those.
Thanks
PradeepPlease re-post if this is still an issue or purchase a case and have a dedicated support engineer work with you directly:
http://store.businessobjects.com/store/bobjamer/DisplayProductByTypePage&parentCategoryID=&categoryID=11522300?resid=-Z5tUwoHAiwAAA8@NLgAAAAS&rests=1254701640551 -
Calling a Stored Procedure with output parameters from Query Templates
This is same problem which Shalaka Khandekar logged earlier. This new thread gives the complete description about our problem. Please go through this problem and suggest us a feasible solution.
We encountered a problem while calling a stored procedure from MII Query Template as follows-
1. Stored Procedure is defined in a package. Procedure takes the below inputs and outputs.
a) Input1 - CLOB
b) Input2 - CLOB
c) Input3 - CLOB
d) Output1 - CLOB
e) Output2 - CLOB
f) Output3 - Varchar2
2. There are two ways to get the output back.
a) Using a Stored Procedure by declaring necessary OUT parameters.
b) Using a Function which returns a single value.
3. Consider we are using method 2-a. To call a Stored Procedure with OUT parameters from the Query Template we need to declare variables of
corresponding types and pass them to the Stored Procedure along with the necessary input parameters.
4. This method is not a solution to get output because we cannot declare variables of some type(CLOB, Varchar2) in Query Template.
5. Even though we are successful (step 4) in declaring the OUT variables in Query Template and passed it successfully to the procedure, but our procedure contains outputs which are of type CLOB. It means we are going to get data which is more than VARCHAR2 length which query template cannot return(Limit is 32767
characters)
6. So the method 2-a is ruled out.
7. Now consider method 2-b. Function returns only one value, but we have 3 different OUT values. Assume that we have appended them using a separator. This value is going to be more than 32767 characters which is again a problem with the query template(refer to point 5). So option 2-b is also ruled out.
Apart from above mentioned methods there is a work around. It is to create a temporary table in the database with above 3 OUT parameters along with a session specific column. We insert the output which we got from the procedure to the temporary table and use it further. As soon the usage of the data is completed we delete the current session specific data. So indirectly we call the table as a Session Table. This solution increases unnecessary load on the database.
Thanks in Advance.
RajeshRajesh,
please check if this following proposal could serve you.
Define the Query with mode FixedQueryWithOutput. In the package define a ref cursor as IN OUT parameter. To get your 3 values back, open the cursor in your procedure like "Select val1, val2, val3 from dual". Then the values should get into your query.
Here is an example how this could be defined.
Package:
type return_cur IS ref CURSOR;
Procedure:
PROCEDURE myProc(myReturnCur IN OUT return_cur) ...
OPEN myReturnCur FOR SELECT val1, val2, val3 FROM dual;
Query:
DECLARE
MYRETURNCUR myPackage.return_cur;
BEGIN
myPackage.myProc(
MYRETURNCUR => ?
END;
Good luck.
Michael -
- I have a Product list box (asp.net) used as multiple selected values for a parameter.
- The Product ID is defined in the Oracle procedure as NUMBER data type.
- In my crystal report, I have a parameter field allow multiple values as p_product_id type as Number. This is the code in my Record Selection Formula for the report:
({?p_product_id}[1] = -1 OR {Procedure_name.product_id} in {p_product_id})
- In C#, this is my code
List<decimal?> productUnit = new List<decimal?>();
int counter = 0;
decimal prod;
for (int i = 0; i < lstProducts.Items.Count; i++)
if (lstProducts.Items[i].Selected)
if (decimal.TryParse(lstProduct.Items[i].Value, out prod))
productUnit.Add((decimal?)prod);
counter++;
if (counter == 0)
productUnit.Add(-1);
ReportingDAO rDataFactory = new ReportingDAO();
retVal = rDataFactory.GetProductReport(productUnit);
public CrystalDecisions.CrystalReports.Engine.ReportDocument GetProductReport(List<decimal?> productUnit)
CrystalDecisions.CrystalReports.Engine.ReportDocument retVal = new rptProductDownload();
ReportLogon rptLog = new ReportLogon();
rptLog.Logon(retVal, "RPT_PRODUCT_DOWNLOAD");
retVal.SetParameterValue("p_product_id", productUnit);
I keep having the "Value does not fall within the expected range" when I debug. My question is, is the data type I used for procedure/Crystal report/ and C# correct ? I always have problem with the data type. Any help would be
appreciated
Thank youHi progGirl,
Thank you for your post, but Microsoft doesn't provide support for CrystalReport now. Please post your question in SAP official site here:
http://forums.sdn.sap.com/forum.jspa?forumID=313
Thank you for your understanding.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
PLS-00306:NET to call Oracle stored procedure,Use Array parameters
Development Environment:Windows 2003 SP2+Oracle 10g
. NET to call Oracle stored procedure, use an array of types of parameters
Step1:(In the Oracle database define an array of types)
CREATE OR REPLACE TYPE STRING_VARRAY AS VARRAY (1000) OF NVARCHAR2(255)
OR
CREATE OR REPLACE type string_array is table of nvarchar2(255)
Step2:
CREATE OR REPLACE PROCEDURE Test
(i_test in string_varray,o_result out int)
IS
BEGIN
o_result:=i_test.count;
EXCEPTION
WHEN NO_DATA_FOUND
THEN
NULL;
WHEN OTHERS
THEN
o_result:=0;
END arraytest;
Step3:
ODP.NET(Oracle 10g)
OracleConnection conn = new OracleConnection("User Id=test;Password=test;Data Source=test");
OracleCommand cmd = new OracleCommand("Test", conn);
cmd.CommandType = CommandType.StoredProcedure;
string[] str = new string[2] { "11", "222" };
cmd.ArrayBindCount=2;
OracleParameter p1 = new OracleParameter("i_test", OracleDbType.NVarChar);
p1.Direction = ParameterDirection.Input;
p1.CollectionType = OracleCollectionType.PLSQLAssociativeArray;
p1.Value = str;
p1.ArrayBindSize=new int[2]{2,3};
p1.ArrayBindStatus = new OracleParameterStatus[2]{
OracleParameterStatus.Success,
OracleParameterStatus.Success
cmd.Parameters.Add(p1);
OracleParameter p2 = new OracleParameter("o_result", OracleDbType.Int32);
p2.Direction = ParameterDirection.Output;
P2.CollectionType = OracleCollectionType.PLSQLAssociativeArray;
p2.Value=0;
cmd.Parameters.Add(p2);
int i = 0;
try
conn.Open();
cmd.ExecuteNonQuery();
i =(int) p2.Value;
catch (Exception ex)
finally
conn.Close();
Error:
Execution Failed:ORA-06550:Line 1,Column 7:
PLS-00306:Test parameters when calling the number or types of errors
ORA-06550:Line 1,Column 7:
PL/SQL:Statement ignoredHi,
See the answer in [this thread|http://forums.oracle.com/forums/thread.jspa?threadID=909564&tstart=0]
Hope it helps,
Greg -
Crystal Reports 2008 Stored Procedure and Parameters from LOVs
Quite simple report using stored procedure as data source. When editing some of the parameters we get this error when clicking OK to close "This stored procedure parameter can only accept multiple values. Please ensure that Allow Multiple Values is true."
As we all know stored procedure parameters do not access multiple values at all, so this message is very hard to debug. The report does work if we set the 'Allow Multiple Values' to true, but only when using exactly one value for the parameter. We have tried verify database and other things, but cannot find any way around this issue.
All ideas are appreciated as this is stopping us from utilizing the dynamic parameters.
Thanks, StigWe managed to work around the issue by creating a new stored procedure. First we used the same parameter names and changed the data source to the new stored procedure. After renaming the parameter with the issue the problem then was resolved.
Note that another parameter that was earlier affected by this issue in the way that it could not be edited and saved due to the same error message now also works fine. This even if this parameter has not changed names.
Quite a complex situation to debug this. Maybe if the source of the error message is found in the code we could help testing.
Stig -
Passing parameters from vb form to a crystal report with stored procedure
Can someone give me an idea how to use data inputted on vb form to be use as basis of crystal report generation which loads data from a stored procedure. Stored procedure has parameters that was also set in the crystal report. viewing on crystal report is ok but i am having difficulty running the report from vb.
Hi John,
If Not CRRpt.ParameterFields("AgeType") Is Nothing Then
CRRpt.ParameterFields("AgeType").CurrentValues.Clear()
Dim ParamValue As new CrystalDecisions.Shared.ParameterDiscreteValue
ParamValue.Value = AgeType.ToString
CRRpt.ParameterFields("AgeType").CurrentValues.Add(ParamValue)
End If
Note that the ParamValue.Value should be assigned with exact same data type as you declared it in CR.
If it is string, Convert your Variable to string first.
If it is date, make sure you are passing a date variable.
and so on...
Regards
Edy -
Crystal Reports with stored procedures
Hello Members,
I have come across a unique problem (only for me I guess). When I develop a report using a sql command (with sql script), I can run this report against any server or any datatbase dynamically with out using the "Set Data Source Loaction" found under database fields in field explorer. This report is based on a stored procedure and uses a OLEDB connection. When I developed this report for the first time, I defined its database connection (servername,database). Now I have created a same procedure with the same name on different server under a different database. I wanted to run this report against the new server, but I am getting an error " Failed to retrieve data from database". If i click OK on this pop up window. It displays another pop up window and says the old database name is not found in the new server. The criteria is the report should be able to run on any database on any server if the same stored procedure exists in there just like the report with sql command runs. How to solve this problem ?
Thanks in Advance!!!!Hi Raghavendra,
I know that is one of the way to do this ands it is manual process. The problem here is different clients will be running this report. Each client's data is located on different server and different database and this update process should be done automatically. Do you know any way to do this ?
Thanks!!!! -
Input xml file to crystal report and output pdf using java
Hi all,
I am in need, I am trying to give the input as dynamic extended Markup Language and output to be Plain Document Format file, in my crystal report using simple java code. If possible can anyone drop a sample code. that would be great.Hi Naveen,
If i have understood your requirement from your last post. this code should solve your problem.
What i understand is you want to export a report to PDF format and this report is using XML file data.
The below code Uses a report designed in Crystal report XI R2.
Its a Standalone application which uses a Dataset made using the xmldata(xml file) and the xmlschema(xsd file).
This Dataset is used to populate the report with data.
Eventually the report is exported to a physical location at the end of this code.
import com.crystaldecisions.ReportViewer.*;
import com.crystaldecisions.reports.sdk.*;
import com.crystaldecisions.sdk.occa.report.reportsource.*;
import com.crystaldecisions.sdk.occa.report.exportoptions.*;
import com.crystaldecisions.sdk.occa.report.data.IXMLDataSet;
import com.crystaldecisions.sdk.occa.report.lib.IByteArray;
import java.io.*;
public class XMLData
public static void main(String[] args)
final String RPT_NAME = "XMLReport.rpt";
try
ReportClientDocument rpt = new ReportClientDocument();
rpt.open(RPT_NAME, 0);
FileInputStream fin = new FileInputStream("C:
Thick_client
Amol_Sir
Amol.xsd");
ByteArrayOutputStream baos = new ByteArrayOutputStream();
byte[] bytes = new byte[1024];
for(;;)
int count = fin.read(bytes);
if(count < 0)
break;
baos.write(bytes, 0, count);
final byte[] xsdBytes = baos.toByteArray();
fin.close();
//read xml file
fin = new FileInputStream("C:
Thick_client
Amol_Sir
Abhi.xml");
baos = new ByteArrayOutputStream();
bytes = new byte[1024];
for(;;)
int count = fin.read(bytes);
if(count < 0)
break;
baos.write(bytes, 0, count);
final byte[] xmlBytes = baos.toByteArray();
fin.close();
IXMLDataSet xml_ds = new IXMLDataSet()
private IByteArray xmlData = null;
public void setXMLData(IByteArray xmlData) {
this.xmlData = xmlData;
public IByteArray getXMLData() {
return this.xmlData;
private IByteArray xmlSchema = null;
public void setXMLSchema(IByteArray xmlSchema){
this.xmlSchema = xmlSchema;
public IByteArray getXMLSchema() {
return this.xmlSchema;
xml_ds.setXMLData(new IByteArray() {
public void fromString(String arrayValue){}
public String toString() { return ""; }
public byte[] getBytes() { return xmlBytes; }
xml_ds.setXMLSchema(new IByteArray() {
public void fromString(String arrayValue){}
public String toString() { return ""; }
public byte[] getBytes() { return xsdBytes; }
rpt.getDatabaseController().setDataSource(xml_ds, "books/book", "books/book");
ByteArrayInputStream byteArrayInputStream = (ByteArrayInputStream)rpt.getPrintOutputController().export(ReportExportFormat.PDF);
rpt.close();
byte byteArray[] = new byte[byteArrayInputStream.available()];
//Create a new file that will contain the exported result.
File file = new File("C:
Thick_client
Copy of Amol_Sir
ExportedReport.pdf");
FileOutputStream fileOutputStream = new FileOutputStream(file);
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(byteArrayInputStream.available());
int x = byteArrayInputStream.read(byteArray, 0, byteArrayInputStream.available());
byteArrayOutputStream.write(byteArray, 0, x);
byteArrayOutputStream.writeTo(fileOutputStream);
//Close streams.
byteArrayInputStream.close();
byteArrayOutputStream.close();
fileOutputStream.close();
System.out.println("Successfully exported report");
catch (Exception exception)
System.out.println(exception.toString()); -
Error when linking report to stored procedure defined with one input parm
Error when linking report to stored procedure defined with one input parameter
The report will work ok, when the parameter is removed from the stpred procedure
An unhandled win32 exception occurred in crw32.exe[4480]
Stored Proc (sql server 2005)
USE [Allegro]
GO
/****** Object: StoredProcedure [dbo].[SP_Test] Script Date: 07/08/2009 10:42:14 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER procedure [dbo].[SP_Test](@valuationmode VARCHAR(55)) as
Begin
select
valuation,
valuationtime,
valuationmode
from valuation
where valuationmode = @valuationmode;
End;This is an example of a stored procedure that is trying to be linked to a new report as the only datasource.
If I remove the parameter I can create a report, however this will return all of the results of thw query to the report, rather than the desired results. If I add the parameter on the Crystal Report, the stored procedure then has to return all of the results to Crystal and then perform the filtering of records. By using a parameter in the stored procedure, you should be able to do all of the filtering as part of the query on the databse server, making this more efficient. -
Problems using Dynamic parameters with Crystal Reports and SBO 8.8
Has anyone been able to successfully use a dynamic parameter in Crystal Reports with 8.8 using the Business One connector? When we try we get an additional logon to the database that pops up and the logon fails.
We need this because we want to return live lists of PO documents from the server for selection. We are also trying to use nested dynamic parameters, because we want to first return the PO document based on the PO number, and then chose specific rows based on a field value in POR1.
It works if we don't use the Business One connector, but then the report doesn't function properly inside of SAP.
Any ideas would be appreciated.I have tried using tokens but they are too simple. I need something like a subselect where you first select one value and then another that is a subset of those values. Apparently the tokens can't even use a "where" clause.
SAP dances around Dynamic parameters, but won't come out and say that they can't be used with the B1 connector. If that is the case then they should just say so and stop wasting our time. Apparently Crystal is not truely interfaced with B1, just sort of hanging out with it.
I don't really care other than I have to do this select, subselect. If someone has a way to do that with tokens I would love to hear it.
Thanks,
Roy -
Passing parameters to sub report's stored procedure
I'm attempting to pass values from the main report to a linked sub report's stored procedure, but I haven't been successful yet.
I know how to filter the parameters on the return set of the stored procedure, using parameters from the main report. However, I would like the stored procedure executed for each record of the main report, using those values passed.I was getting "missing parameter values" trying to send parameters to a stored procedure in the subreport. Turns out there is a hot fix for my issue. Not sure if it matches what you're trying to do; you need to give more information on what you've already tried.
I was using CR XI, and also CR for VS 2005. The problem seems to be fixed with CR VS2005 SP1, for Visual Studio CR.
Look up under Business Objects Downloads: Crystal Reports > .NET > Hot Fixes
Files:
CRRedist2005_x86.msi
crvs05sp1.exe
Then open the report again, and re-save it.
This has fixed the problem for me.
Good luck! -
Creating and calling stored procedure using jdbc
When I try to create and call a stored procedure using JDBC a very confusing error message about non-existence of the procedure just created is thrown. Using Informix database (IDS 10). Any pointers to point out what am doing wrong would be great!
Thanks
import java.io.FileNotFoundException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Scanner;
public class CreateStoredProc {
public static void main(String args[]){
if (0 == args.length)
return;
try {
Class.forName("com.informix.jdbc.IfxDriver");
Connection conn = DriverManager.getConnection("jdbc:informix-sqli://10.76.244.120:30000/sampledb:INFORMIXSERVER=krisunda;user=root;password=cisco");
String q = " create procedure runproc() "+
" define i int; "+
" let i = 0; "+
" end procedure; "+
" execute procedure runproc(); ";
Statement stmt = conn.createStatement ();
stmt.execute (q);
} catch (Exception e) {
e.printStackTrace();
The stack trace:
java.sql.SQLException: Routine (runproc) can not be resolved.
at com.informix.jdbc.IfxSqli.a(IfxSqli.java:3204)
at com.informix.jdbc.IfxSqli.E(IfxSqli.java:3518)
at com.informix.jdbc.IfxSqli.dispatchMsg(IfxSqli.java:2353)
at com.informix.jdbc.IfxSqli.receiveMessage(IfxSqli.java:2269)
at com.informix.jdbc.IfxSqli.executeExecute(IfxSqli.java:2157)
at com.informix.jdbc.IfxSqli.executeExecute(IfxSqli.java:2132)
at com.informix.jdbc.IfxResultSet.b(IfxResultSet.java:378)
at com.informix.jdbc.IfxStatement.a(IfxStatement.java:1299)
at com.informix.jdbc.IfxStatement.executeImpl(IfxStatement.java:1269)
at com.informix.jdbc.IfxStatement.c(IfxStatement.java:989)
at com.informix.jdbc.IfxStatement.execute(IfxStatement.java:875)
at CreateStoredProc.main(CreateStoredProc.java:37)
Caused by: java.sql.SQLException
at com.informix.util.IfxErrMsg.getSQLException(IfxErrMsg.java:373)
at com.informix.jdbc.IfxSqli.E(IfxSqli.java:3523)
... 10 moreDriverManager.getConnection("jdbc:informix-sqli://10.76.244.120:30000/sampledb:INFORMIXSERVER=krisunda;user=root;password=cisco");check with ur sys admin wheather the particular user in the database has >execute privilage(rights) also.i mean execute the SP in the DB level.I guess that a root user will have the enough right.
String q = " create procedure runproc() "+
" define i int; "+<" let i = 0; "+
" end procedure; "+
" execute procedure runproc(); ";
Statement stmt = conn.createStatement ();
stmt.execute (q);Try to use the following code:
String q = " create procedure runproc() "+
" define i int; "+
" let i = 0; "+
" end procedure; "
Statement stmt = conn.createStatement ();
stmt.execute (q);
q=" execute procedure runproc(); ";
stmt.execute (q);
Because maybe the driver failed to precompile your sql once, so that nothing happen. -
. NET to call Oracle stored procedure, use an array of types of parameters
. NET to call Oracle stored procedure, use an array of types of parameters
Step1:(In the Oracle database define an array of types)
CREATE OR REPLACE TYPE STRING_VARRAY AS VARRAY (1000) OF NVARCHAR2(255)
Step2:
CREATE OR REPLACE PROCEDURE Test
(i_test in string_varray,o_result out int)
IS
BEGIN
o_result:=i_test.count;
EXCEPTION
WHEN NO_DATA_FOUND
THEN
NULL;
WHEN OTHERS
THEN
o_result:=0;
END arraytest;
Step3:
Use System.Data.OracleClient
C# Code:
OracleConnection conn = new OracleConnection("User Id=test;Password=test;Data Source=test");
OracleCommand cmd = new OracleCommand("Test", conn);
cmd.CommandType = CommandType.StoredProcedure;
string[] str = new string[] { "11", "22" };
OracleParameter p1 = new OracleParameter("i_test", OracleType.NVarChar);
p1.Direction = ParameterDirection.Input;
p1.Value = str;
cmd.Parameters.Add(p1);
OracleParameter p2 = new OracleParameter("o_result", OracleType.Int32);
p2.Direction = ParameterDirection.Output;
cmd.Parameters.Add(p2);
int i = 0;
try
conn.Open();
cmd.ExecuteNonQuery();
i =(int) p2.Value;
catch (Exception ex)
finally
conn.Close();
Error:
Execution Failed:ORA-06550:Line 1,Column 7:
PLS-00306:Test parameters when calling the number or types of errors
ORA-06550:Line 1,Column 7:
PL/SQL:Statement ignored
Edited by: user10133982 on Jun 4, 2009 7:13 AM. NET to call Oracle stored procedure, use an array of types of parameters
The use of ODP.net(Oracle 10g), the error is still the same
Step1:(In the Oracle database define an array of types)
CREATE OR REPLACE TYPE STRING_VARRAY AS VARRAY (1000) OF NVARCHAR2(255)
Step2:
CREATE OR REPLACE PROCEDURE Test
(i_test in string_varray,o_result out int)
IS
BEGIN
o_result:=i_test.count;
EXCEPTION
WHEN NO_DATA_FOUND
THEN
NULL;
WHEN OTHERS
THEN
o_result:=0;
END arraytest;
Step3:
ODP.NET(Oracle 10g)
OracleConnection conn = new OracleConnection("User Id=test;Password=test;Data Source=test");
OracleCommand cmd = new OracleCommand("Test", conn);
cmd.CommandType = CommandType.StoredProcedure;
string[] str = new string[2] { "11", "222" };
cmd.ArrayBindCount=2;
OracleParameter p1 = new OracleParameter("i_test", OracleDbType.NVarChar);
p1.Direction = ParameterDirection.Input;
p1.CollectionType = OracleCollectionType.PLSQLAssociativeArray;
p1.Value = str;
p1.ArrayBindSize=new int[2]{2,3};
p1.ArrayBindStatus = new OracleParameterStatus[2]{
OracleParameterStatus.Success,
OracleParameterStatus.Success
cmd.Parameters.Add(p1);
OracleParameter p2 = new OracleParameter("o_result", OracleDbType.Int32);
p2.Direction = ParameterDirection.Output;
P2.CollectionType = OracleCollectionType.PLSQLAssociativeArray;
p2.Value=0;
cmd.Parameters.Add(p2);
int i = 0;
try
conn.Open();
cmd.ExecuteNonQuery();
i =(int) p2.Value;
catch (Exception ex)
finally
conn.Close();
Error:
Execution Failed:ORA-06550:Line 1,Column 7:
PLS-00306:Test parameters when calling the number or types of errors
ORA-06550:Line 1,Column 7:
PL/SQL:Statement ignored
Edited by: user10133982 on Jun 5, 2009 7:48 AM -
Database updation using XML and stored Procedure?
Hello,
I want to perform updation in multiple tables using XML files.Please suggest can I do updation using xml and stored procedure.
If yes then which is more efficient and takes less time.
1.Updation using xml files only
2.Updation using xml files with stored procedure.
3.Stored procedure alone.
If direct xml and stored procedure communication is possible.then please write how.
Thanks in advance for any help.Here's a sample. The next code drop of the XSQL Servlet will make the easy-to-do from within XSQL Pages:
package package1;
import org.w3c.dom.*;
import java.sql.*;
import oracle.jdbc.driver.*;
import oracle.xml.sql.query.OracleXMLQuery;
public class Class1 extends Object {
public static void main( String[] arg ) throws Exception {
Connection conn = getConnection();
CallableStatement ocs = conn.prepareCall("begin ? := App.HotItems('PAUL'); end;");
ocs.registerOutParameter(1,OracleTypes.CURSOR);
ocs.execute();
ResultSet rs = ((OracleCallableStatement)ocs).getCursor(1);
OracleXMLQuery oxq = new OracleXMLQuery(conn,rs);
System.out.println(oxq.getXMLString());
oxq.close();
rs.close();
ocs.close();
conn.close();
public static Connection getConnection() throws Exception {
String username = "scott";
String password = "tiger";
String dburl = "jdbc:oracle:thin:@localhost:1521:xml";
String driverClass = "oracle.jdbc.driver.OracleDriver";
Driver d = (Driver)Class.forName(driverClass).newInstance();
return DriverManager.getConnection(dburl,username,password);
null
Maybe you are looking for
-
I think I used to be able to hover over the bookmarks toolbar affordance (the clipboard icon to the right of the star) and all my bookmarks would display in a vertical list as they do when I click the clipboard icon. Is this possible?
-
Display Image from Attachment?
Using the sample file (AttachmentTest2_version8_launch_attachment_new.pdf) found here, http://209.46.39.53/thread/341433?decorator=print&displayFullThread=true, I'm using this for a form that also has an image field where the user clicks to add image
-
ITunes and Quicktime 7 install errors
Hi folks Had no probs with these programs at all until the v7 release. Been running Quicktime Pro and iTunes for a wee while on version 6. When I run the iTunes v7.07 installer I get "The installation of Quicktime did not complete successfully. iTune
-
Dear Forum, We are having random errors working with those Bapis. We need to reasign materials from one salesorder / quotation to another and those bapis seemed to work fine, but latelly (specially after a hard testing) random errors may occur, havin
-
Connect Select 360 to Intel iMac...
Hi - How can I connect a LaserWriter Select 360 to an Intel iMac? I have an existing ethernet network, but the 360 has no eithernet connection on it. Is it possible to go from a serial port connection or a scuzzy (sp?) port to an ethernet network (i.