PK violation (was "Please look at this. and help me out")


1. Create the following 3 tables. Choose appropriate data types and create all specified
primary and foreign keys.
Table: DEPARTMENTS
Name
----------------------------------------- --------
DEPARTMENT_ID Primary Key
DEPARTMENT_NAME NOT NULL
MANAGER_ID FK refers to PK of Employees table.
LOCATION_ID FK refers to PK of Locations table.
Table: EMPLOYEES
Name
----------------------------------------- --------
EMPLOYEE_ID Primary Key
FIRST_NAME
LAST_NAME
EMAIL
SALARY
PHONE_NUMBER
HIRE_DATE
MANAGER_ID FK refers to the PK of the Employees table.
DEPARTMENT_ID FK refers to the PK of the Departments table.
Table: LOCATIONS
Name
----------------------------------------- --------
LOCATION_ID Primary Key
POSTAL_CODE
CITY
STATE_PROVINCE
COUNTRY
************************

I have made the tables but they are not working for me. Please look at the code as when i try to enter data into these tables I get an error message Integrity Constraint Voilated

************************
CREATE TABLE KAPLAN_DEPARTMENT
(

DEPARTMENT_ID NUMBER NOT NULL,

DEPARTMENT_NAME VARCHAR2(20) NOT NULL,

MANAGER_ID NUMBER,

LOCATION_ID NUMBER
,
CONSTRAINT KAPLAN_DEPARTMENT_PK PRIMARY KEY
(
DEPARTMENT_ID
)
ENABLE,

CONSTRAINT DEPT_EMP_FK FOREIGN KEY(MANAGER_ID) REFERENCES KAPLAN_EMP(EMPLOYEE_ID) ENABLE,
CONSTRAINT DEPT_LOC_FK FOREIGN KEY(LOCATION_ID) REFERENCES KAPLAN_LOCATIONS(LOCATION_ID) ENABLE

)
;
***********************
CREATE TABLE KAPLAN_EMP
(

EMPLOYEE_ID NUMBER NOT NULL,

FIRST_NAME VARCHAR2(20),

LAST_NAME VARCHAR2(20),

EMAIL VARCHAR2(20),

SALARY NUMBER,

HIRE_DATE DATE,

MANAGER_ID NUMBER,

DEPARTMENT_ID NUMBER
,
CONSTRAINT KAPLAN_DEPARTMENT_PK PRIMARY KEY
(
EMPLOYEE_ID
)
ENABLE,
CONSTRAINT EMP_FK FOREIGN KEY(MANAGER_ID) REFERENCES KAPLAN_EMP(EMPLOYEE_ID) ENABLE,
CONSTAINT EMP_DEPT_FK FOREIGN KEY(DEPARTMENT_ID) REFERENCES KAPLAN_DEPT(DEPARTMENT_ID) ENABLE

)
;
*******************************
CREATE TABLE KAPLAN_LOCATIONS
(

LOCATION_ID NUMBER NOT NULL,

POSTAL_CODE NUMBER,

CITY VARCHAR2(20),

STATE_PROVINCE VARCHAR2(20),

COUNTRY VARCHAR2(20)
,
CONSTRAINT KAPLAN_LOCATIONS_PK PRIMARY KEY
(
LOCATION_ID
)

ENABLE
)
;
Posted On: Monday 31st of December 2012 01:52:32 AM Total Views:  305
View Complete with Replies

RELATED TOPICS OF Oracle PROGRAMMING LANGUAGE




Standby Database - redo apply

, I have configured oracle physical standby database for Quality server for testing I have done one transaction on primary server. I have saved the transaction. On another screen I have ready with command "ALTER DATABASE RECOMVER MANAGED STANDBY DATABASE CANCEL". As soon as I received a document number generated by transaction complition on primary server. I execute the command on next screen realted to cancel managed recover. I have checked in relavant table but transaction is no applied on standby database. In tesing of some cases it is saved in standby DB. What to do for real time apply. I have created standby redolog files on standby database. Standby database is in managed recovery mode. Part of the initilization parameter relavant to standby configuration are as below: ********************************* Primary : -------------------------------------------------------------------------------- log_archive_dest_state_1=enable log_archive_dest_1='LOCATION=/softdump/oraarch/' log_archive_dest_state_2=ENABLE LOG_ARCHIVE_DEST_2='SERVICE=QASST LGWR SYNC AFFIRM' SERVICE_NAMES=QASPR FAL_SERVER=QASPR FAL_CLIENT=QASST *********************************************** ********************************* Standby : -------------------------------------------------------------------------------- log_archive_dest='/oracle/PRD/sapdata4/QAS/stby' STANDBY_ARCHIVE_DEST='/oracle/PRD/oraarch' FAL_SERVER=QASPR FAL_CLIENT=QASST STANDBY_FILE_MANAGEMENT=auto *********************************
VIEWS ON THIS POST

150

Posted on:

Wednesday 7th November 2012
View Replies!

Weblogic and oracle sessions ...

