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);

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:  409
View Complete with Replies

Related Messages:

How to display Long Raw value into textbox   (200 Views)
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.
Error while reading values from OracleDataReader   (228 Views)
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)){ // check if dr has any rows returned if(dr.HasRows) { //skip the 1st cursor out_FLDSET_CUR bool nextResult = dr.NextResult(); // retrieve data from the 2nd cursor // out_FLDSETMBR_CUR while(dr.Read()) { currFld = new FieldSet(); currFld.FSId = Convert.ToString(dr["FLDSPLR_CD"]); currFld.FSDesc = Convert.ToString(dr["FLDDFNTN_DSC"]).Replace(""," "); currFldList.add(currFld); } } throw 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.
unable to read the output parameter value of the stored procedure   (195 Views)
i am trying to retrive data from a oracle9i server using 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
Mysql auto_increment next value   (84 Views)
hi.. i want to know how to get auto_increment next value for a table
Searching Duplicate values in Excel - MVC   (125 Views)
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) { Hashtable hTable = new Hashtable(); ArrayList duplicateList = new ArrayList(); foreach (DataRow drow in dSet.Tables[0].Rows) { if (!string.IsNullOrEmpty(drow[colName].ToString())) { if (hTable.Contains(drow[colName])) duplicateList.Add(drow); else hTable.Add(drow[colName], string.Empty); } } foreach (DataRow dRow in duplicateList) dSet.Tables[0].Rows.Remove(dRow); return dSet; }
Failed to enable constraints. One or more rows contain values violating non-null, unique, or foreign-key constraints.   (146 Views)
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
No value given for one or more required parameters.   (203 Views)
, 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"&_
Insert values into oracle database using a query   (162 Views)
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.
How to get the value return from "select last_insert_id()" ?   (134 Views)
After Insert() I wanna get the automatic number with "select last_insert_id()" Code : ........ string mysqlstring = "select last_insert_id()"; MySqlDataReader myreader; myreader = mycommand.ExecuteReader(); int userid = myreader.GetInt16(0); ////-------------------------------- Error ! Why
add float value   (80 Views)
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
Total the values resulting from a count(*)   (134 Views)
Is it possible to add values returned from a count function 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.
Strange behaviour when passing textbox values   (195 Views)
, 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 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
ASP textbox values not being passed at all, frustrating   (193 Views)
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): Database Manipulator 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{ conn.Open(); comm.ExecuteNonQuery(); } catch{ Response.Write("This table has already been created!"); } finally { conn.Close(); } } 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"); } finally{ conn.Close(); } } Client Name: Product: Account Number: Product Cost: Shipping Costs:
ASP.NET does not receive all values from Sybase stored procedure   (128 Views)
Can anyone tell me why ASP.NET does not see all the items passed back from this Sybase stored procedure 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 @first_name varchar(30), @last_name varchar(30), @fullname varchar(50), @street_addr varchar(40), @city varchar(20), @phone varchar(20) SET NOCOUNT ON /* First, get their proper name */ EXECUTE pa_get_client_name @person_nbr, @first_name OUTPUT, @last_name OUTPUT /* Next, where do they live */ EXECUTE pa_get_latest_address @person_nbr, @street_addr OUTPUT, @city OUTPUT /* Now, the phone. */ EXECUTE pa_get_latest_phone @person_nbr, @phone OUTPUT SELECT @fullname = @first_name + " " + @last_name SELECT @fullname 'fullname', @street_addr 'street' , @city 'city' , @phone 'phone' RETURN end
[help]Error in inserting value into MySQL   (168 Views)
, 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
need help-inserted value are upside down question marks   (175 Views)
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,
ORA-01406: fetched column value was truncated   (185 Views)
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())
ExecuteNonQuery return value useless with stored proc?   (124 Views)
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.
Why does varchar2 accept numeric values?   (115 Views)
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
What value should NLS_DATA_FORMAT be set?   (141 Views)
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.