Questions tagged [rawsql]
95 questions
0
votes
2 answers
How to rewrite from Raw SQL to LINQ?
I would like to replace my Raw SQL with LINQ. Here's my code:
MyController:
using MyProject.Models;
using System.Collections.Generic;
using System.Linq;
using System.Web.Http;
namespace MyProject.Controllers
…

Tomo
- 429
- 1
- 10
- 24
0
votes
1 answer
Ebean not converting logical names to physical names in additional filters on ExpressionList tied to in RawSql query
I am using Play 2.4.6 on top of a Postgres 9.4.5 database.
I am trying to get the sum of amounts of the Donations in my database, but I want my users to be able to dynamically filter the Donations that are included in the query. I followed some…

Austin Delorme
- 21
- 1
0
votes
3 answers
I am passing a string back to my controller then trying to do some raw sql on entity framework.
I was using linq but I ran into something that I need to write fast so I am trying to get raw sql to work. This is my first project in mvc so I am a newbie but here is my controller code
public ActionResult Index(string Vendors)
{
if…

Joshua Deshazer
- 171
- 3
- 15
0
votes
1 answer
Raw sql query as per URL parameters in django
My models.py is as follows:
class Prescription(models.Model):
date_prescribed = models.DateField()
doctor = models.ForeignKey(Doctor)
pharmacy = models.ForeignKey(Pharmacy)
class Doctor(models.Model):
name =…

Amistad
- 7,100
- 13
- 48
- 75
0
votes
0 answers
Issues with data return by raw sql query in Django
I am fetching data from db using raw SQl queries , I am following these django docs.
As you can see in django docs we have a function dictfetchall which returns dict with field names and values. I am converting this dict to json as per my…

saf
- 259
- 4
- 20
0
votes
1 answer
NHibernate unmapped table - object is a multicolumn type - ToListResultTransformer
I have NHibernate executing a raw sql query which is built from the database. In the software the use is able to choose a table and a couple of columns with a defined order. In my software I use this information to build a sql query which selects…

PascalJ
- 116
- 10
0
votes
1 answer
Yesod Single RawSql and Return it as JSON Format
hope you help me with this.
i have a rawSql:
latestPrice :: Handler [(Single PricesId, Single PersistValue, Single PersistValue, Single PersistValue, Single PersistValue, Single PersistValue)]
latestPrice = do
runDB $ rawSql qryStr []
…

Ryan Monreal
- 587
- 5
- 16
0
votes
1 answer
Yesod Custom RawSql
Is it possible to create a custom rawSQL in yesod?
for example i have a Model for images
Images
filename String
description Text Maybe
date UTCTime
deriving Show
and i have a rawSQL query of
selectImages :: Handler [Entity…

Ryan Monreal
- 587
- 5
- 16
0
votes
0 answers
Django with MongoDB but using rawsql (view on design)
I am planning to create a website in Python and i am thinking of using Django as its more structured and suitable for large scale application.
I have worked with Flask in past and i used sqlalchemy with raw sql to interact with database, i am not…

Ninad Mhatre
- 549
- 1
- 7
- 17
0
votes
1 answer
Raw SQL command not executing using Entity Framework
I have trouble seeding data using the following raw SQL command and entity framework
databaseContext.Database.ExecuteSqlCommand
(@"INSERT INTO NatureOfBusinessRiskClass
( ProductSectionId ,
NatureOfBusinessId ,
…

Andre Lombaard
- 6,985
- 13
- 55
- 96
0
votes
2 answers
Inserts using EF's RawSQL are not returning IDENTITY
Given:
In the original post I was attempting to call db.Database.ExecuteCommand, since then I changed that to what you see here. (Which works). Execute Command was always returning 0xfffff. SQLQuery returns the value of the last select statement…

JWP
- 6,672
- 3
- 50
- 74
0
votes
2 answers
Invalid relational operator in rawsql, same statement works in sqldeveloper
This statement works perfectly when beeing executed in SQLDeveloper(Oracle DB).
select id,name,street,post_code,town,phone_number,web_site,email,short_description,
description, latitude,longitude,external_id,facebook_page_id
FROM poi WHERE (…

Nico Müller
- 1,784
- 1
- 17
- 37
0
votes
1 answer
ASP.NET MVC3 Raw Sql Update
I'm sure I'm doing a simple mistake. I try to run raw Update statement in my ASP.NET MVC3 project.
if (Request["btApprove"] == (string)ViewBag._Approve)
{
query = "UPDATE Proposals SET "
+ " TypeID=" + Request["ProposalTypes"]
…

İsmet Alkan
- 5,361
- 3
- 41
- 64
0
votes
1 answer
Django db.connection.cursor.fetchone() returns unexpected result
I have this manager in my models.py
class ItemManager(models.Manager):
def get_fee(self):
from django.db import connection
cursor = connection.cursor()
cursor.execute("""
SELECT fee
FROM item
WHERE itemID = %d AND…

skinnyas123
- 382
- 1
- 4
- 13
-1
votes
1 answer
Symfony Doctrine Raw SQL returns 'SQLSTATE[IMSSP]: The active result for the query contains no fields.'
I tried to send the following query to a MSSQL Server using Doctrine in Symfony:
DECLARE @ebayitems TABLE (kartikel INT, cartnr VARCHAR(255), ebayPrice DECIMAL(10,2), ebayID VARCHAR(255))
DECLARE @amazonitems TABLE (kartikel INT, cartnr…

Aurel Dragut
- 1
- 1