• Select highest sequence in SQL400

    Please suggest a feasible solution to address this issueExample output with duplicates (seq 133 and 160): Expectation is to pick only seq 160 by excluding 133: DSBLC DSRMB BDLDD DSUSR DSSEQ 4 55 190,613 CAVC01 133 4 55 190,613 CRPE01 160 Query used in RPGLE program in a scroll-able cursor: select...

    Hamsu230 pointsBadges:
  • Error in compiling embedded SQLRPGLE in full free format

    Hi everyone - here's a question from a user in regards to SQLRPGLE: I have written some simple embedded SQL PGMS in COBOL in AS/400, compiled and run successfully. But I am not able to do so in full free format RPGLE. Here is the RPGLE code that doesn't compile. dcl-s sql_RCONAME char(20) ; exec...

    Michael Tidmarsh65,655 pointsBadges:
  • Pasing Distinct values to UDFs in SQLRPGLE

    Hi, I need to execute a query like, select UDF(col2) from FILE.    col2 is not a unique field in FILE. I don't want to calculate UDF(col2) for same values.  FILE col1 col2 1      77 2      77 3       85 4       85 5       52 I need to handle this situation in query itself....

    xselvam20 pointsBadges:
  • Create table dynamic SQL using SQLRPGLE

    Hi. How can I create table using dynamic SQL using SQLRPGLE?

    amiruladli9540 pointsBadges:
  • Cursor not open in joblog

    I have a SQLRPGLE program, where I'm performing few activities using cursor. When I view the joblog after the program is called, I see "Cursor not open" message. I understand the reason for this message. But, my doubt is, when I debug the program, I could also see other messages like "row not found...

    sri8707315 pointsBadges:
  • CURSOR issue in AS/400

    Hi Friends please someone help me on the below issue. I have a SQL query which I ran in STRSQL. Initially it's showing 17 records in first page and pressed Page down to go to 2nd page then it's showing second set of 17 records. And then If I press page up to go to 1st page again I could see that...

    SatishKumar00735 pointsBadges:
  • How to compare numeric date field with other date fields in SQL?

    Delete from LIBXXX/testB where orddtb<=080917 . The above code compare the date as numeric comparison. But I want date comparison. orddtb is declared as (6P 0). Please help me to compare numeric field date with real date. So that I can process the records. That Date field should be dynamic which...

    rajeshkmr571220 pointsBadges:
  • RPQSQL / SQLRPG

    Any body please help Wanted to know the advantage and disadvantage using RPGSQL / SQLRPG I've heard that this is the new one its not only RPG but become one with SQL. Thanks in advance

    TG50 pointsBadges:
  • Synon – Compilation

    Hello Everybody, I would like to know whether it is possible to use “SQLRPGLE“ source types in Synon, I am currently using Synon “8.1SP1” version.  Can anyone explain the procedure to compile “SQLRPGLE” source type in Synon? Thanks & Regards Bibin George

    BibinGeorge130 pointsBadges:
  • Fetching multiple rows in SQLRPGLE

    Hi, When I try to fetch more records, I couldn't do it. Please see my code below and explain. Thanks.

    as400dev670 pointsBadges:
  • SQLRPGLE: Not able to load data into subfile

    Loaded the data into subfile with SQLRPGLE - prepare statement and cursor and now if I go back and again tried to load back, not able to load the data to the subfile.

    ravula755 pointsBadges:
  • SQLRPGLE – problem with the like while using the wild card

    Hi all, I need your help in the Wild card search in SQLRPGLE. I'm entering the %XAS% in the display file screen field  and now based on the scan if I come across the field is with Wild card, I will use the like :Searchname in the SQLRPGLE code.

    ravula755 pointsBadges:
  • SQLRPGLE Cursors and Recursion

    I'm trying to recursively call a PI in my SQLRPGLE program. Problem is, I get an SQLCODE error of -519 and I'm sure it has to do with cursors and the prepare statement in my PI. Here's the code: pprintPrograms    b      dprintPrograms    PI      d...

    Dcantwell480 pointsBadges:
  • Like in SQLRPGLE

    Hi, I am using the below query in SQLRPGLE Select count(data) into :cntrec from sample where data like '%' "+:tpnumber+" '%'. I am getting an error "Token "+:tpnmber+" was not valid" . The tpnumber is a character field(10a). Sample file is a flat file I even tried '%' +:tpnumber+" '%' and '%'...

    Prashanth123270 pointsBadges:
  • SQLRPGLE with dynamic query

    I have employee1 table with field student_id,name,marks and table with field name, suppose NEHA is present in name field, I have a table with name NEHA. In name table marks,id and subject field is there. I want to fetch subject from name table(neha) where marks >10. I need to write SQLRPGLE...

    nabamita90 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:
  • Require Solution SQL0104 error

    I am trying to compile the below SQLRPGLE code but getting an error SQL0104 because of IN function used with comma. However, the same code is running fine in different server. Source Code: H DftActGrp(*No) ActGrp(*Caller) /Free Exec SQL Set Option Commit=*None; Exec SQL INSERT INTO QTEMP/WKMT5TMP...

    Mdshadabalam130 pointsBadges:
  • Dynamic query statement for SQLRPGLE

    Hi, I would like to build a dynamic query, (File, field and no of fields). User may send one or multiple fields of different data type has to be joined together into to build a query statement. Currently, I prepare a statement , works good for one field. PREPARE Qry_Stmt FROM :Stmt1; When I try for...

    as400dev670 pointsBadges:
  • OPNQRY and WRKQRY

    In WRKQRY, there is an option to save the selected records to an output file. Similarly is there a way to use OPNQRY in a CL or in an SQLRPG to directly move the selected records to another file?

    AnonymousUser49,520 pointsBadges:
  • SQLRPGLE – How to override data set data structure at run time

    I currently have an SQLRPGLE 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 make this...

    NarkedDiver20 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.

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

Following