Tags "sql" Result

Statement.execute(sql) vs executeUpdate(sql) and executeQuery(sql)

I have a question related to this method: st.execute(sql); where st obviously is a Statement object. Directly from this oracle java tutorial: execute: Returns true if the first object that the query returns is a ResultSet object. Use this method if the query could return one or more ResultSet objects. Retrieve the ResultSet objects returne

it1352 0 2019-05-22

Convert SQL to SQL alchemy

I am new to Flask SQl alchemy; Though i understand that alchemy abstracts the sql syntax and makes things easy while creating models; there could be times when we want to visualize data in the front end in a very specific way. I have the following query which i would like to use using alchemy using session.query and filter and possibly grouping.

it1352 0 2020-08-11

SQL LIKE in Spark SQL

I'm trying to implement a join in Spark SQL using a LIKE condition. The row I am performing the join on looks like this and is called 'revision': Table A: 8NXDPVAE Table B: [4,8]NXD_V% Performing the join on SQL server (A.revision LIKE B.revision) works just fine, but when doing the same in Spark SQL, the join returns no rows (if using inne

it1352 0 2020-09-04

Error processing SQL:0 PhoneGap SQL

Im trying out and copied code from here: http://luthfihariz.wordpress.com/2011/10/23/android-sqlite-phonegap-jquerymobile/ To succeed with a sample I'm working on just to learn this. I have a link to my complete index.html on pastebin. Please, correct me and also help me finding this errror. Link to Pastebin here Solution I didn't have a lot of

it1352 6 2019-05-14

SQL: writing more concise paramaterized SQL

I''m trying to get the hang of using parameterized SQL. I''ve gotten to work, but now some of my queries seem unecessarily long. For instance: strSQL = "IF NOT EXISTS(SELECT * FROM We_Link_SiteMenus_To_DirectoryContacts WHERE contactID = ? AND pageID = ?) INSERT INTO We_Link_SiteMenus_To_DirectoryContacts (contactID, pageID) VALUES (?, ?)&q

it1352 1 2019-06-25

Use SQL View or SQL Query?

I am working on an application to get data from a MS-SQL server (2005). In the command text, I can pass a sql query like this: string query = "SELECT T1.f1, T1.f2, T2.f3 FROM table1 T1 join table2 T2" "on T1.id = T2.id AND T1.dt = T2.dt ..." .... cmd.CommandText = query; I could also put the query as a view on my SQL server like this: CRE

it1352 4 2019-05-10

oracle pl/sql -> sql server

Hello, I am an SQL server newbie. Our company has a massive application written in PL/SQL. I need to port parts of it to SQL Server. - Which SQL server version should I choose, to have a reasonable chance of porting? - Could you recommend any best practices, tools? I use Toad for SQL development on Oracle, I am looking for something similar for

it1352 2 2019-06-25

Sql Case statement within Sql IN

I have a sql statement which have a where condition like below WHERE (TABLE1.Field=@Id OR (@Id=0)) This works fine when @Id values is zero or more Now I need to match multiple values when @Id value become 0. I tried something like below which doesn't work. I know that I can use IF-ELSE in here, but wonder whether this can be achieve using case

it1352 0 2020-07-30

SQL: Help me optimize my SQL

I'm looking to optimize my SQL. My database schema is: HOMES home_id address city state zip primary_photo_group_id HOME_PHOTOS photo_id (primary key) home_id (home primary key) photo_group_id (a photo group is the same image, resize from thumbnail to large size) home_photo_type_id (the size of the image be it a thumbnail or a large size) ph

it1352 0 2019-05-15

SQL Formatter for SQL Management Studio

I was wondering if there is a plugin/tool for SQL Server Management Studio that will format your SQL? I'm working with some large-ish stored procs that are a mangled mess of poorly formatted SQL and it'd be nice if I could just go "Select All -> Format SQL" Solution Today I discovered Apex SQL Refactor. It is a free plugin. Integrates with SSMS

it1352 0 2019-05-17