PHP SQL Wrapper
Anyone have suggestions on wrappers for SQL within PHP? I've been using ezSQL, which is awesome, but wanted to see if anyone had any other suggestions. ...
Anyone have suggestions on wrappers for SQL within PHP? I've been using ezSQL, which is awesome, but wanted to see if anyone had any other suggestions. ...
I have a comparison I'd like to make more efficient in SQL. The input field (fldInputField) is a comma separated list of "1,3,4,5" The database has a field (fldRoleList) which contains "1,2,3,4,5,6,7,8" So, for the first occurrence of fldInputField within fldRoleList, tell us which value it was. Is there a way to achieve the followin...
Hello.Im a beginner in SQL.I am having a problem with it. First of all I shd let u know I installed SQL 2005 Server n then made a ConsoleApp and rest of code is under : using System; using System.Collections.Generic; using System.Text; using System.Data.SqlClient; namespace ConsoleApplication1 { class Program { static v...
We are having problem with the server migration. We have one application that are having so much transactions It working fine on the one database server. But when transfer same database to another server. We are facing the following error. Server: Msg 3998, Level 16, State 1, Line 1 Uncommittable transaction is detected at the en...
Is there a standard way of encoding SQL queries as XML? I mean something like select name from users where name like 'P%' group by name order by name desc might encode as (my 5-minute mockup, probably bobbins)... <?xml version="1.0" encoding="UTF-8"?> <query> <select> <table name="users"> <column name="name"/>...
There are many examples on the internet of doing this type of thing. But none of them work in Firefox. So I thought I'd set the challenge for Stack Overflow users. Basically I need a very easy to use way for a user of a page to get the results of a query into the clipboard so that they can paste it into excel. It can either be getting ...
I have a SQL query that looks something like this: SELECT * FROM( SELECT ..., row_number() OVER(ORDER BY ID) rn FROM ... ) WHERE rn between :start and :end Essentially, it's the ORDER BY part that's slowing things down. If I were to remove it, the EXPLAIN cost goes down by an order of magnitude (over 1...
I'm considering adding an index to an Oracle table, but I'd like to first estimate the size of the index after it has been built (I don't need a precise size - just an estimate.) Supposing I have access to all of the meta-data about the table (number of rows, columns, column data types, etc) that I can execute any arbitrary Oracle SQL q...
there's a dropdown displaying 1-10 from where the user selects the number of textboxes he wants - if he chooses unlimited, it shows him a textbox wherein he enters the exact number of textboxes he'd like. if he enters 40, it shows him 40 textboxes which are created at runtime. my question is, how do i enter the data from 40 - or 'whatev...
Right now I have this SQL query which is valid but always times out: SELECT ( SELECT (MAX(WP_ODOMETER) - MIN(WP_ODOMETER)) / DATEDIFF(DAY, MIN(WP_DATETIME), MAX(WP_DATETIME)) FROM WAYPOINTS WHERE WP_DATETIME BETWEEN DATEADD(DAY,-14,GETDATE()) AND GETDATE() AND WP_VTDID = 'L088' ) AS MAXD, ( SELECT MAX(WP_ODOMETER) FROM WAYPOINTS WHER...
how can i insert a column value at a specified row ...
Hi, We are developing a Visual Studio.NET 2008 application with Oracle 9i as backend. Is it true that the usage of Stored procedures would be faster than Inline SQL ? This is a debate with my co-programmers. We are using ODP.NET (Oracle Data Provider for .NET) from Oracle. Thanks. ...
I've just gone blank. I have a many to many relationship with three tables. Lets call them A, B and C. C stores the primary keys of the other two tables. Now, I would like to insert all primary keys from table A, and lets say primary key 1 from B into table C. I just don't get it. All I came up with was some stored procedure that runs ...
I have a table with sets of settings for users, it has the following columns: UserID INT Set VARCHAR(50) Key VARCHAR(50) Value NVARCHAR(MAX) TimeStamp DATETIME UserID together with Set and Key are unique. So a specific user cannot have two of the same keys in a particular set of settings. The settings are retrieved by set, so if a use...
I am trying to see from an SQL console what is inside an Oracle BLOB. I know it contains a somewhat large body of text and I want to just see the text, but the following query only indicates that there is a BLOB in that field: select BLOB_FIELD from TABLE_WITH_BLOB where ID = '<row id>'; the result I'm getting is not quite what I exp...
This query gives me syntax error in when-between line. how can i solve them? alter FUNCTION [dbo].[fn_GetActivityLogsArranger] ( @time AS nvarchar(max) ) RETURNS nvarchar(max) AS BEGIN declare @Return varchar(30) select @Return = case @time when between '15:00' and '15:30' then '15:00-15:30' when between '15:30' and '16:00' then '15...
I would like to be able to abort a specific sql statement if it takes longer than a specified number of seconds. How can I do that? For example, I would like to do something like: SET NextStatementTimeOutSeconds = 60 SELECT * FROM MyTable IF @@LastStatementTimedOut = 1 PRINT 'Statement timed out after 60 seconds' ELSE PRINT '...
When I create a new VARCHAR column in Microsoft SQL Server Manager Studio, it defaults to 50 length. Does this length have some special meaning? If theoretically I have the option to choose for a length between 30 and 70, is isn't it better to go for defaults that are power of 2 (like 32, or 64 in this case)? ...
Query gives me some error: Msg 156, Level 15, State 1, Line 4 Incorrect syntax near the keyword 'from'. Msg 156, Level 15, State 1, Line 9 Incorrect syntax near the keyword 'group'. select Count(Page) as VisitingCount, dbo.fn_GetActivityLogsArranger(CONVERT(VARCHAR(5),Date, 108)as [Time] from scr_SecuristLog where Date between ...
I have a table for users (username, password .. etc) and another one for products (product name, price, quantity, username .. etc) I want the username from the first table to be inserted (with the rest of the product info) into the product table when the user put it for sale. How can I do this? I'm using visual web developer 2008 expr...