Structured Query Language (SQL) is a language for querying databases. Questions should include code examples and table structure. This tag refers to the standard language, not for questions about specific vendor extensions, like MySQL or Microsoft SQL Server, so if you think your question relates to ...
0
votes
0answers
2 views
Possible security flaw php and SQL
So I have this code which basicaly retrieves data from a mysql database:
$categoria = $_GET['categoria'];
if($categoria ==""){}else{
$consulta = @mysql_query("SELECT * FROM productos where ...
0
votes
0answers
9 views
I just want to make A simple loop in PostgreSQL
In the PostGIS SQL Editor, I just want to make a loop to make this function work
For Loopid = 0 to 1000, then execute the following statments:
UPDATE public.globaldtm
SET "UTM" = loopid
WHERE rid ...
0
votes
1answer
12 views
SQL query on the same table with join and group by
I've a problem with this query:
SELECT source.cod,source.nome,source.ruolo,SUM(source.giocato),ROUND(SUM(source.fvoto)/SUM(source.giocato),2) as ...
0
votes
1answer
9 views
Setting the field selection of a SELECT statement with the Stored Procedure's Input Variable
The following simple Stored Procedure fails to return a result set, even though running this simple SELECT statement in isolation with the actual value works just fine. Any ideas why?
ALTER ...
0
votes
1answer
14 views
Error on BULK insert date
I am trying to BULK insert into sql server 2008 and i get an error on the Date column.
SET DATEFORMAT dmy
BULK
INSERT CustomSelection
FROM 'c:\test.csv'
WITH
(
FIRSTROW = 2,
FIELDTERMINATOR = ...
1
vote
2answers
15 views
CREATE OR REPLACE v/s Dropping a function and re-creating it
What is the difference between the two? In both the cases? what happens to the privileges granted on this function? Are automatically revoked in both the cases and have to be provided again while ...
0
votes
3answers
33 views
Query is taking too much time
I want to take your ideas regarding the below query:
select a.expense_code, a.expense_date, a.expense_supplier_code, b.supplier_name, a.expense_discount, a.expense_payment_method, ...
0
votes
2answers
34 views
Image is saved to the database as binary data, now I need to extract the data and put it in an <img> tag
I please need help to get my image to display correctly in the tag that is created in a literal control.
foreach (DataRow dr in dt.Rows)
{
string productName = ...
1
vote
0answers
12 views
how to rollback committed data in sql server 2005
by mistake i have updated my table without any condition like update mytable set status = 1 and all row of my table got updated.
Can committed data be rolled back in SQL Server? If yes then how can we ...
1
vote
0answers
3 views
Error “could not execute batch command.[SQL: SQL not available]” after failed delete in NHibernate
After I delete an entity related to another record, this error occurs due to reference integrity:
"The statement DELETE in in conflict with the constraint...etc"
I manage this error with this code:
...
0
votes
1answer
24 views
Calculate percentage from single column without variable
I have following table in sql server
HEAD | COL1 | COL2
------------------------
MARKS | 546 | 798
TOTAL | 1000 | 1000
PERCENT | NULL | NULL
I want to populate result like below by ...
0
votes
0answers
6 views
Simple SQL Server Profiler Event Advice
I have to debug a long running SQL Server stored procedure which dynamically builds and executes queries at runtime. I want to run a trace so I can see all of the individual pieces of SQL that are ...
0
votes
0answers
6 views
CakePHP bindModel working, add where clause
i am working on a cakephp 2.x .i am newbie so please forgive me for asking such a silly question . i have two tables which i am joining by bindmodel .. the query is working fine .. the only thing is ...
0
votes
2answers
15 views
SQL syntax error near “WHERE” 2
Query:
select distinct R1.name, R2.name
from (
(
select Ra.mID mID, Re.rID rID, Re.name name
from Rating Ra join Reviewer Re using (rID)
) R1
,
(
select Ra.mID mID, Re.rID ...
1
vote
5answers
43 views
Retrieve specific data from database and display
How to retrieve specific data from database and display?
String sql = "Select Product_ID,Order_Quantity,Sub_Total from Order_Menu Where Order_ID='"+order_id_1+"'";
pst = ...