Hi Folks, I'm looking for a way to increase the number of concurrent sessions that comes to oracle from the weblogic. I notice on one of our production servers, there are around 300 inactive oracle sessions. But at any one time, there will only be max 20 sessions that would be active. I know that there aren't any parameters on the database that would restrict it. Instead, I would think that it was some parameter setting on the weblogic server that is putting the breaks. The sad part is that I have no clue on which files and where to look for, on our weblogic server, such that I can increase the concurrent session limits. Could some one shed some light for me Sam
VIEWS ON THIS POST

181

Posted on:

Wednesday 7th November 2012
View Replies!

Oracle8i Management Infrastructure

can any body give web site or book name contain overview and concept of Management Infrastructure.
VIEWS ON THIS POST

228

Posted on:

Wednesday 7th November 2012
View Replies!

Queries

HI Dbas, I have foll queries. 1. what is the max. no of tablespaces in database\t 2. what is the min no of Rollback segments in Database\t 3. what is the max. no of datafiles,redo log files in database\t 4.what is wrapping\t
VIEWS ON THIS POST

39

Posted on:

Wednesday 7th November 2012
View Replies!

range vs local partitions

else being equal, is local partitioning any better than range partitioning I've got an set of PK indexes that are all range-partitioned on the same boundaries as the underlying table. Is it worth the (nontrivial) time to convert them
VIEWS ON THIS POST

155

Posted on:

Wednesday 7th November 2012
View Replies!

MySQL Boolean Fulltext Search in Web Pages

How can I use boolean fulltext search operators for this query SELECT*FROMpartsWHEREMATCH(part_no,part_description)AGAINST(@0INBOOLEANMODE)ANDcategory_ref=@1 If I use the code like this, it returns a consistent set of results. And the results are irrelevant to the search term SELECT * FROM parts WHERE MATCH(part_no, part_description) AGAINST('@0*' IN BOOLEAN MODE) AND category_ref = @1 And if I use the code like this, it returns a MySQL error. SELECT * FROM parts WHERE MATCH(part_no, part_description) AGAINST(@0* IN BOOLEAN MODE) AND category_ref = @1 MySQL error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'IN BOOLEAN MODE) AND category_ref = 897635387' at line 1 I tried to execute the query in MySQL workbench and it works fine.
VIEWS ON THIS POST

102

Posted on:

Wednesday 7th November 2012
View Replies!

Oracle database insert encoding issue

I have a question about how to insert Cyrillic characters into an Oracle database using a dynamically built insert statement. My system is a web application with three fields (Data field, Label field, Translation field). The Translation field needs to be capable of holding any type of character (Latin based, Cyrillic, Chinese, etc.). They click a button and the code then creates the insert statement. Below is the code for my insert statement code: OracleCommand cmd = new OracleCommand("INSERT INTO LANGUAGE_TABLE (FORM_NM,LANG_ID,DATA_COLUMN,LABEL_NM,MAX_CHAR,LAST_UPDATED_DT,LAST_UPDATED_BY,TRANSLATION,LANGUAGE_NM) VALUES('RussianReportTest2','Rus','" + txtDataColumn.Text + "','" + txtLabel.Text + "',30,TO_DATE('" + DateTime.Now.ToString("MM/dd/yyyy") + "','MM/DD/YYYY'),'" + System.Security.Principal.WindowsIdentity.GetCurrent().Name + "','" + txtTranslation.Text + "','Russian')", sqlConn);\t\t\t\t\t\t\t sqlConn.Open(); cmd.ExecuteNonQuery(); sqlConn.Close(); If I use a SQL database where the Translation column is a nvarchar, I append the N in front of the '' and it works perfectly. However, when I use the Oracle, I get question marks () for each character. I have tried encoding the string in UTF8, UTF16 and Unicode before sending it, but it does not work. Any advice would be appreciated. If I need to post this elsewhere, please let me know.
VIEWS ON THIS POST

192

Posted on:

Wednesday 7th November 2012
View Replies!

MYSQL using ASP.NET VB with VWD2008 for MYSQL Data Transactions

I have used ASD.NET code using SQL Database for Transaction operation successfully. By changing the Database Code to interface with MYSQLan Error occurs. If I remove the Transaction Code from withinthe the application, itworks OK by displaying the MYSQL data (Read Only)in the layout of the application. I am using Mysql Essential-4.1.22-win32 and MYSQL ConnectorODBC-3.51.2. My objective is to EDIT the MYSQL Data. Can anybody please provide a solution, the simpler the better
VIEWS ON THIS POST

202

Posted on:

Wednesday 7th November 2012
View Replies!

Export from datagrid data to a new .dbf file

I want to know how can we export data from datagrid to a .dbf file.
VIEWS ON THIS POST

175

Posted on:

Wednesday 7th November 2012
View Replies!

ORA-01858: a non-numeric character was found where a numeric was expected

