SQL Query Questions


How to insert Hex values through SQL/400
Hi, I’m creating a table querying the data from 3 different tables through joins. I need to insert a Hex value ‘3F’ at the end of the last record in the Output file (Table) I create to know the end of file for another system reading the file. I do not know whether this can [...]

Answer Question   |  April 23, 2013  11:07 PM
SQL Database, SQL Query, SQL/400
asked by:
10 pts.

How to write a CL program if SQL query is giving some record
Hi, How can a CL program can be written based on some SQL query which gives some records. If SQL query is giving some records as output then using SNDEMLMSG command, how can that CL program be written? SNDEMLMSG command will send an email to specific user based on SQL query’s output if any thing [...]

Answer Question   |  March 4, 2013  2:08 PM
CL programs, SQL Query
asked by:
6r
940 pts.

User input
How do I get the user input, so I can use it on my query on Oracle Reports Builder 6? The report will be executed on a client desktop. Im using autosearch, and just found this : Report.GetAutoSearchDescriptionLines(Memo1.Lines);which get me the whole search description, including the user input for the search criteria. Is there any [...]

Answer Question   |  March 1, 2013  1:45 PM
Oracle Reports 6i, Oracle Reports Builder, SQL Query
asked by:
15 pts.

Web based applications pulls false result from SQL table
I’ve a web based application which when executed via the Notes form returns a false result set. The SQL query executes and returns the proper result set when run through query manager. Any help would be appreciated. The agent is called via a button executing the tools run macro command: Option Public Uselsx “*LSXODBC” Use [...]

Answer Question   |  February 18, 2013  12:26 PM
Lotus Notes Forms, SQL Query
asked by:
395 pts.

Validate SQL and display the output
I have a screen where the user can enter an SQL script, I need to validate whether the SQL query is a valid one, if so then display the output on to the screen. I am planning to execute a SQL prepare statement out of the script entered and then use SQLCOD to determine whether [...]

Answer Question   |  January 29, 2013  8:14 AM
SQL Query, SQL scripts, SQLRPGLE
asked by:
1,955 pts.

Long field in display file
I have a display file which has a long field which is meant to hold a SQL query. The field is assumed to appear in the screen as 16 lines, with 68A per line. So When I declared a field of length 1088A(16*68) but how can I declare it to have only 68 per line [...]

Answer Question   |  January 28, 2013  7:16 AM
AS/400, DSPF, SQL Query
asked by:
1,955 pts.

