I have the following model I’m calling this function The above is trying to reproduce the following sql However it’s generating the following nasty piece of work: As you can see, it’s generating CHARINDEX for the StartsWith. The problem is this is ignoring all the indexing I have setup, and …
Tag: sql
How to use % operator from the extension pg_trgm?
I have my pg_trgm module installed. The schema set is extensions. To use it I have to run something like this select: I’m trying to run a statement using the % operator and got the following message. What is necessary to run % or <-> operators? Answer Most probably the problem is with the search_p…
ORA-01219: database not open: queries allowed on fixed tables/views only
I Am using oracle 11g and SQL developer tool. When i tried to retrieve rows from db i am getting error message as :- I looked for sgadef.dbf file and it was missing in home directory.. Can someone help me to make it working. Answer First of all check the status of the instance you work with (this may need
Error dropping or deleting a user from SQL Server 2012
I’m trying to drop all the logins from SQL server except the default built-in SQL server logins but I’m unable to drop the “administrator” account. It gives me an error : “Server principal ‘…
Time zone conversion in SQL query
I am using a query to get some application Received Date from Oracle DB which is stored as GMT. Now I have to convert this to Eastern standard/daylight savings time while retrieving. I am using the below query for this: It works fine for Standard time. But for daylight savings time we need to convert it to &#…
Execute a Stored Procedure Inside a View?
I started working for a company a few weeks ago, and have inherited a crazy mess of databases. I’m currently working on designing the new systems to replace their older ones. The previous developer created a ton of views that are entirely identical, with the only differences being the conditions within …
Should I create separate SQL Server database for each user?
I am working on Asp.Net MVC web application, back-end is SQL Server 2012. This application will provide billing, accounting, and inventory management. The user will create an account by signup. just …
Upload image to server and store path with text values into MySQL
I am still a beginner of Andorid programming and would need some help to the following: What I currently have are 2 codes, which the first uploads an image to the server and stores the path into a …
Data type mismatch on SQL Query in VBA
I am trying to do an SQL query in VBA to retun a specific case number. Whenever I execute the query, it returns an error of “Data Type Mismatch in Criteria Expression”. I am passing the query an integer to use to query an autonumber primary key. Of course the debug hilights the execute command. An…
Magento joining 2 tables
I want to join admin table and another profile table in magento how should I do this? I want to join $userModel = Mage::getModel(‘admin/user’); table and Answer Riaz.try the below code — Here suppose vendorprofile.vendor_id = main_table.entity_id is the relation between two tables. if you wa…