Value of a variable


Hi ,

FOR c2 in (select name from emp) LOOP
FOR i in 1..40 LOOP
vvci := Replace(upper(vvci), ' :INTERMEDIATETABLE.VCOLUMN'||to_char(i), c2.vcolumn||i);
END LOOP;
END LOOP;

In the above code I want to get the value of c2.vcolumn||i. Is there any function which returns the same in PL/SQL.

Posted On: Monday 12th of November 2012 01:27:30 AM Total Views:  461
View Complete with Replies

RELATED TOPICS OF Oracle PROGRAMMING LANGUAGE




How to display Long Raw value into textbox

Hi : I am extracting field "BITS" : Long Raw Null value from Oracle database and trying to display that into textbox. I see this into texbox: System.Byte[] //Here is the line which is extracting the data from database and inserting into textbox txtEngSpecifications.Text=dt.Rows [ 0 ] [ "BITS" ].ToString(); Textbox in multiline. How can I display this data into textbox Thank you in advance.
VIEWS ON THIS POST

237

Posted on:

Wednesday 7th November 2012
View Replies!

Error while reading values from OracleDataReader

I have a OracleDataReader object which executes a procedure in Oracle Database 10g. This procedureis returning 2 cursors. I only need the values returned by the 2nd cursor, so I am using dataReaderObj.NextResult() to skip the first result set. Now I am looping through the second result set using dataReaderObj.Read() . In this loop when I try to access the values of the data in each column I am getting the following error "Operation is not valid due to the current state of the object." The code is as follows. using(OracleDataReader dr = (OracleDataReader) dataHelper.ExecuteReader conn,CommandType.StoredProcedure, spName, oparams)){\t // check if dr has any rows returned \tif(dr.HasRows)\t\t{\t\t\t //skip the 1st cursor out_FLDSET_CUR\t\t\t bool nextResult = dr.NextResult();\t\t\t // retrieve data from the 2nd cursor\t\t\t// out_FLDSETMBR_CUR\t\t\t\t\twhile(dr.Read())\t\t\t{\t\t\t\t\tcurrFld = new FieldSet();\t\t\t\t\tcurrFld.FSId = Convert.ToString(dr["FLDSPLR_CD"]);\t\t\t\tcurrFld.FSDesc = Convert.ToString(dr["FLDDFNTN_DSC"]).Replace(""," ");\t\t\t\tcurrFldList.add(currFld); }\t\t\t}\t\t\tthrow new Exception("No data returned from the stored procedure FMK_M_PRCNG_PKG.FMK_MS_FLDSET_SP"); } In the above code dataHelper is an object in a foundation libarary that i am using. I have also checked dr.FieldCount after the dr.NextResult() and gives me correctly the number of columns returned by the 2nd cursor. Also dr.Read() returns true for all the resultant rows in 2nd cursor.I am just not able to access the data values. Can anyone help me out why I am getting this error. I have tried searching several places but no luck. If you need any further information to give your suggestion please write back to me.
VIEWS ON THIS POST

259

Posted on:

Wednesday 7th November 2012
View Replies!

unable to read the output parameter value of the stored procedure

i am trying to retrive data from a oracle9i server using ado.net thru a stored procedure. the stored procedure takes in two input parameters and one output parameter. i am not able to get the value of the output parameter in my code. could some one see where i am making a mistake below is the stored procedure: CREATE OR REPLACE procedure sp_testing2 ( l_p number, l_p1 number, l_return out number) is begin if l_p > l_p1 then l_return := l_p; elsif l_p = l_p1 then l_return := 1; else l_return := l_p1; end if; exception when others then l_return := -1; dbms_output.put_line('err'); end; and here is the code which is trying to call the sp so that it can get the output value. Data.IDbConnection connection; Data.DataSet ds; connection = new Oracle.OracleConnection(); ds = new Data.DataSet(); connection.ConnectionString="Data Source=DLNSNA01;User ID=snaadm;password=snaadm;"; connection.Open(); Oracle.OracleCommand cmd = new Oracle.OracleCommand(); cmd.CommandText = "SNAADM.SP_TESTING"; cmd.CommandType = Data.CommandType.StoredProcedure; cmd.Parameters.Add("l_p",Oracle.OracleType.Number); cmd.Parameters[0].Direction = Data.ParameterDirection.Input; cmd.Parameters[0].Value = "20"; cmd.Parameters.Add("l_p1",Oracle.OracleType.Number); cmd.Parameters[1].Direction = Data.ParameterDirection.Input; cmd.Parameters[1].Value = "9"; cmd.Parameters.Add("out1",Oracle.OracleType.Number); cmd.Parameters[2].Direction = Data.ParameterDirection.Output; using (Data.Common.DataAdapter adapter = new Oracle.OracleDataAdapter(cmd)) { adapter.Fill(ds); } connection.Close(); } i am geting a system.error when adapter.Fill(ds) is called. could some one tell me how i can read the value of the output parameter\t
VIEWS ON THIS POST

