Problems using SQL CONNECT to a remote server within an RPGLE program
Let me apologize in advance if I fumble with the terminology and don’t explain myself as clearly as everyone is probably accustomed to. The specific situation I’m dealing with involves the need to have an RPGLE program on the iSeries connect to a data base that resides on a remote server. My boss has set [...]
Answer Question
| April 11, 2013 5:15 PM
RPGLE Program, SQL Connect, SQL statements
Let me apologize in advance if I fumble with the terminology and don’t explain myself as clearly as everyone is probably accustomed to. The specific situation I’m dealing with involves the need to have an RPGLE program on the iSeries connect to a data base that resides on a remote server. My boss has set [...]
Recursive SQL error
For the life of me I can not see what my problem is. Any help would be appreciated. *************** Beginning of data **************************************** WITH RPL (LEVEL, PINBR, CINBR, QTYPR) AS (SELECT 1, ROOT.PINBR, ROOT.CINBR, ROOT.QTYPR FROM ITSTRU ROOT WHERE ROOT.PINBR = ’8B714-0005651′ UNION ALL SELECT PARENT.LEVEL+1, CHILD.PINBR, CHILD.CINBR, CHILD.QTYPR FROM RPL PARENT, ITSTRU CHILD WHERE [...]
Answer Question
| February 12, 2013 8:27 PM
SQL error messages, SQL statements
For the life of me I can not see what my problem is. Any help would be appreciated. *************** Beginning of data **************************************** WITH RPL (LEVEL, PINBR, CINBR, QTYPR) AS (SELECT 1, ROOT.PINBR, ROOT.CINBR, ROOT.QTYPR FROM ITSTRU ROOT WHERE ROOT.PINBR = ’8B714-0005651′ UNION ALL SELECT PARENT.LEVEL+1, CHILD.PINBR, CHILD.CINBR, CHILD.QTYPR FROM RPL PARENT, ITSTRU CHILD WHERE [...]
CRTSQLRPGI
I have two questions about an RPGLE program with embedded SQL statements: When compiling an RPGLE program with embedded SQL statements, how do you set the activation group? I am trying to run a program which ran when we were on version 5V4. Now that I am on version 6.1, the exact same program will [...]
Answer Question
| May 25, 2012 4:27 PM
AS/400 v6.1, AS400 RPGLE, SQL statements
I have two questions about an RPGLE program with embedded SQL statements: When compiling an RPGLE program with embedded SQL statements, how do you set the activation group? I am trying to run a program which ran when we were on version 5V4. Now that I am on version 6.1, the exact same program will [...]
Track SQL Statements run by a specific user through ODBC Connection
There is a user id connecting to our iSeries System through ODBC Connection and will be executing some selected queries on iSeries using a 3rd Party Application. Those selected queries are approved by the Application Owner. Hence we would like to track the SQL Statements which are executed by this id on daily basis to [...]
Answer Question
| March 31, 2012 6:45 AM
iSeries DB2, SQL statements
There is a user id connecting to our iSeries System through ODBC Connection and will be executing some selected queries on iSeries using a 3rd Party Application. Those selected queries are approved by the Application Owner. Hence we would like to track the SQL Statements which are executed by this id on daily basis to [...]
Single commitment control in RPGLE program
I have a rpgle program that uses 3-4 sql statements to update and insert data in 3-4 tables . Now what i want is that when program runs successfully then only these changes in tables should reflect else roll back . So for this is there any way to provide a single commitment control for [...]
Answer Question
| May 17, 2011 4:18 PM
RPGLE Program, SQL statements, SQLRPGLE, V6R1
I have a rpgle program that uses 3-4 sql statements to update and insert data in 3-4 tables . Now what i want is that when program runs successfully then only these changes in tables should reflect else roll back . So for this is there any way to provide a single commitment control for [...]
MySql Select multiple columnsfrom distinct rows based on one column
I am building one sql query based on 5 select statements unioned all together. Each select is built as a variable with where clauses based on filters selected by the users. All 5 selects are concatenated together to build the one dynamic query. The one select below needs to be changed to select rows only [...]
Answer Question
| March 28, 2011 6:35 PM
iSeries V6R1, MySQL, SQL statements, V6R1
I am building one sql query based on 5 select statements unioned all together. Each select is built as a variable with where clauses based on filters selected by the users. All 5 selects are concatenated together to build the one dynamic query. The one select below needs to be changed to select rows only [...]
Running Multiple SQL statements through JCL
I need to run multiple sql statements seperatd by ‘;’. I want the execution to continue for all the SQL statements even if any of the SQLs throws out error. Is it possible?
Answer Question
| January 13, 2011 11:05 PM
DB2 SQL, JCL, SQL error messages, SQL Server, SQL statements
I need to run multiple sql statements seperatd by ‘;’. I want the execution to continue for all the SQL statements even if any of the SQLs throws out error. Is it possible?
SQL Server 2005 query
Hello sir I am new to sqlserver when retriving data like name gender sal deptno df F 100.00 10 mf M 1100.00 10 if M 1010.00 10 uf M 1000.00 20 yf F 1200.00 20 gf F 1030.00 20 hf M 1005.00 30 ff F 1040.00 30 from this i want retrive deptno maletotal sal [...]
Answer Question
| December 31, 2010 7:54 AM
SQL Query, SQL Server 2005, SQL Server Query, SQL statements
Hello sir I am new to sqlserver when retriving data like name gender sal deptno df F 100.00 10 mf M 1100.00 10 if M 1010.00 10 uf M 1000.00 20 yf F 1200.00 20 gf F 1030.00 20 hf M 1005.00 30 ff F 1040.00 30 from this i want retrive deptno maletotal sal [...]
Do I need SQL?
DO I need it? I am just a home user anf oerform simole tasks, but have 8 examples of SQL programs in my program list. I have win 7 64 bit O/S
Answer Question
| November 29, 2010 11:19 AM
SQL, SQL procedure, SQL Server, SQL statements
DO I need it? I am just a home user anf oerform simole tasks, but have 8 examples of SQL programs in my program list. I have win 7 64 bit O/S
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 CityId IN (23,45,85,86)’ SELECT @strQuery= ‘SELECT VendorId From [...]
Answer Question
| October 15, 2010 9:31 PM
SELECT statement, SQL Parameters, SQL statements, T-SQL
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 CityId IN (23,45,85,86)’ SELECT @strQuery= ‘SELECT VendorId From [...]
Embedded SQL in RPGLE
I am trying to get some counts and totals from one file and put them in another. My SQL statement works fine with STRSQL, not in the RPGLE. Do I have to declare/set a cursor, exec sql and close the cursor just to put the total in another file? C/EXEC SQL C+ INSERT INTO outputfile [...]
Answer Question
| September 29, 2010 2:02 PM
Embedded SQL, MySQL, RPGLE, SQL, SQL statements
I am trying to get some counts and totals from one file and put them in another. My SQL statement works fine with STRSQL, not in the RPGLE. Do I have to declare/set a cursor, exec sql and close the cursor just to put the total in another file? C/EXEC SQL C+ INSERT INTO outputfile [...]
What does this mean when SQLCOD = -206? I need to write 2 sets embedded SQL statement in my program.
what does this mean when SQLCOD = -206. I need to write 2 sets embedded SQL statement in my program. first one is one and I was able to fetch data but the 2nd one has error just right after I declare cursor. Here are the statements EVAL SQLSTMT2 = SELECT_H_2 + WHERE_H_2; + AND_H_A; [...]
Answer Question
| August 19, 2010 7:06 PM
iSeries SQL, SQL statements, SQLRPGLE, System i
what does this mean when SQLCOD = -206. I need to write 2 sets embedded SQL statement in my program. first one is one and I was able to fetch data but the 2nd one has error just right after I declare cursor. Here are the statements EVAL SQLSTMT2 = SELECT_H_2 + WHERE_H_2; + AND_H_A; [...]
How to keep date format when creating Index on a Table
I have used CREATE TABLE to create a PF which contain a DATE field. And then use CREATE INDEX to create a LF with data selections. However, when I check the DATE field, I find that, in the PF, its Date Format is *ISO; but in the LF, its Date Format has been changed to [...]
Answer Question
| July 2, 2010 3:06 AM
SQL Database Indexing, sql indexes, SQL statements, SQL tables
I have used CREATE TABLE to create a PF which contain a DATE field. And then use CREATE INDEX to create a LF with data selections. However, when I check the DATE field, I find that, in the PF, its Date Format is *ISO; but in the LF, its Date Format has been changed to [...]
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?
Answer Question
| February 18, 2011 7:54 PM
SQL, SQL statements
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?
Simply, How do I populate Fields from a SQL Statement in Oracle Apex?
This is not a facitious question. I am new to APEX. I have looked over this stuff for weeks, but I can’t find a way to run an SQL statement and populate text boxes. I have tried the famous “For C1 in (Select…” but, when I put it into any of the areas, the event [...]
Answer Question
| January 20, 2010 8:10 PM
Oracle Apex, PL/SQL, SQL, SQL statements
This is not a facitious question. I am new to APEX. I have looked over this stuff for weeks, but I can’t find a way to run an SQL statement and populate text boxes. I have tried the famous “For C1 in (Select…” but, when I put it into any of the areas, the event [...]
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
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 [...]
Using SQL Connect Statement in SQLRPGLE
I need to use the SQL CONNECT statement within a SQLRPGLE program to connect from one AS400 system to another. I need to get data from one file to another. Does anyone know how to do this? Can it be done within a program. I have no trouble when I do it on an SQL [...]
Answer Question
| June 30, 2009 9:00 PM
CLP, RPGLE, SQL, SQL Connect Statement, SQL statements
I need to use the SQL CONNECT statement within a SQLRPGLE program to connect from one AS400 system to another. I need to get data from one file to another. Does anyone know how to do this? Can it be done within a program. I have no trouble when I do it on an SQL [...]
Finding nth most recent action with SQL
I am trying to determine the date on which a certain number of things have happened cumulatively, eg I have a varying number of buyers each month. I want to find out on what date of that month, those buyers make their 3rd purchase. My SQL doesn’t seem to support TOP or ROWCOUNT so I [...]
Answer Question
| May 19, 2009 10:11 PM
COUNT statement, Database programming, SQL, SQL query optimization, SQL statements, SUM statement
I am trying to determine the date on which a certain number of things have happened cumulatively, eg I have a varying number of buyers each month. I want to find out on what date of that month, those buyers make their 3rd purchase. My SQL doesn’t seem to support TOP or ROWCOUNT so I [...]
Group header section in VB Data Report
How to create Datareport in vb through Sql statement in dataenviroment having Group hader section
Answer Question
| May 25, 2009 2:59 PM
DataEnvironment, SQL statements, VB Data Report
How to create Datareport in vb through Sql statement in dataenviroment having Group hader section
SQL Server 2005
CAN ANYBODY HELP ME “HOW TO ASSIGN A SQL-STATEMENT IN A VARIABLE”. FOR EXAMPLE : TO ASSIGN A STRING IN A VARIABLE, WE DO LIKE THIS: DECLARE @A AS VARCHAR(20) SET @A=’HAI’ PRINT @A OUTPUT: HAI SIMILARLY HOW TO ASSIGN A SQL-STATEMENT IN A VARIABLE.
Answer Question
| May 11, 2009 6:37 AM
SQL, SQL Server 2005, SQL statements, SQL variables
CAN ANYBODY HELP ME “HOW TO ASSIGN A SQL-STATEMENT IN A VARIABLE”. FOR EXAMPLE : TO ASSIGN A STRING IN A VARIABLE, WE DO LIKE THIS: DECLARE @A AS VARCHAR(20) SET @A=’HAI’ PRINT @A OUTPUT: HAI SIMILARLY HOW TO ASSIGN A SQL-STATEMENT IN A VARIABLE.





