• TOP SQL statement not working

    I am running a simple SQL query on toad SELECT TOP 2 HRS_OFF_ID FROM PS_HRS_OFFER but it keeps on telling me that 'FROM' keyword not found where expected. What wrong am I doing here?

    ashwin255 pointsBadges:
  • SQL in DB2 for AS/400

    What I have an error when I try to execute the following SQL statement: UPDATE kfilasm/SCPF exception JOIN KFILasm/LDPF ON SCAB = JUBBN and SCAN = JUBNO and SCAS = JUSFX set SCRBA = SCRBA - JUHAMT, SCRBB = SCRBB - JUHAMT WHERE SCAB||SCAN||SCAS IN (SELECT JUBBN||JUBNO||JUSFX FROM QTEMP/JUPF2)

    Messam260 pointsBadges:
  • Find the list of SQL statements run by a particular user on iSeries server

    How can I find the list of SQL statements run by a particular user on iSeries server?

    JohnsonMumbai1,290 pointsBadges:
  • SQL host variable with data structure array

    I am trying to write Printer file format using Data structure. Below is the code: Dcl-Ds abc extname('prtf':'data':*output) qualified template; End-Ds; dcl-ds test likeds(abc) dim(100); I am fetching records using fetch first for n rows statement into test DS array and every time it is giving me...

    Abhi583910 pointsBadges:
  • SQL fetch returns no data

    My SQL select statement returns data, but an almost identical fetch does not, although the SQL code is 0, sqlstt is '0000', and sqlwarn is all blanks. What am I doing wrong? dcl-ds prtsplds; outnam char(10); libnam char(10); nofils char( 5); writer char(10); status char( 3); end-ds; exec sql...

    cslackman5 pointsBadges:
  • SQL statement Token error

    I keep getting a token error in my SQL statement.

    RateWatchProgrammer10 pointsBadges:
  • SEQUEL ViewPoint

    We are using SEQUEL View point to execute some queries. We can achieve this using AS400 SQL statments itself. What is advantage of using SEQUEL View point?

    rajeshece1,215 pointsBadges:
  • IF…THEN for a SQL SELECT statement

    How do I do an IF...THEN for a SQL SELECT statement? So I have this already: SELECT IF(Obsolete = 'N' OR InStock = 'Y' ? 1 : 0) AS Saleable, * FROM Product How can I do it?

    ITKE392,245 pointsBadges:
  • Duplicate values in an Oracle database

    Is there a SQL statement that would return duplicate values for a given column / count of their occurrences in an Oracle database? Thank you very much.

    ITKE392,245 pointsBadges:
  • Ignoring fields in SQL Where Statement

    Can fields in a where statment be ingnored. Such as Where name = :name and date = :date, but if I just pass in a name I'd like the where to select only on the name and ignore the date.

    Charrdzc5 pointsBadges:
  • SQL Delete/Update

    I have file say with 100 records and I have 2 records which have similar data , so I have to delete only one record (out of 2 with same data) from the file, how would I do that? Every value in those records are same. I need solution through SQL statements.

    srav52030 pointsBadges:
  • Looking for instructions on how to compile SQL statements

    I am looking for instructions or reference to instructions on how to compile a set of SQL statements into an executable file to be submitted as a scheduled batch file. Any thoughts?

    Mgkyale10 pointsBadges:
  • AS/400 selective update with SQL

    Hi All, I am trying to create an SQL statement that will update many records based on a file containing fewer records. I can easily update ALL records in the primary file but I really only want to update those that need to be updated. In the item master file the cost has been changed for some...

    Ckelly0115 pointsBadges:
  • How to drop an alias table named alias

    I needed to access a specific file member of a DB2 file, so I created an alias in my library via a SQL statement using a iDB2Connection. Now I cannot drop it. Here is my create statement. CREATE ALIAS MYLIB/ALIAS  FOR OPTIOFILE/FXFORM (MYFORM) I can now run my selects and load my datagrids using...

    ToddN200042,950 pointsBadges:
  • SQL statement that retrieves the latest year record for customers

    Need to know this! I have a table that consist of a custom ID, year and amount column. Customers can have one row per year in that table with an amount. I want to do an SQL statement that retrieves the latest year (i.e 2015) record for each Customers. I'm not interested in records before year 2015!...

    hakaxh5 pointsBadges:
  • Logical file changes and SQL

    I need to make a change to a logical file. I have a program that is accessing this logical via an SQL statement. If I recompile the logical, do I have to recompile the program as well? (the file is not listed in the 'F' specs, it's only referenced in the SQL statement.

    NJSTATEBOB25 pointsBadges:
  • Case statement with Strings in a SQL statement

    I have a SQL statement that DOES work to create a bit of a pivot table. select JOB#, sum(CASE when COURSE#=’36’ then MONTHS  end) as “Training” from FILE where group by JOB# However, what I need is instead of showing the sum of the months, I want to show the string field on if it was...

    spishane25 pointsBadges:
  • 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...

    Plugsharma40 pointsBadges:
  • SQL statements question

    I have an accounts ENTRY table with many fields like (ac_bal, ac_id , ac_date, ...etc) and I want to retrieve the summation of each account in each month as seen in the table below. 10-01 21-04 02-11-4 ..... jan Feb mar . . . Etc. Can anyone help?

    SQL Server Ask the Experts2,585 pointsBadges:
  • SQL update from liba/myfile to libb/myfile

    How can I update a file with the same name (and fields) from one library to another? This is my SQL statement: UPDATE m3fdbqa5/oagrhe set uychid = 'TESTSQL', uysmcd = (SELECT uysmcd FROM mv4cdta001/oagrhe where mv4cdta001/uycono = m3fdbqa5/uycono and mv4cdta001/uyagno = m3fdbqa5/uyagno and...

    CLK50 pointsBadges:

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following