230

Posted on:

Wednesday 7th November 2012
View Replies!

Mysql auto_increment next value

hi.. i want to know how to get auto_increment next value for a table
VIEWS ON THIS POST

100

Posted on:

Wednesday 7th November 2012
View Replies!

Searching Duplicate values in Excel - MVC

Hi , I am working in an MVC .net project. I use the below method to search for duplicate values in an excel sheet before uploading. The dataset contains all the rows in the excel sheet. the colName is one of the columns in the excel sheet where the duplication is checked. the values in the particular are checked , iterated and if unique a copy stored in hashtable and the duplicate is stored in array list and the entire row containing the duplicate cell value is deleted. "Here i only compare all the values in a single column of an excel sheet(colName). I would like to send two columns and compare a cell value in both the columns". Can anybody help me. public DataSet RemoveDuplicateRows(DataSet dSet, string colName) \t\t\t { \t\t\t\t\t Hashtable hTable = new Hashtable(); \t\t\t\t\t ArrayList duplicateList = new ArrayList(); \t\t\t\t\t foreach (DataRow drow in dSet.Tables[0].Rows) \t\t\t\t\t { \t\t\t\t\t\t\t if (!string.IsNullOrEmpty(drow[colName].ToString())) \t\t\t\t\t\t\t { \t\t\t\t\t\t\t\t\t if (hTable.Contains(drow[colName])) \t\t\t\t\t\t\t\t\t\t\t duplicateList.Add(drow); \t\t\t\t\t\t\t\t\t else \t\t\t\t\t\t\t\t\t\t\t hTable.Add(drow[colName], string.Empty); \t\t\t\t\t\t\t }\t\t\t\t\t\t\t \t\t\t\t\t\t\t \t\t\t\t\t } \t\t\t\t\t foreach (DataRow dRow in duplicateList) \t\t\t\t\t\t\t dSet.Tables[0].Rows.Remove(dRow); \t\t\t\t\t return dSet; \t\t\t }
VIEWS ON THIS POST

159

Posted on:

Wednesday 7th November 2012
View Replies!

Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.

Using Visual Studio with MySQL. In my XSD dataset I created a query. It runs perfect. I can preview the data fine. In my BLL I wrote code (see below) to retrieve the query results and I'm getting... Using db As New dsDemoTableAdapters.DemoTableAdapter Dim dt As New DataTable dt = db.GetDemo(DemoId) ' ERROR HAPPENS HERE Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints. Why would previewing the data work but in code it fails Any ideas
VIEWS ON THIS POST

179

Posted on:

Wednesday 7th November 2012
View Replies!

No value given for one or more required parameters.

