SQL Questions


How to use SQL to filter columns in a spreadsheet.
I have a query that is listed below. I need to develop a statement that would filter the month and the year as well as the Phase informaton in the access table.  __________________________________________________________________ Select INMSP300.M3OE# as “OENo”, INMSP300.M3OEC as “ComprsOE”, INMSP300.M3PRD as “PN”, INMSP300.M3CLS as “PrdLine”, INMSP100.MSAPP, INMSP100.MSPRD, [strong]INMSP100.MSRDTM as “rtd-Month”, INMSP100.MSRDTD as “rdc-Day”, INMSP100.MSRDTY as “rtc-Year”, [...]

Answer Question   |  October 23, 2009  12:43 PM
Access Datasheet, SQL
asked by:
1,185 pts.

MERGE using DECODE logic to control UPDATE
MERGE using DECODE logic to control UPDATE The SQL below has been running extremely well for over a years in our Production application on Oracle release 10.1. We have recently upgraded to Oracle release 11.1 and this same SQL routine now takes a minimum of 4 times longer to run on 11.1 Has anyone else [...]

Answer Question   |  October 23, 2009  1:15 AM
Oracle 11g, SQL
asked by:
16,755 pts.

STRQMQRY in batch on i5
Can STRQMQRY be run in batch? I am getting error message: Global variable prompting is not allowed in batch mode. I am passing 2 parameters from a display screen

Answer Question   |  October 20, 2009  4:16 PM
CL, SQL, SQL development, STRQMQRY
asked by:
35 pts.

I NEED SQL COMMAND TO EXTRACT THE NUMERIC VALUSE IN BETWEEN THE STRINGS
VCH:FR:AUD/120.18/51.26YQAC/1.35QKAD/14.47QRCO/14.47QREB/1.35QKSB/6.00WGSE/20.91UOVZ I NEED TO EXTRACT THE VALUES IN THE ABOVE STRING AND SUMM ALL THE VALUES USING SQL COMMAND EX:120.18+51.26+1.35…..IN THE ABOVE GIVEN REFRENCE

Answer Question   |  January 23, 2010  5:21 AM
SQL, SQL commands
asked by:
15 pts.

SQLRPGLE
I’ve Report to print using SQLRPGLE The Report criteria screen has around 15-20 select conditions…based on the conditions entered by the user, I build a query of type Select * from emp1 where val1 = ? and val2 =? and val3 = ? and……….. This is the first time I’m dealing with so many select [...]

Answer Question   |  October 21, 2009  10:05 PM
RPGLE, SQL, SQLRPGLE
asked by:
895 pts.

Using SQL with MS Access and the AS400.
Each of the numbers in the column [New PART] is linked to the column [OLD PART]. The [New Part] column may have multiple rows of the same number in the same column but is it due to the association to the [OLISTd part] column, which are out dated numbers. Both the [OLISTd part] and the [...]

Answer Question   |  October 13, 2009  2:16 PM
MS Access Database Table, SQL
asked by:
1,185 pts.

ms sql query problem with a case statement
[strong]This code works: SELECT     passengers.*, passship.passship_name AS name, passship.passship_speed AS speed, passship.passship_size AS cargo, hyperjump.hops AS hops, ROUND((passengers.pass_engers * passengers.pass_price) / (hyperjump.hops * passship.passship_speed), 0) AS ptprofit                        FROM         passengers INNER JOIN                       hyperjump ON passengers.pass_terms = hyperjump.startsystem AND passengers.pass_system = hyperjump.endsystem CROSS JOIN                       passship WHERE     (passship.passship_name = ‘Rinkratt’) ORDER BY ptprofit DESC, [...]

Answer Question   |  October 18, 2009  3:02 AM
CASE statement, MSSQL, SQL
asked by:
20 pts.

Convert and Expand Field through SQL/400
I am using the AS400 platform and a novice with SQL. I have a common field in multiple files – some files define the field as numeric and some alpha. My question: Is there a way in SQL to first convert the numeric field to alpha and then expand the alpha field adding two leading [...]

Answer Question   |  October 12, 2009  4:37 PM
AS/400, SQL
asked by:
5 pts.

SQL EXPLAIN
How do I interpret the EXPLAIN plan of a particular SQL which has “Bytes” and “Cost(CPU%)” columns?

Answer Question   |  October 10, 2009  3:18 PM
columns, SQL
asked by:
16,755 pts.

Updating a View
I have a view that’s missing data and needs to be updated. I’m not sure how to update a view – any help would be greatly appreciated. The database name is: ABCD_Dbase The view that needs to be updated is: dbo.vGoLPgcfos Thanks in advance. ~DJ  

Answer Question   |  October 13, 2009  8:00 PM
Data management and storage, Database, SQL, Updates, Views
asked by:
45 pts.

