SQL Questions


export data from forms to excel
how to export the selected data from forms to excel?..

Answer Question   |  October 9, 2009  6:55 AM
PL/SQL, SQL
asked by:
5 pts.

SQL Error
we need to determine error message:the condition applied to this collectioncontains an ORDER BY without a corresponding TOP clause.

Answer Question   |  July 30, 2009  2:44 PM
SQL, SQL error messages
asked by:
5 pts.

Learning SQL Part 2
Is there anything out there that would teach help me to learn SQL dealing with communicating with an AS400 system and using MS Access passthrough query system to bring it into Access but using the SQL system as the communicator? What books or Web sight is available?

Answer Question   |  July 30, 2009  9:11 AM
AS/400, AS/400 SQL, Microsoft Access, SQL, SQL Training
asked by:
1,185 pts.

SQL table missing values
Dear all, I have a table that typically has the following collumns: partnumber Company Division Responsible Records usually look like: partnumber company division responsible A 1 14 AAA A 1 13 BBB A 1 CCC B 1 14 AAA B 1 12 BBB B 1 DDD Now I need to create a query, that returns [...]

Answer Question   |  August 26, 2009  2:33 PM
SQL
asked by:
100 pts.

SQL in CLP
Hi, I have to create a command that permits a user to copy records from one file to another and then remove those records from the first file. We’ve been doing it all manually using CPYF and INCREL and then deleting the records using an SQL Delete statement. I got the idea to create a [...]

Answer Question   |  January 28, 2011  2:05 PM
RPG, SQL
asked by:
320 pts.

Can a command button macro run a make-table query with an auto-inputted parameter value?
I want to run a make-table query with a parameter, using a command button click event on a form showing a single record. The parameter value needs to be inputted automatically using the value of a control in the current record of the same form. Can this be done with a macro event? If so, [...]

Answer Question   |  July 28, 2009  11:46 AM
append, Control, Form, make-table, parameter, Query, run, SQL, value, where
asked by:
5 pts.

Learning SQL
I work in a large company in the automotive industry. We use the AS400 system corporately. I am just learning the query system. I have used a little of the iSeries and found that to be somewhat burdensome. My co-worker introduced me to the SQL language. What I am trying to do is using MS [...]

Answer Question   |  July 28, 2009  12:39 PM
SQL
asked by:
1,185 pts.

Equivolent HLOOKUP using SQL
I am a beginner at SQL… I’ve come across a situation maybe someone can help me out. I have a table with the following structure: bkt_id am bkt_101 bkt_102 bkt_103 … bkt_228 bkt_101 $100 $100 $20 $0 bkt_102 $50 $100 $20 $0 … I want to compare am with the proper bkt_n value using the [...]

Answer Question   |  July 24, 2009  1:31 AM
Excel HLOOKUP function, Oracle, Oracle 10g, Oracle SQL, SQL
asked by:
5 pts.

store image from a directory into oracle database using sql
i have a directory containing 1000s of photos which i have to upload into oracle 9i db. i need to use only sql plus for this. i want a simple material to upload all those photos..

Answer Question   |  July 17, 2009  10:40 AM
Image databases, Oracle image storage, SQL, SQLPlus
asked by:
5 pts.

Help Refactoring SQL Query
Dear Friend Below is my SQL Query select DISTINCT Auditdata.ID,ns.ProviderMaster_ID as CDRComment from Auditdata AuditData inner join AuditMaster am on am.ID=AuditData.AuditMaster_ID inner join HomeCircleMaster hcm on hcm.Ori_CircleMaster_ID=am.CircleMaster_ID and hcm.Ori_ServiceTypeMaster_ID=1 and hcm.Dest_ServiceTypeMaster_ID=1 inner join NoSeriesMaster ns on (ns.CircleMaster_ID=am.CircleMaster_ID or ns.CircleMaster_ID=hcm.Dest_CircleMaster_ID) and ns.ProviderMaster_ID<>am.ProviderMaster_ID and ns.ServiceTypeMaster_ID=1 INNER JOIN NoSeriesMaster_Prefix PD ON SUBSTRING(AuditData.CallTo, 1, CONVERT(INT, PD.PrefixLen)) = PD.PrefixNo AND [...]