, I am getting the "No value given for one or more required parameters."when importing an Excel 2003 spreadsheet into my web site. I have pinpointed the problem to be the last column in my SELECT statement. This column does not seem to be a reserved word and the the data in the column 'POS' and 'HMO' seems fine as well. The SELECT code is posted below as well as 4 other columns I am having the same problem (they are commented out for now). Any help solving this problem would be greatly appreciated. DimobjCommandAsNewOleDbCommand("SELECT[EmployeeName]asEmployee, "&_ "[ResidenceZipCode]asZipCode,"&_ "[Position]asEmpPos,"&_ "[FTExempt,FTNonExempt,PTExempt,PTNonExempt]asExempt,"&_ "[AnnualSalaryORHourlyRate]asRate,"&_ "[HoursPerPayCycle]asHoursPerPayCycle,"&_ "[DateofBirth]asDateOfBirth,"&_ "[Gender]asGender,"&_ "[Status:ActiveorCOBRA]asAorCStatus,"&_ "[PlanName]asPlnName"&_ "FROM[Census$]",objXConn) '"[WorkersCompCategory]asWorkersComp,"&_ '"[MedicalTier:EEOnly,EE&Child(ren),EE&Spouse,Family,Waived,NotEligible]asMedicalTier"&_ '"[#ofChildren]asNrChildren,"&_ '"[DentalTier:EEOnly,EE&Child(ren),EE&Spouse,Family,Waived,NotEligible]asDentalTier"&_
VIEWS ON THIS POST

242

Posted on:

Wednesday 7th November 2012
View Replies!

Insert values into oracle database using a query

I need to insert some values into a table in Oracle database. i need an example for how to do this in C# coding. Is there any way of it doing same as the OracleCommand.commandtext="select * from dual"; datareader=oraclecommand.executereader(); Thank you in Advance.
VIEWS ON THIS POST

194

Posted on:

Wednesday 7th November 2012
View Replies!

How to get the value return from "select last_insert_id()" ?

After Insert() I wanna get the automatic number with "select last_insert_id()" Code :\t\t\t ........ \t\t\t string mysqlstring = "select last_insert_id()"; \t\t\t MySqlDataReader myreader; \t\t\t myreader = mycommand.ExecuteReader(); \t\t\t int userid = myreader.GetInt16(0); ////--------------------------------\tError ! Why
VIEWS ON THIS POST

166

Posted on:

Wednesday 7th November 2012
View Replies!

add float value

in my database my datatype value is flot, so i entered some value as 3.10 but it taken as 3.1 how it posible i want to get as it is value how
VIEWS ON THIS POST

95

Posted on:

Wednesday 7th November 2012
View Replies!

Total the values resulting from a count(*)

Is it possible to add values returned from a count function\t My count function works properly, and I need to add the values resulting from the count function. Can the sum function be used on a count function - example sum(count(*)) - not sure of the actual syntax.
VIEWS ON THIS POST

165

Posted on:

Wednesday 7th November 2012
View Replies!

Strange behaviour when passing textbox values

