.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Post New Web Links

ORA-06550, PLS-00306; Error inserting data to Oracle procedure.

Posted By:      Posted Date: September 28, 2010    Points: 0   Category :ASP.Net
 

I have tried to troubleshoot this problem but to no avail. I get error while inserting a big chuck of data to Oracle package containing procedure 'INSCRAPP'. The error message is,

ORA-06550: line 1, column 7: PLS-00306: wrong number or types of arguments in call to 'INSCRAPP' ORA-06550: line 1, column 7: PL/SQL: Statement ignored

The C# code is big but I am providing the parameters I am passing,

oraCmd.Parameters.Clear();

                OracleParameter param_fName_in = new OracleParameter("fName_in", OracleType.VarChar);
                param_fName_in.Value = FirstName;
                param_fName_in.Direction = ParameterDirection.Input;
                oraCmd.Parameters.Add(param_fName_in);
                
                OracleParameter param_mi_in = new OracleParameter("mi_in", OracleType.VarChar);
                param_mi_in.Value = MiddleInitial;
                param_mi_in.Direction = ParameterDirection.Input;
                oraCmd.Parameters.Add(param_mi_in);

                OracleParameter param_lName_in = new OracleParameter("lName_in", OracleType.VarChar);
                param_lName_in.Value = LastName;
                param_lName_in.Direction = ParameterDirection.Input;
                oraCmd.Parameters.Add(param_lName_in);

                OracleParameter para


View Complete Post


More Related Resource Links

Trying to run a stored procedure from vb code with oracle data provider.

  

Hello,

Here is my SP:

create or replace
PROCEDURE ZGETUSERSSIGNONS (vUid IN VARCHAR2, p_getuserssignon_recordset1 OUT SYS_REFCURSOR) AS
BEGIN
 Open p_getuserssignon_recordset1 for
 SELECT Distinct(Userid), UserPassword, SecurityLevel, ActiveStatus
FROM ZSIGNON
WHERE substr(UserId,1,2) <> vUid
Order By UserId;
END ZGETUSERSSIGNONS;

I would like to run this SP from code and fill a gridview with the result. 

I am not sure how to go about this, as I have found several different examples, other than the one I  think I need.

I am using the oracle data provider and I have an input parameter (vUid, which will equal "zz").

First question. When filling a gridview with a result set from a stored procedure should the recordset OUT be defined as a REFCURSOR (like i did above)? 

Second:

Do you have example code as to how to execute the SP and fill a gridview?  I keep trying different variations of code i've found on the internet without any success other than getting more confused.

(I am using VS 2005, VB).

Thank you.

 

 


"An error occurred while retrieving data from Oracle Instance..."

  

I have succeffuly Imported the ADF and have also successfully created a Business Data Column. But when I try to query data , I get the following error

An error occurred while retrieving data from Oracle Instance. Administrator, see the server log for more information

And this is what I found in the Application Logs
A Metadata Exception was constructed in App Domain '/LM/W3SVC/81256521/ROOT-1-129217212004078822'. The full exception text is: LobSystem could not be found using criteria 'id=476'.


inserting data after caliculation using stored procedure

  
hi my requirement is like i want to insert data to table after caliculationliketable name salaryhikecolumns salaryinput,20%hike, 25%hike and 30%hikesalaryinput column details  to be input by the user and hike is to be caliculated and inserted with 20%hike, 25%hike and 30%hike are columns of same table.plz help me.thank you very much.

error in inserting data into the datasource

  

hello all i have a gridview and textbox i want to insert the data that typed in the textbox  into the gridview i can do this but in other culomn i just can insert number 
and when i type some world the error say:Invalid column name'every thing ' 
 

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="soal.aspx.vb" Inherits="soal" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">
        .style1
        {
            width: 100%;
        }
    </style>
</head>
<body bgcolor="#fe9cef">
    <form id="form1" runat="server">
    <div>
    
    </div>
    <table class="style1">
        <tr>
            <td>
                <asp:GridView ID="GridView1" runat="server" AllowSorting="True" 
                    AutoGenerateColumns=

Error converting data type nvarchar to numeric in Store Procedure execution

  

Hi,

When I execute a Store Procedure via 'EXEC sp_XXX @p1, @p2' I'm getting this error 'Error converting data type nvarchar to numeric'.

After diggin into the TSQL code I have found that there's a field (type: nvarchar(200)) breaking the execution and resulting on the error.

If I query the table and the specified field with the same parameters as the Store Procedure the results are ok! If I execute the same code as the Store Procedure with the same parameters values the results are ok. The error only happens when executing the Store Procedure.