Answer Question   |  July 16, 2009  8:54 AM
Refactoring, SQL, SQL Query
asked by:
30 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.

slow update Query(Primary Key)
dear Friends when i run below query its take more than 10 minutes and still running…. update auditdata set TATCallType=’12′,TATCallUnit=’1′ from auditdata auditdata inner join Auditdata_sms_12 a_sns on auditdata.ID = a_sns.id auditdata is my original table in above table ID is primary key Auditdata_sms_12 is my temp table whats wrong in aobe SQL Query plz [...]

Answer Question   |  July 15, 2009  4:22 PM
SQL, SQL performance, SQL Query
asked by:
30 pts.

Variables in T-SQL
Hi, I want to know y does the following script run in SQL and not in T-SQL DECLARE @tblName varchar(30) SET @tblName = CONVERT(VARCHAR(20),GETDATE(),112) + ‘Table’ DECLARE @sql nvarchar(4000) SELECT @sql = ‘CREATE TABLE “‘ + @tblName + ‘” ( ID VARCHAR(15), Name VARCHAR(15) )’ EXEC(@sql) go it gives you the error Msg 170, Sev [...]

Answer Question   |  July 15, 2009  12:33 PM
SQL, T-SQL
asked by:
20 pts.

How to subtract positive number from negative number in an IF string
Having trouble with knowing how to subtract positive from negative numbers in an IF formula. Also want to add a conditional formatting for all negative time in column H.

Answer Question   |  July 30, 2009  9:12 PM
IF statement, SQL
asked by:
WAT
5 pts.

Inner join Solution
i write the following Query to execute against the 1500000 in SQL Server 2000 DECLARE Cur_Prefix CURSOR FOR SELECT PrefixNo,PrefixLen,AfterPrefixLen FROM NoSeriesMaster_Prefix WHERE PrefixType=’SMS’ order by ID OPEN Cur_Prefix FETCH NEXT FROM Cur_Prefix INTO @PrefixNo,@PrefixLen,@AfterPrefixLen WHILE @@FETCH_STATUS = 0 BEGIN SET @SQLStatement = ‘update ‘+@TABLE+’ set AuditData.TATCallType=”12”, AuditData.TATCallUnit=”1” ‘ + ‘from ‘+@TABLE+’ AuditData ‘+ ‘inner [...]

Answer Question   |  July 29, 2009  2:51 PM
INNER JOIN statement, SQL
asked by:
30 pts.

Using sql code to read a filename
Can you write sql query that will read pdf filename from a dir and then match the filename to a data element in a table having the same name? For instance, the filename is 12345.pdf where 12345 is actually an invoice number. Can the query read the filename and then locate the same invoice number [...]

Answer Question   |  July 31, 2009  6:04 AM
SQL, SQL Query, SQL statements
asked by:
5 pts.

is varchar numeric
sql to check varchar as numeric

Answer Question   |  July 31, 2009  8:25 PM
SQL, VARCHAR
asked by:
5 pts.

Create a file with formulas on the iSeries and send to Excel.
I can create a file in SQL that has formulas in it (i.e. ‘=A1*B1′) and I can send them to my PC and open them in Excel. However, the formulas are showing instead of the results. If I click inside the cell and hit Enter, I get the value instead of the formula. BUT, I [...]

Answer Question   |  July 9, 2009  3:49 PM
AS/400, iSeries, Microsoft Excel, SQL
asked by:
20 pts.

SQL embedded in RPGLE
RPGLE program with five modules updating different set of files. Main module calls others each time a customer is being processed to change some specific detail in many files. There are many customers, so the modules are called many times (LR is set on only at the end of the whole process). Each module has [...]

Answer Question   |  July 7, 2009  7:20 AM
DB2, iSeries, performance, RPGLE, SQL
asked by:
10 pts.

Delete OLD files from Table not having date or timestamp
Hi, In DB2, Is it possible to get the insert date of a record in a table which doesn’t have a seperate field for creation date or timestamp. I have a task where I have to delete record older than 1 year from a table, but the files doesn’t have creation date field. So, like [...]

Answer Question   |  July 30, 2009  10:46 AM
AS/400, as400/DB2, DB/400, DB2, DB2/400, delete sql, DELETE statement, SQL
asked by:
45 pts.