, Recently i created two pages, one for creating user accounts and the other one for updating user information. Now I have no problem with creating accouts, as i pass the textbox values to my mysql command and add this code to a onclick of a button. everything works perfect. The strange thing is that i'm doing the same thing with 'update information' pageonly It only puts the old values and does not retrieve the new typed ones! The steps i followed are: 1- in my page load I load the current user information to the fields.(no problem here) protectedvoidPage_Load(objectsender,EventArgse) { MySqlConnectionmysqlc=newMySqlConnection("Server=localhost;Database=test;Uid=;Pwd=;"); StringIDString=TextBox1.Text +TextBox2.Text +TextBox3.Text +TextBox4.Text +DropDownList1.SelectedValue +TextBox8.Text; try { // // mysqlc.Open(); MySqlCommand sqlCommand = new MySqlCommand("", mysqlc); sqlCommand.CommandType = CommandType.Text; //For checking duplication sqlCommand.CommandText = "select id from alumni where id='" + hashString + "'"; MySqlDataReader checkReader = sqlCommand.ExecuteReader(); checkReader.Read(); 42 textbox1.Text = chechReader.GetString("Name"); } catch (MySqlException mse) { Label1.Text += mse.Message; } finally { mysqlc.Close(); } } 2- Then I let the user to type whatever he wants in the fields (except my primary key field which is read only). 3- When the user clicks on the button 'Save Changes' I again define some mysql command(a stored procedure) protected void Button1_Click(object sender, EventArgs e) { MySqlConnection mysqlc = new MySqlConnection("Server=localhost;Database=test;Uid=;Pwd=;"); try { mysqlc.Open(); mysqlcommand test = new........; Then I have lines like: test.parameters.addwithvalues("secondaryemail",textboxEmail.text); .... then i run the test.executenonreader(); And I get no errors } } 45 catch (MySqlException mse) 46 47 { 48 49 Label1.Text += mse.Message; 50 51 } 52 53 finally 54 55 { 56 57 mysqlc.Close(); 58 59 } 60 61 } Sorry, I'm posting this from my house, I will try to update it to the exact code when i get to the office. So my problem is that the new typed values in the asp controls do not go to my mysl database. Note that all of my textboxes and combo boxes have the default definition by asp.net 2.0. I didn't touch any viewstate or any postback thing. I do not want to go through the java script or ajax method because my server administrator is not willing to install ajax for now. Another reason is that it works for my user account creation and it should work for this one as well. I checked my stored procedure and it seems that there isn't any problem with it. I will post my mysql procedure later as well. I do not get any mysqlexception errors or any page errors,... Please help me if you could as i'm stuck with this problem for more than a week and unfortunately there is a deadline for me on friday. Best
VIEWS ON THIS POST

229

Posted on:

Wednesday 7th November 2012
View Replies!

ASP textbox values not being passed at all, frustrating

Ok, I'm using C#, ASP/SQL and MySQL as a test database. My code works in terms of syntax but for some reason, the value in the clientName textBox is NEVER passed. I test pass values without the textbox and the value does appear in the database table however, none of the data within the text boxes seems to pass properly for some reason (the error message never even comes up); Here's my code (I put the problem in bold): \t Database Manipulator \t void Page_load(){ string newTable1 = "CREATE TABLE Dev07 (cliID NVARCHAR(40),"+ "cProduct NVARCHAR(35),cusAccount INTEGER, prodCost FLOAT, shipCost FLOAT, totalCharge FLOAT)"; MySqlConnection conn = new MySqlConnection("Server=localhost;user id=testuser;pwd=password;database=test"); MySqlCommand comm; comm = new MySqlCommand(newTable1, conn); try{ \tconn.Open(); \tcomm.ExecuteNonQuery(); \t \t } catch{ \tResponse.Write("This table has already been created!"); \t\t } finally \t\t { \tconn.Close(); \t\t } } void submitClick(object s, EventArgs e){ MySqlConnection conn; MySqlCommand comm; conn=new MySqlConnection("Server=localhost;user id=testuser;pwd=password;database=test"); comm = new MySqlCommand( "INSERT INTO Dev07 (cliID)" + "VALUES (@cliID)",conn); comm.Parameters.Add("@cliID", System.Data.SqlDbType.NVarChar); comm.Parameters["@cliID"].Value = clientTextBox.Text; try { conn.Open(); comm.ExecuteNonQuery(); } catch { Response.Write("Error"); } \t\t\t finally{ \t\t\t\t conn.Close(); \t\t\t\t } } \t Client Name: Product: Account Number: Product Cost: Shipping Costs: \t \t
VIEWS ON THIS POST

225

Posted on:

Wednesday 7th November 2012
View Replies!

ASP.NET does not receive all values from Sybase stored procedure

