command line and embedded sql
Is there a syntax where you can change the Order By clause based on Indicators? Need to add an F8 "Sort By" to a screen with a Declared SQL Statement. Something like... Select * from .... Where ... Order By Case When (:inF8 = :cNo) Then Fld1, Fld2, Fld3 When (:inF8 =...
see attached .pdf
Hey guys. I'm using some embedded sql in an sqlrpgle CGIDEV2 program. I've used it exactly like this before, but for some reason this time, it's giving me sqlcod = 501. Can anyone tell what's going on? Thanks. D quote C CONST('"') D snglQuote C ...
Hi, I have multiple IBM i servers with DB2 running on it. I want to create an SQL script / CL / RPG program which allows me to connect to multiple servers for copying data from one to another. Here is the pseudo code. SQL connect <SOURCE> server. SQL connect <TARGET> server. Set...
Hi guys, I'm trying to create a QMQRY but I missing one of the field selection which is the date. This is my SQL: SELECT ALL T01.CDCASN, T01.CDAREA, T01.CDSTYL, T01.CDCOLR, T01.CDSDIM, T01.CDPAKU ...
I have a bet...I could test it against our users, but being kinder and gentler, I thought I'd run it by you first. We're getting a "TargetInvocationException" error in our .net code. Our programmer believes it related to a new Stored Procedure, UPDATE Table SET vendor=(SELECT vendor FROM Table...
Hi, I have a 100 field file(item master) and I need to load about 15 fields. Is there an easier way to load them other than the select field1, field2, field3, etc ...
Can someone give me an example on how to load two variables from a db2 file. I believe it is like this /End-Free C/EXEC SQL C+ Select itemmaster C+ SET IDSCE = :SIDSCE, C+ IITYP = :SIITYP,
Would anyone have experience or suggestions with handling stored procedure replication between multiple OS400 environments? When we role-swap environments, we seem to have the SQL Sysprocs and/or Sysparms out of line. Sometimes the procedure is not defined, but the Sysparms are there. Other...
How to create SQL stored procedures in AS400?
Hi, Anyone is aware about the SQLCOD = -000000404. Someone please let me know the purpose of this SQL code? Thanks, Ranjini
Hello guys, i want to find out how i can retrieve the number of records that has just been updated / deleted from embedded sql in a RPGLE program. From what i have searched, i need to use an api called QusRMBRD, which seems very complex. Does anyone have something simple to do this? I want to...
Would anyone know if there is a way to "see" the SQL specific compiler options which were used to create an object? I believe the DSPPGM is telling me the working object has DFTACTGRP and is using *ENDACTGRP, but I'm having an odd challenge... I have an old stored procedure (SQLRPGLE) which...
I almost certain the answer is no, but..:duh Is there any way to do a SQL CREATE VIEW over a specific member of a multi-membered physical file? I am revisiting a problem from years ago here. I think I tried creating the view over an alias (local DDM) and that did not fly. Any other ideas?
I need to modify a procedure which has an input parm which is used as a host var in an SQL select. Now...I need to increase that parm in length (from 3 to 10). I still need a 3 char field for the SQL select to work and have tried a few things to no avail. The SQL host var in this case is a...
I have a generic question here... While processing SQL statements within SQLRPGLE, does anyone have a generic close routine for the "ifs"?? If a SQL loop errors for whatever reason (Open/Fetch/Process/Close) and the program terminates without closing the cursor... how do you close it out...
Cursor is defined as: Exec SQL Declare WrkDtl Cursor For SELECT * FROM InvDWrk WHERE ShipID = :HdrOut.ShipID and Whs = :HdrOut.Whs and Invoice = :HdrOut.Invoice ...
In need to know where the sql queries get stored? Might be stored in some system libraries in qsys.....also while exit sql if press 2 means...the session get stored are not?
I need to change the records of the file through sqlrpgle......please somebody help me to do this....i need exact code.........can u please
I need to change which library SQL stmts use in a program depending on prompt screen input. I know I can duplicate the select statements and use static library names. I also know I can't use a variable name for the library (i.e. :libname/iwm). I have tried changing the library list in the...
Is there a Value Compatibility issue between a DDS and DDL? I have an Original Table with a DDS FieldA defined as 15a I have a new Table with DDL that has FieldA defined as Char(15) Both tables are the same layouts (sans a few extra fields in the 2nd table) Performing the following errors...
Hello, I'm try to sort columns in a called procedure and I'm unable to get the case statement to work in the code below. No matter what parm is passed, the first statement (the ASC , in this case) is the only one that executes. If I manually change the sort feature to be one statement ( further...
I have a table with 7 columns. I need to get only the duplicated rows based on 5 columns. Could any one help me out. Thanks.
How can I select a physical file (PF) with multiple members on AS/400 from Windows SQL?
Hi, I need to obtain only certain word's from a string. Is there a easy way to do that? Thanks
I have a need to combine multiple rows into a single row, here is the table: Cust Store StartDate StoreDay StoreFreq 94703 427 01/16/10 MON WEEKLY 94703 427 01/16/10 WED ...
I need to build a conditional Where Clause but not sure how to construct.... I have a single field that I either need ALL records (Fieldname = Fieldname) or NOT IN a group (FieldName Not in ( cond1, cond2 )) and I want to base this on an indicator... So, going by what I know it's going to be...
There are currently 4 users browsing this forum. (0 members & 4 guests)
Use this control to limit the display of threads to those newer than the specified time frame.
Allows you to choose the data by which the thread list will be sorted.
Order threads in...
Note: when sorting by date, 'descending order' will show the newest results first.
Forum Rules