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


What are the real world pros and cons of executing a dynamic SQL command in a stored procedure in SQL Server using EXEC (@SQL) versus EXEC SP_EXECUTESQL @SQL ? Solution sp_executesql is more likely to promote query plan reuse. When using sp_executesql, parameters are explicitly identified in the calling signature. This excellent article desc

it1352 0 2020-10-27

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 1 2020-08-11


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 9 2019-05-14

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 5 2019-05-10

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 3 2019-06-25

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 3 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