This exact query is the one generated from the code and works when I run it against the db, however when I run it through my code I get that non numeric error any ideas SELECT COUNT(SC_ID) as calls, to_char(RE_TM, 'HH24') as call_Hour, case when COMM_CTR_ID = 'ELK' then 'NOC' when COMM_CTR_ID = 'RIC' then 'NOC' when COMM_CTR_ID = 'HAM' then 'HOC' when COMM_CTR_ID = 'PHL' then 'HOC' else COMM_CTR_ID end as COMM_CTR FROM CAD.REPORTS_DATA WHERE ARCH_DATE IN (to_date('2007/06/04 23:50:00', 'YYYY/MM/DD:HH24:MI:SS'), to_date('2007/06/11 23:50:00', 'YYYY/MM/DD:HH24:MI:SS'), to_date('2008/06/23 23:50:00', 'YYYY/MM/DD:HH24:MI:SS'), to_date('2008/06/16 23:50:00', 'YYYY/MM/DD:HH24:MI:SS'), to_date('2008/06/09 23:50:00', 'YYYY/MM/DD:HH24:MI:SS')) AND FST_CL_STS_RSN_CD not in ('NC', 'XX', 'CA') GROUP BY case when COMM_CTR_ID = 'ELK' then 'NOC' when COMM_CTR_ID = 'RIC' then 'NOC' when COMM_CTR_ID = 'HAM' then 'HOC' when COMM_CTR_ID = 'PHL' then 'HOC' else COMM_CTR_ID end , to_char(RE_TM, 'HH24')
VIEWS ON THIS POST

234

Posted on:

Wednesday 7th November 2012
View Replies!

How .net can handle stored procedure parameter automatically?

My query is that when i use my application with SQL Server and when i add parameters of stored procedures i have to add parameter prefix like "@" parameterName at application level in code and when i use my application with ORACLE so i have to add parameter prefix like "v_" parameterName, and in the same way different prefix for different other databases like mysql, db2 etc. I need to know how can i make my application independent of parameter prefix, i want that .net class libraries itself handle headache of parameter prefix either i connect my application to the SQL Server or ORACLE, i just give the parameter name simply without prefix. Please if you understand my problem provide me solution ASAP If any person need more explanation so i will love to explain. Thank you!
VIEWS ON THIS POST

252

Posted on:

Wednesday 7th November 2012
View Replies!

datetime problem

how do i get the first of current month 2 years ago in querylike select * from tablename where date1 >=1/current_month/2_years_ago
VIEWS ON THIS POST

205

Posted on:

Wednesday 7th November 2012
View Replies!

OdbcConnection usage on a web form

i'm wondering what the best practice is when using odbcconnection objects to connect to mysql in asp.net. currently i am decaring a private OdbcConnection member that is opened and closed with each query / update / insert / etc on the page. one page can potentially make multiple calls to the db (ie filling a dropdown, displaying recent messages, etc all on one page). also, event handers tend to use the db connection as well to do whatever action is associated with clicking a button, selecting an item, etc. here are some questions: 1) should the connection be kept open for the entire page (ie opened in page_load) 2) should i create the connection object when i use it and not have it as a private member that is reused 3) when executing db operations (ie a command.executenonreader) within a try-catch block, should the connection.close() call be made in the finally block (and even then only conditionally if the connectionstate is open) if not, where should it be closed i'm trying to improve my code to behave in a 'best practices' type of way. it's all working now, so i just want to go through an optimization phase. any and all comments would be appreciated, and feel free to link me to any articles/posts that touch on the subject matter.
VIEWS ON THIS POST

132

Posted on:

Wednesday 7th November 2012
View Replies!

Global connection string?

is there a way to make a connection string like this: string sConn = "Data Source=localhost;" + "Database=backoffice;" + "User ID=backoffice;" + "Password=aKaGr33n;" + "COMMAND LOGGING=FALSE"; MySqlConnection cn = new MySqlConnection(sConn); cn.Open(); global accessible in every control
VIEWS ON THIS POST

102

Posted on:

Wednesday 7th November 2012
View Replies!

distinct pl/sql

select itemID, itemName, aaa,bbb,ccc userID from table_A but there is dupliicate itemID for the same userID how can i the ensure there is no duplicate itemID for each userID. can i do that : select distinct(itemID), itemName, aaa,bbb,ccc userID from table_A
VIEWS ON THIS POST

57

Posted on:

Wednesday 7th November 2012
View Replies!

ORA-12801: error signaled in parallel query server instance name, instance ORA-01460: unimplemented or unreasonable conversion requested ORA-06512: at "SP Name", line 374 ORA-06512: at line 1

We have the production application running from last 3 years. We have recently from last 4 months we have updated the database 11g. In one of the functionality after 30-45 days we are getting this error. Other functionality works fine. We are using the ODP.NET for 11g. This problem gets resolves as soon as we restarts the instances one by one manually. DAL: Failed to get Service Credit records for Service ID , Reason: ORA-12801: error signaled in parallel query server instance name, instance servername (1) ORA-01460: unimplemented or unreasonable conversion requested ORA-06512: at "SP Name", line 374 ORA-06512: at line 1|Error attempting Select Method Test():14391
VIEWS ON THIS POST

332

Posted on:

Wednesday 7th November 2012
View Replies!

data access layer

hello, my question is general but i thought i'd slot it in here since i'm using mysql. i want some sorta abstraction layer for database access for my web application and i am considering learning and implementing castle activerecord. i don't know the exact theory behind ORM mappings and persistence, but i definitely like the idea of selecting/inserting/updating/deleting using classes and objects. right now i have many classes with methods like this: try { using(MySqlConnectionconn=newMySqlConnection( ConfigurationManager.ConnectionStrings["connstr"].ConnectionString)) { conn.Open(); using(MySqlCommandcomm=newMySqlCommand("SELECT...",conn)) using(MySqlDataReaderreader=comm.ExecuteReader()) etc. for each different database call i need to make. it is cumbersome. will activerecord provide thread safety and security (from sql injections and the like)
VIEWS ON THIS POST

94

Posted on:

Wednesday 7th November 2012
View Replies!

how to run or test or debug the stored proc in toad please help me

i have the below stored proc i just want to run like we do in MSMS I want to do the same in toad or sqldeveloper please help CREATE OR REPLACE PROCEDURE Demo.getstationdetails ( \t strcode IN\t\t\t VARCHAR2, \t rct1\t\t\t\t\t\t IN OUT\t globalpkg.rct1 ) IS BEGIN \t OPEN rct1 FOR \t\t SELECT * \t\t\t FROM station_details \t\t\t WHERE UPPER(station_code) = UPPER(strstationcode); END; / please help
VIEWS ON THIS POST

209

Posted on:

Wednesday 7th November 2012
View Replies!

I am using the dotnet connector for MySQL and it is generating queries that gridview cannot use

I am using the dotnet connector for MySQL and it is generating queries that gridview cannot use UPDATEtbl_user_kingdomSETUSERID=\t,LOT01=\t,LOT02=\t,LOT03=\t,LOT04=\t,LOT05=\t,LOT06=\t,LOT07=\t,LOT08=\t,LOT09=\t,LOT10=\t,LOT11=\t,LOT12=\t, LOT13=\t,LOT14=\t,LOT15=\t,LOT16=\t,LOT17=\t,LOT18=\t,LOT19=\t,LOT20=\t,LOT21=\t,LOT22=\t,LOT23=\t,LOT24=\t,LOT25=\t,LOT26=\t,LOT27=\t, LOT28=\t,LOT29=\t,LOT30=\tWHEREPK=\t" I read that it can be switched to using the standard query token of @.I cannot use ctrl+h to replace the with @ because the tokens have to be unique, is there a way to configure the connector
VIEWS ON THIS POST

385

Posted on:

Wednesday 7th November 2012
View Replies!

C#.net-oracle procedure problem

hello, I have a table which has coloumns like resim_ad and resim_id I want to select resim_ad according to resim_id I wrote a procedure for it create or replace procedure pro (r_id in varchar2,r_ad out varchar2) is begin select resim_adi into r_ad from tablo_resim where resim_id=r_id; dbms_output.put_line(r_ad); end; The procedure works without error.I want to call and use this procedure in asp.net 2005 I have dropdown list which has resim_id's of tablo_resim.And There is a textbox that I want to show resim_ad's of tablo_resim.Sending parameter must be resim_id. Here is my code String secim; secim = (this.DropDownList1.SelectedItem.Text); OracleConnection conn = new OracleConnection(); if( OracleConnection.IsAvailable == true ) { conn.ConnectionString = "context connection=true"; } else { conn.ConnectionString = "Data Source=xe;User iD=system;Password=proje"; } conn.Open(); OracleCommand cmd = conn.CreateCommand(); cmd.CommandText = "SELECT resim_adi FROM tablo_resim WHERE resim_id= :secim"; cmd.Parameters.Add(":secim",OracleDbType.Varchar2,secim, System.Data.ParameterDirection.Input); OracleDataReader rdr = cmd.ExecuteReader(); How can I show resim_ad's of tablo_resim in the textbox Please help me!! Kind regards
VIEWS ON THIS POST

238

Posted on:

Wednesday 7th November 2012
View Replies!

Informix .NET provider

I found the page (http://www-128.ibm.com/developerworks/db2/library/techarticle/dm-0503padmanabhan/) where is explained how to use Informix .NET extensions (I need this extensions because I need to use blob data). For work with this extensions you need to have Informix .NET provider version 2.90.TC1 (acording to this article). On the Informix SDK download page (http://www14.software.ibm.com/webapp/download/search.jsprs=ifxdl) there is only SDK v.2.90 for Windows 2000 and for XP there is only SDK v.2.81. Can I use this 2.90 SDK Is there any other way to use Informix blob data\t
VIEWS ON THIS POST

776

Posted on:

Wednesday 7th November 2012
View Replies!

Database Selection

Hi , I'm creating a website which allows its customers to print images and text onto products such as Mugs, T Shirts, Mouse Mats etc.... It will be obviously backed by a DB stored on a Server but its choice of that Database in which i'm requiring your help. Here are a couple of things i will need to be able to do.... Store Customer Details, Details of the image uploaded (will be stored on a file in the server and a url posted to the DB), Store details of products and allow users to select those products... I want to program this in ASP.net / C# but i also have knowledge of PHP. Would you Suggest a MySQL Access or any others Replies greatly appreciated. Ikon
VIEWS ON THIS POST

41

Posted on:

Wednesday 7th November 2012
View Replies!

Write CLOB with System.Data.OracleClient

I get mixed messes about how to write a CLOB using the System.Data.OracleClient classes and methods in .NET 1.1. Some say you have to create a temporary lob and some others say you can write it directly. I did a quick test like this and it seems to work just fine, but I have a gut feeling this is not the way to do it. using System; using System.Data; using System.Data.OracleClient; using System.IO; ... skipping some code... public void writeData() { \t\t\t\t\t FileInfo fi = new FileInfo("c:/temp/testfile.txt"); \t\t\t\t\t using(OracleConnection conn = new OracleConnection(ConnectionString)) \t\t\t\t\t { \t\t\t\t\t\t\t\t\t\t conn.Open(); \t\t\t\t\t\t\t\t\t\t Console.WriteLine("Connected...") ; \t\t\t\t\t\t\t\t\t\t String strSQL = "INSERT INTO CLOBTEST (ID,TEXT) VALUES (1,:TEXT_DATA) "; \t\t\t\t\t\t\t\t\t\t StreamReader sr = new StreamReader(fi.FullName); \t\t\t\t\t\t\t\t\t\t String tempBuff = sr.ReadToEnd(); \t\t\t\t\t\t\t\t\t\t sr.Close(); \t\t\t\t\t\t\t\t\t\t OracleParameter parmData = new OracleParameter(); \t\t\t\t\t\t\t\t\t\t parmData.Direction = ParameterDirection.Input; \t\t\t\t\t\t\t\t\t\t parmData.OracleType = OracleType.Clob; \t\t\t\t\t\t\t\t\t\t parmData.ParameterName = "TEXT_DATA"; \t\t\t\t\t\t\t\t\t\t parmData.Value = tempBuff; \t\t\t\t\t\t\t\t\t\t OracleCommand cm = new OracleCommand(); \t\t\t\t\t\t\t\t\t\t cm.Connection = conn; \t\t\t\t\t\t\t\t\t\t cm.Parameters.Add(parmData); \t\t\t\t\t\t\t\t\t\t cm.CommandText = strSQL; \t\t\t\t\t\t\t\t\t\t\tcm.ExecuteNonQuery(); \t\t\t\t\t\t\t\t\t\t conn.Close(); \t\t\t\t\t } \t\t\t\t\t Console.WriteLine("Done!") ; } So, if a temp lob is needed, how come this seems to work just fine The text file I'm working with is 500KB in size. /Johan
VIEWS ON THIS POST

68

Posted on:

Wednesday 7th November 2012
View Replies!

How to read a CSV file into a DataSet?

Can anyone tell me how to read a .csv file into a .NET DataSet\t Do I need to go through an ODBC Connection to do it\t (If so, can someone tell me where there's a valid link for downloading the the ODBC connection add-in to VS.NET Is there some other way, other than ODBC to do it Or - are there any 3rd party .NET add-ins which would do the job of CSV-to-DataSet
VIEWS ON THIS POST

277

Posted on:

Wednesday 7th November 2012
View Replies!

Report based on Oracle Stored Procedure -- call from .NET

I've developed a report in Crystal Reports 10, and now want to add it to my Web Application. When I call the report, with the parameters, the problem I hit is it asked you to continually log into the Database itself. I'd like to set all the connection properties in .NET such that it seems seemless to the user.
VIEWS ON THIS POST

282

Posted on:

Wednesday 7th November 2012
View Replies!

Invalid SQL statement - REF CURSOR

I'm getting an "invalid SQL statement" in my function that is returning a REF CURSOR. I have tested this function in SQL*Plus and it works fine. -- package level variable TYPE t_cursor IS REF CURSOR; Function find_patient ( p_ssan IN varchar2, p_fmp IN char ) RETURN t_cursor IS v_cursor t_cursor; BEGIN OPEN v_cursor FOR SELECT name,sex,pay_grade, FLOOR(MONTHS_BETWEEN(sysdate,birthdate) / 12) AS age, patient_num FROM patient WHERE ssan = p_ssan AND fmp = p_fmp AND rownum = 1; RETURN v_cursor; -- EXCEPTION handling END find_patient; -- C# code OracleCommand cmd = new OracleCommand("my_package.find_patient",dbconn); OracleParameter ssan_in = new OracleParameter("p_ssan",OracleDbType.Varchar2); OracleParameter fmp_in = new OracleParameter("p_fmp",OracleDbType.Char); OracleParameter cursor_out = new OracleParameter("p_patient_details",OracleDbType.RefCursor); cmd.Parameters.Add(ssan_in).Direction = ParameterDirection.Input; cmd.Parameters.Add(fmp_in).Direction = ParameterDirection.Input; cmd.Parameters.Add(cursor_out).Direction = ParameterDirection.Output; ssan_in.Value = "555555555"; fmp_in.Value = "02"; OracleRefCursor cur = (OracleRefCursor) cursor_out.Value; try { dbconn.Open(); cmd.ExecuteNonQuery(); OracleDataReader dr = cmd.ExecuteReader(CommandBehavior.SingleRow); while (dr.Read()) { pat_name.Text = dr["NAME"].ToString(); age.Text = dr["AGE"].ToString(); rank.Text = dr["PAY_GRADE"].ToString(); gender.Text = dr["SEX"].ToString(); pat_num.Text = dr["PATIENT_NUM"].ToString(); } } Any suggestions
VIEWS ON THIS POST

245

Posted on:

Wednesday 7th November 2012
View Replies!

get the time it took for a command to execute?

I have a large group of sql scripts that are run using the Oracle.DataAccess.Client.OracleCommand. What I want to do is record the time it took for the sql to execute on the Oracle DB. I'm thinking I could grab the time before and after the ExecuteReader() and compare them but I was wondering if there is a better way to do it, is the data I'm looking for returned to the command object and if so how do I get it
VIEWS ON THIS POST

186

Posted on:

Wednesday 7th November 2012
View Replies!

Inserting image into oracle blob field C#

Help. How do I do this. I have spent hours trying to do this. I have the image as a byte stream... FileStream fs = new System.IO.FileStream(fileName, FileMode.Open, FileAccess.Read); byte[] b = new byte[fs.Length - 1]; fs.Read(b, 0, b.Length); fs.Close(); THIS DOESN'T WORK string query = "Insert into test1 (age, name, pict) values (54, 'kim', " + b + ")"; SO I STARTED THIS. string query = "Insert into test1 (age, name, pict) values (54, 'kim', empty_blob())"; DO I NEED TO NEXT DO A SELECT TO retrieve a pointer to the blob and then fill it or something along those lines CODE would be very valuable!!
VIEWS ON THIS POST

184

Posted on:

Wednesday 7th November 2012
View Replies!

Using ODBC Command

I am using ODBC command and adding parameters to it. But it always keeps on saying procedure proc_Update expects a parameters @id which was not supplies ( this errorscomes for all the paramtersthat I add). Here is my code: OdbcCommandcmd=newOdbcCommand("dbo.proc_Update"); cmd.Parameters.Add("@id",OdbcType.Decimal).Value=id; cmd.Parameters.Add("@date",OdbcType.DateTime).Value=date; .. .. ..andotherparametersthatIadd. //ithencall: db.ExecuteNonQuery(cmd); publicintExecuteNonQuery(OdbcCommandcmd) { inttranCount=0; if(cmd==null)cmd=newOdbcCommand(); cmd.Connection=_con; cmd.CommandText="dbo.proc_Update_TenderOffer"; cmd.Prepare(); tranCount=cmd.ExecuteNonQuery(); returntranCount; } I have the same name parametersthat I supply above as my stored procedure
VIEWS ON THIS POST

46

Posted on:

Wednesday 7th November 2012
View Replies!

delete from two table using single query

hii. i need to delete from two table how is this posiible... i dont want to do that using stored procedure\t i tried withis but failed strConn = "DELETE FROM table1 WHERE ftype = '" + txtBoardname.Text + "' ; DELETE FROM table2 WHERE ftype1='" + txtBoardname.Text + "'";
VIEWS ON THIS POST

196

Posted on:

Wednesday 7th November 2012
View Replies!

connection to mysql? URGENT!!!!! Please help!!

Can anyone help me on connection to mysql from asp.net
VIEWS ON THIS POST

174

Posted on:

Wednesday 7th November 2012
View Replies!

Stored proceedures!!!

I keep getting the same syntax error when I try to execute my stored proceedures with input parameters. Insert, Update and Delete as follows...DELIMITER $$ DROP PROCEDURE IF EXISTS `volunteersdb`.`InsertQuiz` $$ CREATE DEFINER=`root`@`localhost` PROCEDURE `InsertQuiz`(IN @QuizName VARCHAR(20), IN @QuizDescription VARCHAR(100), IN @QuizPrivate BIT(1)) BEGIN INSERT INTO tblquizes (QuizName,QuizDescription,QuizPrivate) VALUES (@QuizName, @QuizDescription, @QuizPrivate); END $$ DELIMITER ; 1\t DELIMITER $$ 2\t 3\t DROP PROCEDURE IF EXISTS `volunteersdb`.`UpdateQuiz` $$ 4\t CREATE PROCEDURE `UpdateQuiz`(IN @QuizID Integer, IN @QuizName VarChar(20), IN @QuizDescription VarChar(100), IN @QuizPrivate Int(1)) 5\t BEGIN 6\t UPDATE tblquizes SET QuizName=@QuizName, QuizDescription=@QuizDescription, QuizPrivate=@QuizPrivate WHERE QuizID=@QuizID 7\t END $$ 8\t 9\t DELIMITER ; 1\t DELIMITER $$ 2\t 3\t DROP PROCEDURE IF EXISTS `volunteersdb`.`DeleteQuiz` $$ 4\t CREATE DEFINER=`root`@`localhost` PROCEDURE `DeleteQuiz`(IN @QuizID INTEGER) 5\t BEGIN 6\t DELETE FROM tblquizes WHERE QuizID = @QuizID 7\t END $$ 8\t 9\t DELIMITER ; It just wont let me create them, Im clearly a novice at this so any assistance will be helpful, except telling me to look at the query browser inline help
VIEWS ON THIS POST

77

Posted on:

Wednesday 7th November 2012
View Replies!

Transations with MySQL and .NET

I'm trying to build a WebSite with a MySQL database. Several of the database operations will be included in a Transaction. As perference I would like to use the TransactionScope, but, for now I just want that I could rollback my database transaction in manual mode. This is my code: MySql.Data.MySqlClient.MySqlConnection conn = new MySql.Data.MySqlClient.MySqlConnection(connectionString); conn.Open(); MySql.Data.MySqlClient.MySqlCommand cmd = conn.CreateCommand(); MySql.Data.MySqlClient.MySqlTransaction myTransaction = conn.BeginTransaction(); cmd.Connection = conn; cmd.Transaction = myTransaction; cmd.CommandText = "DELETE FROM Users"; cmd.ExecuteNonQuery(); cmd.CommandText = "INSERT INTO Users (PKID, UserName, ApplicationName, Password, Comment) VALUES ('2', 'esqueleto', 'tusofona.com', 'xx', '')"; cmd.ExecuteNonQuery(); cmd.Transaction.Rollback(); cmd.Connection.Close(); With this code, I should get a table with no records, or with the same records than in the beginning of the operation, but I get only one record in the table and it's the one I'm trying to insert. I'm using the last stable version of the server for windows that I can download from the MySQL WebSite (5.x version) and this version support transactions. Why can't i get it to work. Another problem is that I'm prefer to use the TransactionScope (from System.Transactions) than use the BeginTransaction for the database functions. This object is compatible with the MySQL Server Hope that any one can help me. tkx in advance Paulo Aboim Pinto Odivelas - Portugal
VIEWS ON THIS POST

50

Posted on:

Wednesday 7th November 2012
View Replies!

Firebird, ODBC, ASP.NET

I am getting error, when trying to delete data. Error message is: ERROR [07002] COUNT field incorrect what could the reason be when executing SQL query in Visual Web Developer's data source designer, then everything works.
VIEWS ON THIS POST

67

Posted on:

Wednesday 7th November 2012
View Replies!

Creating mySQL DB backup

what is the easiest way to create mysql db backup from asp.net page cheers,
VIEWS ON THIS POST

67

Posted on:

Wednesday 7th November 2012
View Replies!

table blocked with "... for update NOWAIT"

, I have a table which is blocked because of experiments with select... for update nowait any ideas on how to delock the table
VIEWS ON THIS POST

183

Posted on:

Thursday 15th November 2012
View Replies!

SQL query

Hi all,
VIEWS ON THIS POST

155

Posted on:

Thursday 15th November 2012
View Replies!

setting optsize

I know that to set the optsize for rollback segs at least it should be min_extents * initial extents. What is considered the best way to set the optsize
VIEWS ON THIS POST

92

Posted on:

Thursday 15th November 2012
View Replies!

problem in discovering nodes in EM

hai, In the Enterprise Manager ,i tried to discover a node and it gave discovered succesfully message but it was not listed under the Database Node. The server is up and is running properly. It was giving error for a particular Server and all other servers in the network were listed properly. I checked the SID, init file everything was okay. What would be the problem.
VIEWS ON THIS POST

316

Posted on:

Friday 16th November 2012
View Replies!

PL/SQL re-installation

Something happen few days ago which i dont want reveal and some of the views and packages become invalid, so i tried to reinstall PL/SQL. Before reinstalling what is my mistake is to delete all the packages and types including the Standard package. Now iam trying to reinstall PL/SQL, but i got following errors. Please help me out. The following are the series of steps i followed for reinstallation SQL> @\\Ed10\c_oracle\ora92\rdbms\admin\catalog.sql create or replace * ERROR at line 1: ORA-04045: errors during recompilation/revalidation of SYS.CDC_CREATE_CTABLE_BEFORE ORA-06554: package DBMS_STANDARD must be created before using PL/SQL ORA-06553: PLS-213: package STANDARD not accessible SQL> shutdown immediate Database closed. Database dismounted. ORACLE instance shut down. "after the above error i added the following parameter in init.ora file _system_trig_enabled=false and rerun the script" SQL> startup pfile="C:\Documents and Settings\Administrator\Desktop\init.ora" ORACLE instance started. Total System Global Area 655433488 bytes Fixed Size 454416 bytes Variable Size 603979776 bytes Database Buffers 50331648 bytes Redo Buffers 667648 bytes Database mounted. Database opened. SQL> @\\Ed10\c_oracle\ora92\rdbms\admin\catalog.sql create or replace * ERROR at line 1: ORA-00955: name is already used by an existing object create or replace * ERROR at line 1: ORA-06553: PLS-213: package STANDARD not accessible The database is running know but for only queries and DML statements but I cant able to run PL/SQL stuff. I can't even able to export the data.
VIEWS ON THIS POST

81

Posted on:

Friday 16th November 2012
View Replies!

Pin query to memory

HELP!! I have heard that I can pin an object, table, or query to memory to make queries faster. How do I do this
VIEWS ON THIS POST

103

Posted on:

Friday 16th November 2012
View Replies!

ORACLE vs other DATABASE

My company is going to make a big decision on choosing its database. I prefer ORACLE. Is there any good articles/websites/survey that can help me persuade my boss to choose Oracle Thank you!
VIEWS ON THIS POST

61

Posted on:

Friday 16th November 2012
View Replies!

Oracle to slow

I run a 2 instance Oracle9i R2(Dev and prod) on Win2K. When i execute sqlplus (prod)it take too long about 10mn and sometimes it didnt respond, but on prod db it's very quick. Prod and dev have the same configuration.
VIEWS ON THIS POST

56

Posted on:

Friday 16th November 2012
View Replies!

craete excel workbook with diffrent sheets and send it as attachment using memory stream

hi, We are sending auto email of different reports to our client everyday in PDF with seprate email for each report..... But Now client wants all report should come in one Excel workbook with diffrent sheets containing diffrent report ... we are using memorystream to send email.... how to craete excel workbook with diffrent sheets and send it as attachment using memory stream ......
VIEWS ON THIS POST

264

Posted on:

Tuesday 20th November 2012
View Replies!

cannot create stored procedure in mysql database

database : Mysql i was able to create stored procedure in localhost, once i started using live database ,, i am not able to create any procedures,. please help
VIEWS ON THIS POST

211

Posted on:

Tuesday 20th November 2012
View Replies!

OraOLEDB.Oracle strips white space

I am using the OraOLEDB.Oracle provider and sometimes it strips white space from my SQL. Eg my code tries to execute SELECT sum(amount), \t\t\t\t\t\t count(DISTINCT client_id) client_count FROM\t client_orders WHERE order_date = '1-jul-2007' and I get an Oracle Error ORA-00904: "DISTINCTCLIENT_ID": invalid identifier. It looks like the provider stripped the white space before sending the SQL to the database. The query runs fine when I execute it from SQLPlus. Anyone hve any ideas Can I turn off SQL formatting or something
VIEWS ON THIS POST

124

Posted on:

Wednesday 21st November 2012
View Replies!

Character Set Error When Filling a Dataset

When trying to fill a dataset with the results of a query to a Sybase database, my app aborts with the following error: --ERROR [HY000] [INTERSOLV][ODBC SQL Server driver][SQL Server]WARNING! Some character(s) could not be converted into client's character set. Unconverted bytes were changed to question marks (''). I could not find a solution to this and was wondering if anyone has come across this problem TIA.
VIEWS ON THIS POST

251

Posted on:

Wednesday 21st November 2012
View Replies!

Oracle Connection error

I am using an OracleConnectionString set in my web.config. Everything works fine when I call it in declarative code. However, when I try to write custom code in the .cs file I get this error: Compiler Error Message: CS0246: The type or namespace name 'OracleConnection' could not be found (are you missing a using directive or an assembly reference) Source Error: Line18:\t\tprivatevoidButton1_Click(objectsender,System.EventArgse) Line19:\t\t{ Line20:\t\t\t\tusing(OracleConnectionconnection=newOracleConnection(connectionString)) Line21:\t\t\t\t{ Line22:\t\t\t\t\t\tOracleConnectionsqlCon; Here is the beginning of my .cs file. Do I need to call some special Oracle class If so why - doesn't the config file handle this
VIEWS ON THIS POST

237

Posted on:

Wednesday 21st November 2012
View Replies!

MySQL and data reading (no data binding!)

I'm a coder from the old legacy ASP, back then you'd create a recordset and loop through it checking values. Now all I've seen is binding it to a datagrid control, this is cool and all, but what if I want to read the values in the database and make a choice based on values and such: private const string str_ConnectionString = "Driver={MySQL ODBC 3.51 Driver};" + \t "Server=localhost;Database=test;uid=root;pwd=yourpassword;option=3"; \t static void f_DatabaseConnect(string str_SQL, EventArgs e) \t { \t\t\t base.OnInit(e); \t\t\t using (OdbcConnection con = new OdbcConnection(ConnStr)) \t\t\t using (OdbcCommand cmd = new OdbcCommand(str_SQL, con)) \t\t\t { \t\t\t\t\t con.Open(); \t\t\t\t\t dgrNames.DataSource = cmd.ExecuteReader( \t\t\t\t\t\t CommandBehavior.CloseConnection | \t\t\t\t\t\t CommandBehavior.SingleResult); \t\t\t\t\t dgrNames.DataBind(); \t\t\t } \t } So far thats what I got from tutorials as how it works, how can I configure this to do what I wan to
VIEWS ON THIS POST

92

Posted on:

Wednesday 21st November 2012
View Replies!

where to install ODT.NET

hi, i'm using, VS .NET 2003 standard. to connect to the oracle 9i, i was told to install odt.net. In oracle eb page, they have asked me to install it in TEMP folder.. but there are so many temp folder in my system.. could any one tell me exact location ot that foldrer karthik
VIEWS ON THIS POST

87

Posted on:

Wednesday 21st November 2012
View Replies!