sql query
any one explain this query: select regexp_substr(char_name,’[^,]+’,1,level)as row_id from char_change connect by level<=(select length(replace(char_name,’,',null)) from char_change); this query is used to get the string value and print the row wise.

Answer Question   |  April 11, 2012  1:55 PM
SQL, SQL Query
asked by:
65 pts.

Query in SQL400
Hi, I want one query in SQL400, I will give small example? Suppose there are two tables,    TAb1                Tab2 1.CMP                 1.CMP 2.Item NO           2. Item NO 3.Status              3.Warehouse 4.Quantity           4.Costing type   Now I want the data from tab2 where warehouse = 502 , Costing type = ’2′   and status = ’20′ (tab1)  so, how to write the query?  [...]

Answer Question   |  April 20, 2012  6:37 AM
AS/400, SQL Query, SQL/400
asked by:
80 pts.

Access 2003 SQL Query for grouping
Team… I need your help… SELECT Pickerid, Sum(Currentweight) AS TotalWeight, IIf(pickerhours=0,0,TotalWeight/pickerhours) FROM mergeddatabase WHERE ((Currentdate) between [Enter First Date Required:] and [Enter Last Date Required:]) GROUP BY pickerid, pickerhours; I have a access database (2003) single Table (mergeddatabase) with thousands of entries.. This is a query to work out picking rates. The criteria is a [...]

Answer Question   |  March 25, 2012  3:49 AM
Microsoft Access 2003, SQL Query
asked by:
225 pts.

How to combine 2 rows to multiple columns?
I have a table with name, plan and amt as columns. Sometimes there will be duplicate names with different plan and amt values. For instance: name  plan  amt smith  lrb    200 smith  l4b   300 jones  lrb    200 brown lrb    300 jackson lrb  180 johnson l4b 190 The output I’d like my query to produce would [...]

Answer Question   |  October 29, 2011  4:05 PM
SQL Query
asked by:
350 pts.

Free SQL software with interface to enter data
Hi, I need to enter about 5000 lines of data with about 10 columns. and then i would query the data (by lets say sql, but i am open to suggestions). Can anyone recommend a simple freeware to use. My queries would be like ordering the data based on certain column, or getting to view [...]

Answer Question   |  October 17, 2011  10:08 PM
Data entry, Free software, Freeware, SQL, SQL Query
asked by:
5 pts.

Error Message in SQL Server 2008 code.
Hi, I am currently going through the Tutorials on SQL Server Management Studio 2008 R2. One of the samples instructs me to run the following code: SELECT  Mgr.EmployeeID AS MgrID, Mgr.LoginID AS Manager,  Emp.EmployeeID AS E_ID, Emp.LoginID, FROM EmployeeDemo AS Emp LEFT JOIN EmployeeDemo AS Mgr ON Emp.ManagerID = Mgr.EmployeeID ORDER BY MgrID, E_ID; [em]When [...]

Answer Question   |  March 31, 2012  11:20 AM
SQL Query, SQL Server 2008 R2, SQL Server Management Studio, SSMS 2008
asked by:
40 pts.

Finding Holes in Numerical Sequence
I need help in identifying the missing numbers in a large query. The only problem is that some of the numbers may be alpha and numerical combined or not-they are mixed. Yet all the numbers are in the same column.  The query looks like this SELECT MSPMP100.PRDNO,MSPMP100.CLASS,MSPMP100.DESCP     FROM CARF1.MSPMP100 MSPMP100                                          Where MSPMP100.CLASS= ‘72′ MSPMP100.PRDNO is the [...]

Answer Question   |  March 31, 2012  10:58 AM
Access Datasheet, AS400 iseries, SQL, SQL Query
asked by:
1,185 pts.

SQL to query a file
I want to use SQL to query a file and summurize data, using multiple scalars( min, max, sum) and display the results on a workstation screen.  Can i use one select statement in RPG iseries or should I create a stored procedure?   Any code samples,etc would be greatly appreciated.  

Answer Question   |  March 31, 2012  4:31 PM
Open Query File, RPG, SQL, SQL Query
asked by:
rmb
115 pts.

t-sql and AS400
I want to develop a TSQL query. First I need to determine if all the numbers in one of the fields are in numerical order and also find the missing holes in the number sequence. Secondly I need to sort by another field and by a particular criteria.  The words that I need to sort-by [...]

Answer Question   |  March 31, 2012  12:34 PM
AS/400 Query, SQL, SQL Query, T-SQL
asked by:
1,185 pts.

SQL query working differently in sql plus and SSSR
I wrote down a sql query for creating a SSRS report. The query is fetching different no of rows and data in SQLPlus and SSRS. I am worried how same query can fetch different results in different environments. Please help me.

Answer Question   |  March 31, 2012  8:34 AM
SQL Query, SQL Server, SQL Server Query, SSRS reports
asked by:
5 pts.

Order by clause in SQL Server subqueries
why the “order by” clause in sub queries must be associated with “top” clause in sql server..??

Answer Question   |  April 11, 2012  9:12 AM
SQL Query, SQL Server 2008, SQL Server Query, Subquery
asked by:
5 pts.

SQL 2008 query: return results where row not in another table
hi, running sql2008.  i have the following two temp tables.  the first is just all web service errors for a date range.  the second is simply 20 rows that contain values of types of web service errors. –temp tbl #1 select [date],[err],[srv],[e1],[e2] into #tblExcept from netlog where [err] like ‘%web service%’ and convert(char(10),[date],120) >= @startDate [...]

Answer Question   |  March 31, 2012  10:02 PM
Query, SQL 2008, SQL Query, Subquery
asked by:
5 pts.

QUERY on V6R1
I am buying a 520 w V6R1. I need to have the following features on it. STRQRY WRKQRY STRSQL What is the lic pgm on 6.1? On V5R4 it was 5722QU1 or 5722qu2 & 5722st1? What is the difference between the 3?Would like to know what to order for the 6.1 box  Thxs Stephen

Answer Question   |  March 31, 2012  7:03 AM
AS/400 SQL, iSeries V6R1, SQL Query, WRKQRY
asked by:
120 pts.

How to Use the Query in Foxpro to Visual Basic 6
i making a program that will sort or index the table in foxpro, i use sql code to generate the code in visual basic 6.0 but it has always an error.. i’m using ado data control, and here are my codes..   Adodc1.ConnectionString = “Provider=VFPOLEDB.1;Data Source=G:Documents and SettingsDP2205DesktopDataEnvironment;Password=”";Collating Sequence=MACHINE” Adodc1.RecordSource = ” SELECT Books.book_id, Books.title, [...]

Answer Question   |  March 31, 2012  9:02 AM
FoxPro, SQL Query, Visual Basic 6
asked by:
85 pts.