SELECT statement Questions


Execute SQL SELECT via RUNSQLSTM error
Trying to execute SQL-statement “SELECT * FROM mylib/myfile” give errormsg SQL9010. Some say that SELECT is not supported with RUNSQLSTM, but IBM command parameter text indicates otherwise. Is SELECT supported and what am I doing wrong?

Answer Question   |  March 17, 2012  4:42 PM
RUNSQLSTM, SELECT statement, SQL
asked by:
2,555 pts.

oracle explain plan from yesterday
Is it possible to see the explain plan used by Oracle for a select statement that was run yesterday?

Answer Question   |  March 31, 2012  6:08 AM
Oracle, Oracle 11g, Oracle administration, SELECT statement
asked by:
5 pts.

Modifying a Stored Procedure
The stored procedure below pulls suspected duplicate records. What I need it to do is return suspected duplicates only if it meets the criteria of having a member record type (GEN) & a non-member record type (WEB). But if the duplicates both have a non-member record type I don’t want it showing up on the [...]

Answer Question   |  June 9, 2011  2:31 PM
Crystal Reports, SELECT statement, SQL, SQL Database, SQL stored procedures, Stored Procedures
asked by:
130 pts.

Parameter in select statement
Hi, I need to pass a parameter into a stored procedure which values are dynamic always. Executing a variable which having the Select statement. Following query working fine. BEGIN DECLARE @strQuery NVARCHAR(MAX) DECLARE @CountryId INT DECLARE @CityId INT SET @CountryId = 2 SET @CityId = ‘ AND CityId IN (23,45,85,86)’ SELECT @strQuery= ‘SELECT VendorId From [...]

Answer Question   |  October 15, 2010  9:31 PM
SELECT statement, SQL Parameters, SQL statements, T-SQL
asked by:
40 pts.

SQL RPGLE – How to override data set data structure at run time
I currently have an SQL RPGLE routine that receives a SELECT statement as a parameter and then fetches the data set into a data structure based on the file. This only works over a single file as the datastructure is created at compile time and has to be based on filea. I would like to [...]

Answer Question   |  September 23, 2010  1:43 PM
iSeries, RPGLE, SELECT statement, SQL, SQL Select statement problem, SQLRPGLE
asked by:
20 pts.

Select statement in asp.net
How can i use ms sql select statement with where clause in asp.net

Answer Question   |  March 5, 2011  5:17 AM
ASP.NET, SELECT statement, SQL Select, SQL statement, WHERE clause
asked by:
15 pts.

How do I use DateDiff in cobol using SELECT statement?
how to use DateDiff in cobol using SELECT satement.

Answer Question   |  July 12, 2010  3:59 PM
AS/400, COBOL, DATEDIFF, SELECT statement
asked by:
Ije
35 pts.

Select/Insert Statements causing out of memory error run under VB Script
I’m using VB Script on a Windows 2003 Server against an Oracle 10g database to both query against a table and insert new rows of data against that same table but as it runs it starts eating up RAM and when it gets to about 1.5gb it causes the out of memory error.  As far [...]

Answer Question   |  January 27, 2011  8:43 AM
INSERT statement, Oracle 10g, Oracle 10g Database, SELECT statement, Windows Server 2003, Windows Server 2003 32-bit
asked by:
15 pts.

Access 2003: Can’t filter Part-no’s by highest $Spend Plant/Site
I have a file of Part-no with the spend by Plant (or Location).  A given Part-no may have multiple records for the different Plant Locations. I am trying to capture one record for each Part-no that included the Plant with the highest spend and what that amount is. I tried to do a summary query [...]

Answer Question   |  October 30, 2009  6:32 PM
MS Access 2003, SELECT statement
asked by:
5 pts.

SQL Select: Getting the previous records from a known record
I issued a select statement like this: Select phone# from pltlcd where phone# >= 985143525 fetch first 20 records only PLTLCD is a file sorted by phone#. From the first record retrieved by the aboe select statement, how do I get the 20 records in the file that exist before the returned set of the [...]