Any idea ?

Thanks in advance,

Gustavo Brian

 

If I cast the field to a smaller size value, as nvarchar(80), it works, but of course with data truncation.

 


Error on getting return value from Oracle procedure in SSIS package

  
In my case, I want to execute a stored procedure in Oracle database using SSIS package and if there has error in Oracle, I want to get the error message from Oracle and pass it to SSIS to log the error.

I can execute the stored procedure through SSIS successfully, but the problem is I cannot get the error message using OUT parameter of procedure in Oracle, the following part is what I have done to test whether SSIS can fulfill my requirement:

1. Oracle client installed, use Microsoft OLE DB Provider for Oracle, Test Connection to Oracle succeeded.

2. The stored procedure created in Oracle database:
    create or replace p1(in1 varchar2, out1 OUT varchar2) as begin
        out1 := 'nice';
    end;


3. In the SSIS package, I add a "Execute SQL Task" component:

Variable defined = User::output (String datatype)
ResultSet = Single Row
SQLSourceType = Direct Input
SQLStatement =

    declare
        in1 varchar2(10);
        out1 varchar2(10);
    begin
        in1 := 'wow';
        out1 := '1a2';
&nbs

procedure for inserting data...........

  

Hello everybody,

I want to write a stored procedure which should get parameters like tablename, query, and primary field as arguments and then it should fire the query passed to it. It should first find the max+1 primary key field value in the table and then it should insert the data in the table. Can anyone provide me to write this procedure. There should not be restriction on the number of columns in the table for this procedure and it should be applied at any table bcs for this query should be passed by the application to the stored procedure.


Problem in Stored procedure when inserting data through openxml

  

I have stored proc where i insert some value from openxml but it is not inserting that xml data. Below is my stored proc.

set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
GO
ALTER PROC [dbo].[SP_MKTG_SERVICE_INSERT_NEW]
@ID AS INT,
@STATUS AS NVARCHAR(20),
@USERNAME AS NVARCHAR(50),
@DATEOFVISIT AS DATETIME,
@SUMMARY AS NVARCHAR(500),
@HOMESERVICE AS NVARCHAR(5),
@EXPIRYDATE AS DATETIME,
@SERVICELIST XML
AS
 SET NOCOUNT ON

BEGIN TRAN
IF EXISTS(SELECT * FROM NEW_DTL_SERVICE WHERE PARTNERID=@ID)
BEGIN
	DELETE FROM NEW_DTL_SERVICE WHERE PARTNERID=@ID
END

IF (@@ERROR <> 0)
BEGIN
	ROLLBACK TRAN
	RETURN
END
		DECLARE @IDOC INT
		EXEC SP_XML_PREPAREDOCUMENT @IDOC OUTPUT,@SERVICELIST
		INSERT INTO NEW_DTL_SERVICE
		(PARTNERID,[SERVICENAME],[TYPE],DISCOUNT,COMMISSION,CONDITION)
		SELECT @ID,SERVICENAME,TYPE,DISCOUNT,COMMISSION,CONDITION
		FROM OPENXML(@IDOC,'/NEWDATASET/TABLE1',2)
		WITH (SERVICENAME NVARCHAR(50),TYPE NVARCHAR(50),DISCOUNT NVARCHAR(50),COMMISSION NVARCHAR(50),CONDITION NVARCHAR(500))
		EXEC SP_XML_REMOVEDOCUMENT @IDOC
IF (@@ERROR <> 0)
BEGIN
	ROLLBACK TRAN
	RETURN
END
EXEC TIEDUPPARTNER @STATUS,@ID

IF (@@ERROR <> 0)
BEGIN
	ROLLBACK TRAN
	RETURN
END
COMMIT TRAN


and following is my xml which i generate to insert.

Oracle Data Provider for .NET error

  

Hi Members,

I'm trying to invoke an procedure in Oracle with my C# code and it keeps erroring out as "Invalid number or type of argument".

I've passed my statement as query string and try executing it. It worked fine but it keep failing when I call it via a Procedure. I've copied the procedure, source and the error message as well.

Kindly suggest.

Source Code:

