sql

Implementing new NHibernate type for POINT postgresql data type (or any COLUMN of a non-primitive analogous nhibernate type)

Hi everyone. I have a problem with NHibernate and the postgresql POINT data type (although I believe this is a common problem for all of those trying to map a SQL TYPE that is not covered by NHibernate SqlTypes). My Data.Point class has two public floats: xcoordinate and ycoordinate. My first attempt was trying to implement the IUserTy...

Retrieving Weekend Data Rows Only in Oracle

Hi, How to query rows in a table where the created_date column value in the table falls on a weekend date ONLY, i.e. Saturday/Sunday using Oracle SQL.. Thanks ...

Find total number of hours between two dates

I know there are so many overlapping query questions already been answered but none of them were able to resolve the issue I'm having: We need to find out the total number of hours between the lowest start_date and highest end_date, considering the overlapping range as well. Start_Date End_Date 3/5/2010 11:27 3/5/2010 13:04 - Ne...

How do you put a carriage return into the field of an SQL statement using VB?

I want to insert a record using SQL and one of the fields needs to contain a carriage return, e.g. Notes field: Line 1 Line 2 End line How would I code this SQL statement using VB ...

How to retry a transaction that has failed because of a deadlock?

I use linq-sql and this is what I need. Sub Commit() Try StepStart: Transaction Scope Serialized Begin Transaction Check BusinessRule1 Check BusinesRule2 if BusinessRulesFailed { Transaction.Rollback } else { Query = db.out db.SubmitChanges() Transaction.Commit() } Catch DeadLockException Goto StepStart End Try End Sub Is it ok ...

Call for a function with a variable name?

I have one package that has different procedures, and one main procedure through which I am calling other procedures. Through the front end, I am passing the procedure name into main(). Is there any way by which the procedure can be called just writing the parameter name containing('Procedure Name that is need to be called')? CREATE O...

qt mysql query giving different result on different machine

QSqlQuery query; QString queryString = "SELECT * FROM " + parameter3->toAscii() + " WHERE " + parameter1->toAscii() + " = \"" + parameter2->toAscii() + "\""; bool retX = query.exec(queryString); above code when bundled as an application returns true on the machine it has been created. it returns false on other machines. how is it possi...

error in converting datatype nvarchar to bigint

this code is giving me error: error in converting datatype nvarchar to bigint this is my table values: @customer_first_name nvarchar(50), @customer_last_name nvarchar(50), @customer_address nvarchar(max), @gender nchar(10), @date_of_birth datetime, @customer_email_id varchar(50), @customer_occuption varchar(50), @customer_phone_...

Running trigger that calls stored procedure on another database

We would like to run a trigger on one database (A) that calls a stored procedure on another database (B). CREATE TRIGGER trg_A ON TableA FOR INSERT AS BEGIN EXEC DatabaseB.dbo.stp_B END We would like to do this as LoginA with UserA on DatabaseA. We also have LoginB with UserB on DatabaseB. How can we accomplish this? Currently w...

SQl query required for the below Scenario

Here for part ‘CF061W’ finum is 25, I will select records whose fparinum value is 25 now I will get these parts FA061W, HRD20600 and SD1201. Now again I will select records whose fparinum value is finumber of above retrieved parts FA061W, HRD20600 and SD1201 and so on. This should continue till the highest level (flevel), for the abov...

PHP MySQL Website to External SQL System Integration

Hello, I am after opinions from some expert web developers as to the best solution to my problem. THE SETUP In my job, I look after an online shop, which is based upon osCommerce, with many additional features and tweaks. This is on Linux shared hosting and uses PHP and MySQL as its main technologies. We are going through the process...

Gridview updates within an Updatepanel.

What is the best way, using ASP.NET and C#, to tackle the following problem? I have a database containing a companies table, product table (each company has multiple products, though the tables aren't linked), and a details table. What I'd like is to display the companies table. Selecting a company reveals the products table for that c...

MySql Regular Expression Select Columns Matching (dynamic)multiple Values within Stored Procedure

I am trying to generate a query where I want to select columns(text) matching multiple values. eg: I have two columns, id and description. suppose my first row contains description column with value Google is website and an awesome search engine , second row with description column value Amazon website is an awesome eCommer...

How to start with database ?

Hi all, i have just started using visual studio 2008.I am working on c#. I want to add SQL database particularly LOCAL database (.sdf) to my project and want to use queries which will save data in database and fetch some data from database and which will display and will perform different function. So, if any body can give me any sma...

D2K Forms and reports

Can any one tell me Where can i get good material to study forms and reports in oracle. ...

How can I run a query on IDs in a string?

I have a table A with this column: IDS(VARCHAR) 1|56|23 I need to run this query: select TEST from TEXTS where ID in ( select IDS from A where A.ID = xxx ) TEXTS.ID is an INTEGER. How can I split the string A.IDS into several ints for the join? Must work on MySQL and Oracle. SQL99 preferred. ...

Star Schema with Doctrine ORM

Hi, I've just come across the Star Schema for Report-Aggregation. The first Question that came to my mind is whether or not Doctrine ORM supports such denormalized Tables. As I've seen ist, there are a feww kinky behaiviours in dealing with relations, a Model could not completely know. Any ideas? Is it possible? ...

Using Linq2SQL to return Parent Table Data, but sorted by Child Table Data

I have a Parent/Child Table relationship with the ChildTable linking back to the ParentTable via the ParentId foreign key. There's multiple records in the ChildTable for each ParentTable record. For those of use you like rudimentary visuals, here's the diagram. ParentTable ------------ +Id Date ChildTable ------------ +Id ParentId Da...

Select * from tbl where id>=5 /* then add the result from id<5 to query */

I have a table with 9 rows. $id=5 If i use SELECT * FROM tbl WHERE id>=$id i get the 5,6,7,8,9 rows. To this query I want to add the result of SELECT * FROM tbl WHERE id<$id so I will get the final 5,6,7,8,9,1,2,3,4 rows. This is to avoid going two times in database then add the result set in php. EDIT: Yes order is important. Thank ...

Error - Could not locate entry in sysdatabases for database

keep getting this error on this code: when I Connect to test Database with vb.net its show connection successfully Established. But when i want to Generate particular report with vb.net applocation its gives me following Error. Could not locate entry in sysdatabases for database 'test'. No entry found with that name. Make sure...