Can anyone tell me why ASP.NET does not see all the items passed back from this Sybase stored procedure\t My result setin ASP.NET shows only the'fullname' and the characters "() -" from the phone variable. Street and city are returned empty!!! Here is the sp: DECLARE\t@first_name\t\t varchar(30), \t\t\t\t\t\t\t\t @last_name\t\t\t varchar(30), \t\t\t\t\t\t\t\t @fullname\t\t\t varchar(50), \t\t\t\t\t\t\t\t @street_addr\t\t varchar(40), \t\t\t\t\t\t\t\t @city\t\t\t\t\t varchar(20), \t\t\t\t\t\t\t\t @phone\t\t\t\t\t varchar(20) SET NOCOUNT ON /* First, get their proper name */\t EXECUTE pa_get_client_name @person_nbr,\t @first_name OUTPUT, @last_name OUTPUT\t\t\t /* Next, where do they live\t */ EXECUTE pa_get_latest_address @person_nbr,\t @street_addr OUTPUT, @city OUTPUT\t\t\t /* Now, the phone. */ EXECUTE pa_get_latest_phone @person_nbr,\t @phone OUTPUT\t \t SELECT @fullname = @first_name + " " + @last_name SELECT @fullname 'fullname', @street_addr 'street' , @city 'city' , @phone 'phone' RETURN end
VIEWS ON THIS POST

160

Posted on:

Wednesday 7th November 2012
View Replies!

[help]Error in inserting value into MySQL

, I am having problem in inserting a record into MySQL table using ASP.NET. I don't why it just keep inserting the NULL value into HP,System,and ADDDATE column. Below is my code: insert into compensation (HP,System,AddDate,Times) values (@HP,@System,@AddDate,1) MySQLODBCCmd.Parameters.Add("@HP", txtMobile.Text) MySQLODBCCmd.Parameters.Add("@System", SystemList.SelectedValue.ToString) MySQLODBCCmd.Parameters.Add("@AddDate", DateAdd(DateInterval.Day, -1, Now())) How to solve this probem\t
VIEWS ON THIS POST

211

Posted on:

Wednesday 7th November 2012
View Replies!

need help-inserted value are upside down question marks

hello, i just created a web application that connects to oracle. when i try to connect using oleDB connection and insert data in hebrewto the DB the inserted data appears as upside down question marks. when i want to read data from the DB there is no problem. i can see hebrew. also i tried to connect using ADODB. this works well. i understand that ADODB takes the environment from the DB. and the oleDB takes it from . net. i would rather use oleDB. i tried using encoding but for now with no success. in need of help,
VIEWS ON THIS POST

214

Posted on:

Wednesday 7th November 2012
View Replies!

ORA-01406: fetched column value was truncated

I'm selecting a Long Raw column into a ref cursor and returning the data to the web. If the file is less than about 4k it returns just fine but if it's over 4k when I try to read the results of my OracleDataReader I get the error above. Exception Details: System.Data.OracleClient.OracleException: ORA-01406: fetched column value was truncated Line 44: if (results.Read())
VIEWS ON THIS POST

235

Posted on:

Wednesday 7th November 2012
View Replies!

ExecuteNonQuery return value useless with stored proc?

It appears that OracleCommand.ExecuteNonQuery, when called with a command type of stored procedure always returns 1 instead of the number of records affected. Can anyone confirm this and if so, what can be done to see that this issue is fixed The workaround I have in place (for nearly 4 months now) is less than optimal.
VIEWS ON THIS POST

152

Posted on:

Wednesday 7th November 2012
View Replies!

Why does varchar2 accept numeric values?

Hi , I have a table with a column set as varchar2(100). If I insert into this a value as say 1000 and NOT '1000', it still inserts (8i) and I can also select from it without giving the argument in quotes. Why does this happen
VIEWS ON THIS POST

139

Posted on:

Monday 12th November 2012
View Replies!

What value should NLS_DATA_FORMAT be set?

I was performing TSPITR by using "recover tablespce 'COM1' untile time'May 25 2001 11:30:00';" But I got the error like: ORACLE error from target database: ORA-01858: a non-numeric character was foung where a numeric was expected text of failing SQL statement: select to date('MAY 25 2001 11:30:00') from sys.dual error occured in source file: krmk.pc, line 4329 Then I checked the doc and it said the environment variable NLS_DATA_FORMAT must be set if you use the 'until time' clause. But the doc didn't say anything about what sort of value this env variable should be.
VIEWS ON THIS POST

161

Posted on:

Monday 12th November 2012
View Replies!