SQL Communication Area
Hello, Can anyone explain the fucntionality of the program QSYS/QSQROUTE in AS400. Thnaks in advance

Answer Question   |  October 7, 2009  10:51 AM
AS/400 SQL, QSQROUTE, QSYS, SQL
asked by:
55 pts.

SAP on SQL Server and NetApp
Hi Everyone, We are looking for some feedback from anyone who has used NetApp with SAP running on a SQL database. We are researching white papers, etc., but would really like to hear from some folks with hands on experience. What has your experience been like? Any performance hits? Any caveats or considerations to be [...]

Answer Question   |  October 5, 2009  9:51 PM
NetApp, SAP, SQL
asked by:
5 pts.

SQL 2008 Security: How do I give users access to just views within a DB?
[h1 class="subject"> [/h1] I have inherited a SQL DB and need to give a group of users access to some views within a DB. We do not want them to access the tables, just the views. They will be connecting using MS Excel for reporting purposes. Do I use a role or schema? What is the [...]

Answer Question   |  October 3, 2009  5:19 PM
Microsoft Excel, SQL, SQL 2008
asked by:
5 pts.

Cal I load a record SET into a work file using SQL within RPGLE?
ALL - I have to process a set of Inventory Transactions based on W/H, Product, From Date, and To Date. Normally, I would jump into a Do Loop; read the SQL cursor; write the record to a work file; process until EOF. Can an SQL statement do all of that for me in one statement? [...]

Answer Question   |  October 1, 2009  4:40 PM
RPGLE, SQL
asked by:
940 pts.

Best way to retrieve values, SQL or Queries and how?
Hello everybody, my problem is, in a iseries i have ia file and in this file exist one field with 10000 lenght (character) and i want retrieve a value like (  60F: ) but i don´t know in what position, after i find this value i need the follow values. ex: this is a part [...]

Answer Question   |  November 3, 2009  10:33 AM
CLP, Query/400, RPG IV, SQL, V5R4, V5R4M0
asked by:
225 pts.

Using AS400 SQL to replace a variable string
I need to do a scan and replace in a flat file. File has one field 80 characters long. Possibly one or more of the records in the file contain a specific value, such as ‘%ABC%’ and I want to update the record replace ABC with XYZ. This value could be anywhere within the record. [...]

Answer Question   |  October 28, 2009  7:01 PM
AS/400, AS/400 SQL, SQL
asked by:
32,945 pts.

General ODBC Error – Why
I get an gernal ODBC error when running the below code. It looks like the sqlt is too long, but how can I get it to work as I need the query to be dynamic based on date. sqlt = “SELECT SCHED_TASK_EXEC.TASK_ID, SCHED_TASK_EXEC.TASK_TYPE, SCHED_TASK_EXEC.EXEC_TIME, SCHED_TASK_EXEC.END_TIME, SCHED_TASK_EXEC.EXEC_STATUS_B, SCHED_TASK.DESCRIPTION FROM CPSLIVE.SCHED_TASK SCHED_TASK, CPSLIVE.SCHED_TASK_EXEC SCHED_TASK_EXEC WHERE SCHED_TASK.TASK_ID = [...]

Answer Question   |  September 30, 2009  4:54 PM
ODBC, ODBC Errors, SQL
asked by:
16,755 pts.

SQL Query Issues with date math
Table with partial sample data would appear as follows: EQUIPNO  ASSEMBLY  START_TIME  END_TIME 150          0              24-MAY-09   25-MAY-09 150          0              25-MAY-09   25-MAY-09 150          0              25-MAY-09   26-MAY-09 304          0              25-MAY-09   04-JUN-09 150          0              26-MAY-09   26-MAY-09 150          0              26-MAY-09   27-MAY-09 150          0              27-MAY-09   28-MAY-09 150          0              28-MAY-09   28-MAY-09 150          0              28-MAY-09   29-MAY-09 150          0              29-MAY-09   29-MAY-09 150          [...]

Answer Question   |  September 29, 2009  7:37 PM
Date calculation, Date format, SQL, SQL Query
asked by:
10 pts.

Textbox input to a a sql dataset table in Vb.net
How do I input data from textboxes in Vb.net to …a table in a  data set ….and then display generated data back to some more textboxes ???? I am using sqlexpress ….Thx. mace100

Answer Question   |  January 23, 2010  3:24 PM
data input, SQL, SQL Data Set, VB.NET
asked by:
5 pts.

sql .net 2005 deployment
I am trying to connect my desktop application to sql server on a lan  but the clients are being recognised as guest how do i enable ny appplication to run on the lan. I am using windows authentication.  

Answer Question   |  September 29, 2009  1:07 PM
LAN, SQL, VB.NET, Windows authentication
asked by:
15 pts.