Answer Question   |  February 29, 2012  4:37 PM
SELECT statement, SQL Select, SQL Select statement problem
asked by:
560 pts.

SQL Server: Index and Key
What is the difference between a key and an index? Whe I issue a SELECT statement, and the table has an index, do I still have to use my key?

Answer Question   |  August 3, 2009  5:08 PM
Index and Key, SELECT statement
asked by:
560 pts.

How to select 1 record in DB2
As usual, I often use: select top 1 * from table but in DB2, I can’t. I use the Toad tool to input SQL statement. Does anyone have a solution? Please share it with me. Tkanks a lot!

Answer Question   |  April 18, 2013  5:34 PM
DB2, SELECT statement
asked by:
5 pts.

select parent where more than one child
I want to select a row from the parent table based on whether there are two or more rows in a child table. What is the best way to do that?

Answer Question   |  September 2, 2011  1:01 AM
SELECT statement, SQL, SQL queries
asked by:
5 pts.

Different Results on Insert Select than Select
I’m struggling, along with others, where I’m getting different results when doing an Insert select verses just the select. Lots of joins to get data from various tables. Only want the first record from the uniqfield table so created the tmp_uniqfieldid table with that item fielded, creation_ts thinking it would help matters….. Here is the [...]

Answer Question   |  May 4, 2009  11:36 PM
INSERT SELECT statement, SELECT statement, SQL, SQL query optimization, SQL statements
asked by:
Bem
35 pts.

SQL order by Issue
Please help me write this. I need a SQL where the order by is done based on a variable passed to the query.SELECT * FROM (SELECT distinct gl.group_id, gl.group_name, gl.group_description, gl.status_code, gl.member_count, (SELECT grpp.group_name FROM test_group_relationship grel JOIN test_group grpp ON grel.parent_group_id = grpp.group_id WHERE grel.child_group_id = gl.group_id ) AS parent_group_name, gl.group_name_key, gl.group_description_key FROM test_group [...]

Answer Question   |  May 4, 2009  4:44 PM
Dynamic SQL, SELECT statement, SQL, SQL query optimization
asked by:
25 pts.

Oracle 10g process each record exactly on time multiple processes
I have over 400 records added to a table in a minute. A processed flag is set in each record as they are processed. I want to process each record exactly one time. I want to process the records in small groups with multiple processes; that may run on disparate machines. It is desirable to [...]

Answer Question   |  April 29, 2009  3:19 AM
Oracle 10g, Oracle 10g administration, Oracle ROWNUM, SELECT statement, UPDATE statement
asked by:
15 pts.

SELECT statement in SAP
what are various select statements used and where are they used.what is value table.

Answer Question   |  April 13, 2009  10:30 AM
ABAP, SAP ABAP, SAP development, SELECT statement
asked by:
10 pts.

How do I write a SQL statement to get all data from a table called subscrib?
How do I write a SQL statement to get all data from a table called subscrib?

Answer Question   |  April 6, 2009  10:16 PM
SELECT statement, SQL, SQL queries, SQL statements
asked by:
5 pts.

Viewing distinct records in a SQL query result
I have a set of records in a SQL query result. I only want to see one record, per the data field “ID”. I am getting 2 records for some ID’s, as there is one field that is different in the 2 records. This happens even if I start the query out with SELECT, DISTINCT, [...]

Answer Question   |  April 7, 2009  5:48 PM
SELECT statement, SQL Query, SQL Server Query
2,585 pts.

Matching External lists to your Database?
Hello everyone, I work in a telco and manage the data in the company’s CRM. I’m often given lists of company names by our alliance team, and asked to match the list against our database to see which companies already exist in the CRM and which don’t. At the moment I can only accomplish this [...]

Answer Question   |  April 3, 2009  10:54 PM
Query optimization, SELECT statement, SQL, SQL queries
asked by:
5 pts.