using (IMTConnection conn = ConnectionManager.CreateConnection())
                    {
                        ((BasePage)this.Page).GeneralInformation = a + "-" + ucAdjustmentSettings.Settings.InvoiceID.GetType() + "-" + b + "-" + ucAdjustmentSettings.Settings.AccountID.GetType() + "Done";
                        string callStatement = "SP_ADJUST_INVOICE";
                        //string qrystr = "SELECT id_view FROM t_prod_view

Error inserting data in Excel spreadsheet from SQL 2005 SP

  

Hi,

I am using a SP on a SQL 2005 server to insert data into an Excel spreadsheet.

If I run the following query:

----

INSERT

INTO OPENDATASOURCE('Microsoft.ACE.OLEDB.12.0','Data Source ="\\wvns01\data\Finance\ZIP\FY2011_testZIP\BankFile.xls";extended Properties=Excel 8.0')...

Inserting personal error message in ValidationSummary

  

Hi,

I am creating a web form that requires a lot of validation. I use many of the validation control in asp.net already like RequiredFieldValidator and CompareValidator. 

My Problem: after my custom validation for the value entered return an error message, and I pressed enter key when the field is empty, my custom error message is overlapped by my ValidationSummary. 

Setting my custom error to visible = false on button click also does not seem to work as it requires for me to enter the value first.

This made me think, is there a way to insert my custom validation inside the ValidationSummary as an error message like for other validation control?

Thanks in advance


Inserting rows via stored procedure and under certain conditions

  

I'm using Dynamic Data with Entity Framework in VS2010.

Let's say my table has these fields:

MyTable
ID (PK)
PersonID (FK)
LocationID (FK)
TotalItemsSold

Hypothetical scenario (it's easier for me to explain this way, so just bear with me for now)... But let's say each row in the table represents "how many items were sold by such-and-such employee at such-and-such location," where location and person are foreign keys which are referencing other tables.  Basically, there should be no more than a ONE row which has a particular combination of Person and Location.  Makes sense?

So, when inserting new rows using my Dynamic Data app, the insert form displays editable fields for Person (dropdown), Location (dropdown), and Items Sold (textbox).  How do I prevent users from inserting another row into the table containing an already-existing combination of Person and Location?   How do I displaying useful feedback to them in the event that they DO attempt to do this?

I have several thoughts about this, but since I'm new to Dynamic Data, I'm not sure which way to go.  For example:

Option 1:  Use "cascading dropdowns" approach in the insert form and only pull in the "allowed" combinations of the two dropd

datarow data insertion error

  

this is the code which i am using and what i want means when i==0 first record should bind to datatable and when i==1 2nd record should bind to datatable. that means when i==1 1st and 2nd record should be present in datatable  Please see the code below

error:

when i am binding 2nd record to datatable 1st record is getting deleted and recently inserted value is getting inserted please tell me how to resolvie this

code:

datatable dt11=new datatable();
DataRow row11=null;



if (i == 0)
{
row11 = dt11.NewRow();

row11["qid"] = qnumber;

row11["question"] = question;
row11["useranswer"] = correctans;
row11["flag"] = answerstatus;

dt11.Rows.Add(row11);
}

if (i == 1)
{

qnumber =ds5.Tables[0].Rows[i][0].ToString();
question =ds5.Tables[0].Rows[i][1].ToString();


row11 = dt11.NewRow();

Inserting data to ExcelSheet

  

Hi all,

I have a web form, in that i'll enter daily expense details.

After i press save button, the data i entered are saved into an excel sheet.

I don't have idea how to save the data to excel sheet, so your help for this greatly welcome. 


Need Oracle Data Provider .CS File for Oracle 10g Database connection !

  

Hi.,

I need a 'Wrapper.cs' file which takes care of the Database connection ( Oracle 10g) where

i can just call the method with my SQL Query

(eg)

Gridview1.DataSource = SampleWrapper.ExecuteDatatable("THE SQL QUERY");

Gridview1.DataBind();

Plz Post the link if there is any open source !    


Reading data from .doc or .docx and inserting into db

  

Hello,

A vendor is providing content which needs to be inserted into the db. The content is basically questions with options and explanations. An example is below.

=========================================

Cast error when inserting record with Linq (to Sql)

  

Hello!

I'm getting  the following error message: 

Unable to cast object of type 'System.Data.Linq.DataQuery`1[Username]' to type 'Username'.

I've been searching but can't find a solution.  This particular table has 4 columns. The first column is the int indentifier.  Column 2 is "username" (varchar50) and is the primary key.  Column3 is "userID" (uniqueidentifier) and column 4 is "active" (varchar5) .

Try
            Dim dc As New DataClassesDataContext
            Dim c3 As New Username With {.userID = userGuid, _
                                    .username = userCustomName, _
                                    .active = "False"}

            dc.Usernames.InsertOnSubmit(c3)
            dc.SubmitChanges()

        Catch ex As Exception
            Throw ex
        End Try

 



Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend