+ Post New Thread
Page 1 of 36 1 2 3 11 ... LastLast
Threads 1 to 25 of 879

Forum: SQL

command line and embedded sql

  1. Sticky Thread Sticky: Order By with Case

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

    Started by FaStOnE, August 25th, 2009 02:00 PM
    2 Pages
    1 2
    • Replies: 28
    • Views: 1,763
    September 24th, 2009 01:51 AM Go to last post
  2. Sticky Thread Sticky: Listing of SQLSTATE values

    see attached .pdf

    Started by jamief, May 15th, 2008 11:30 AM
    • Replies: 5
    • Views: 1,864
    June 16th, 2008 12:30 AM Go to last post
  1. Adding new member in SQL table

    Hi Folks, There is SQl table , i need to add a new member in that table. For that purpose i am trying with ADDPFM but in this case an error occures. Is there any way to add new member in SQL table?? Pramendra

    Started by pramendra, 1 Week Ago 02:13 AM
    • Replies: 8
    • Views: 185
    1 Week Ago 01:25 AM Go to last post
  2. CASE / IF in SQL

    Hej Im new to query on as400. And i would be greatfull if you guys could help. Im trying to create a query where i want the sql to calculate for me. I have a field that determins if the coustomer pays 1/2/4 times a year. And another field that shows the price So i want it to calculate...

    Started by SinCityLegend, 2 Weeks Ago 07:13 AM
    2 Pages
    1 2
    • Replies: 22
    • Views: 431
    1 Week Ago 08:14 AM Go to last post
  3. Embeded SQL FETCH FIRST x ROWS

    Can we use a variable value for the FETCH FIRST x ROWS? Something like: Select Name, Address, City, State, Zip, Phone From MyTable Where Zip = 85024 Fetch First :Num Rows Only;If not, how could this be accomplished? (Sorry, working in COBOL and trying to help a colleague)

    Started by FaStOnE, 2 Weeks Ago 12:13 PM
    • Replies: 5
    • Views: 144
    2 Weeks Ago 10:54 AM Go to last post
  4. Question Determine library or schema creation

    Hi All, How can we determine from the library object that it is created via SQL or AS400 CRTLIB command? I have created library by two ways 1) SQL - Create Schema 2) AS400 - CRTLIB Now from the object MyLib how we can determine the difference whether it is created by SQL or AS400? Here I...

    Started by Nil, 2 Weeks Ago 08:45 AM
    • Replies: 3
    • Views: 126
    2 Weeks Ago 01:04 AM Go to last post
  5. Using AS to correlate a table

    Some days I hate SQL! The following statement works fine in interactive SQL: SELECT i1.odlbnm,i1.odobnm,i1.odobtp,i1.odobat,i1.odcdat, i3.odobnm,i3.odobtp,i3.odobat,i3.odcdat FROM fmpscsrco AS i1 FULL OUTER JOIN fmpsctgto AS i3 ...

    Started by zkarj, 2 Weeks Ago 12:29 AM
    • Replies: 5
    • Views: 160
    2 Weeks Ago 01:25 AM Go to last post
  6. Unhappy SET SCHEMA in SQL stored procedure

    This is driving me absolutely batty. I've spent hours searching for a solution and not found one. It relates to the following procedure: create procedure copy_user_ids (in lib char(10), fromuser char(10), touser char(10)) language sql modifies...

    Started by zkarj, 4 Weeks Ago 12:23 AM
    • Replies: 5
    • Views: 201
    2 Weeks Ago 12:24 AM Go to last post
  7. quick question for counting unique order numbers

    I have a file that contains order numbers. Some of them are repeated. I want to run a quick SQL to grab the count of unique order numbers in the file. I tried this, but it says I have a syntax error: SELECT COUNT(*) FROM (SELECT DISTINCT ORDER# FROM FILE1) I know it's something...

    Started by soup_dog, 4 Weeks Ago 02:11 PM
    • Replies: 3
    • Views: 134
    3 Weeks Ago 03:04 PM Go to last post
  8. Need a Dynamic Insert Example

    Does anyone have one? Need to pass a Library and File name to a program and insert records into that table. Just curious if anyone has an example...

    Started by FaStOnE, July 29th, 2010 07:35 AM
    2 Pages
    1 2
    • Replies: 29
    • Views: 466
    4 Weeks Ago 08:52 AM Go to last post
  9. Use VB macro in excel 2007 to Iseries

    Hi All does any one help me to coding the VB marco in excel 2007 to access Iseries , everyday i need to use sql/400 to extract data then provide to user. I want to creat aform in excel embed sql/400 statement in coding , user will fill parameter they want to extract , If any have the...

    Started by tintin, July 20th, 2010 11:36 PM
    • Replies: 11
    • Views: 380
    July 24th, 2010 09:09 AM Go to last post
  10. Question Reading and declaring Files without F-spec

    I have to read more than 50 PF's in a program and process one of the fields in each of the files. I have the filenames and their corresponding field names stored in another physical file A. Now I dont want to declare all these 50 PF's in my program. I just want to read the file A, get the file...

    Started by mahesh5balaji, July 13th, 2010 02:17 AM
    • Replies: 6
    • Views: 244
    July 20th, 2010 03:25 AM Go to last post
  11. SQL Search/Select

    I have string that I need to return a value from ... And example of the field value is: U �^USENU�S���!�S���b����/_��%��>;��S���bQASP01 00001�USENU�Y�/QIBM/ProdData/OS400/Servers/streamfile.end I need to select from the first '/' to the end of the string. This is a variable location so...

    Started by FaStOnE, July 14th, 2010 11:48 AM
    • Replies: 3
    • Views: 169
    July 14th, 2010 01:10 PM Go to last post
  12. SQLRPGLE program to execute SQL statement on remote DB

    Hello All, I want to connect to another ISeries DB2 database using SQLRPGLE program to do some calculation on it. What I did shows bellow, but I can’t compile this code & thoughts something very wrong in my code. Is it possible? Any idea please.. /free ...

    Started by dhanuxp, July 14th, 2010 06:08 AM
    • Replies: 2
    • Views: 191
    July 14th, 2010 10:57 AM Go to last post
  13. is this weird or am i missing something?

    i run an SQL statement: select (243740451/7986520603) * 100 from qtemp/temp1 and i get 0 (should be 3.05xxxx) but if i change it to cast as float it works?? select cast(243740451 as float)/cast(7986520603 as float) * 100 from qtemp/temp1 ...

    Started by tomholden, July 13th, 2010 10:17 AM
    • Replies: 8
    • Views: 191
    July 14th, 2010 06:46 AM Go to last post
  14. SQL Job Performance

    Hi guys, I wonder if you could offer any advice for me please.. A client has a process which connects to the iSeries and runs a number of SQL queries, this happens at various times through the day and there are often multiple instances running. This process has been re-written to make the...

    Started by ChrisL, June 28th, 2010 03:52 AM
    • Replies: 3
    • Views: 200
    July 12th, 2010 06:47 AM Go to last post
  15. Lightbulb RUNSQLSTM vs STRQMQRY vs Embedded SQL

    I am curious to find out what others prefer when they run a SQL statments in batch mode. To keep this discussion simple and straight forward, it needs to run on the iSeries (AS/400) as batch job. Any IBM supplied command or user created options are more then welcome. Anybody willing to give an...

    Started by Sbp0718, January 17th, 2006 04:42 PM
    2 Pages
    1 2
    • Replies: 21
    • Views: 6,195
    July 9th, 2010 07:45 AM Go to last post
  16. Question How to insert sequence value with case when

    Hi All, Is it possible to insert sequence value with "case when" like following, basically it is giving me error during program coding that 'NEXT VALUE expression not used correctly' Here is the code...... C+ Insert Into RPI_INSUR_PKG_LOCK_DTL ( C+ INSUR_PKG_INTRN_ID, C+ ...

    Started by Nil, July 7th, 2010 01:52 AM
    • Replies: 2
    • Views: 179
    July 7th, 2010 06:47 AM Go to last post
  17. Exclamation How to check SQLCOD for duplicate key value during insertion

    Hi All, Could any one please tell me how to check SQLCOD for duplicate key value during insertion in SQLRPGLE program. Is there any SQLCOD to check this condition?

    Started by Nil, June 29th, 2010 01:39 AM
    • Replies: 1
    • Views: 132
    June 29th, 2010 02:08 AM Go to last post
  18. Exclamation How program move forcefully into message wait?

    Hi All, I have written a program in SQLRPGLE that does only insert into a table. Now I want to achieve that if SQLCOD <> 0 (i.e. not successful insertion) then program should go into message wait, how I can do this? Thanks in Advance........

    Started by Nil, June 18th, 2010 08:20 AM
    • Replies: 7
    • Views: 258
    June 29th, 2010 01:45 AM Go to last post
  19. How to question - search for buried hex values in a file

    Just like the title states. Here is the situation. We are pulling data from our i5 server into a MS-SQL table. The pull fails on a small number of records. After determining which records (4 out of around 105,000) were causing MS-SQL to choke, I spotted a x'36' in the middle of a text field. I...

    Started by SteveL, June 23rd, 2010 12:11 PM
    • Replies: 3
    • Views: 204
    June 23rd, 2010 02:10 PM Go to last post
  20. SQL dups issue

    I am trying to remove dups from a mySQL database result set and am having an issue. This is my table: vehicle_id primary key auto incremented bigint 20 aaia_id bigint 20 shop_id bigint 20 create_date timestamp

    Started by kast1, June 15th, 2010 11:11 AM
    • Replies: 4
    • Views: 178
    June 16th, 2010 08:21 AM Go to last post
  21. Joined Logical ruining my SQL!

    Hi all, I have an SQL query that has been running happily for several months. However a new Joined Logical file has been implemented into the system which I think is killing the query. The JL is linking from my third joined file to a file my query doesn't even want to go to?! However the key...

    Started by mark66, June 15th, 2010 04:49 AM
    • Replies: 3
    • Views: 169
    June 15th, 2010 07:37 AM Go to last post
  22. Updating the data in Upper Case on very large physical file

    Hello Folks , I have encounterd with problem . There is file say CUSTM having two field CUNMFL and CUNMFD . data are same in both the fields my idea was to convert 1st CUNMFL to Upper case due to performance issue . but as I ran the query UPDATE CIMCUS SET CUNMFL=UPPER(CUNMFL) WHERE...

    Started by pramendra, June 9th, 2010 06:31 AM
    2 Pages
    1 2
    • Replies: 23
    • Views: 490
    June 14th, 2010 10:30 AM Go to last post
  23. Pf's Member data in SQl

    Is there any way by which we can view a PF's member data in Sql without using VIEW or OVRDBF command.

    Started by dhyanesh_g, May 28th, 2010 10:43 PM
    • Replies: 2
    • Views: 230
    June 2nd, 2010 07:47 AM Go to last post
  24. Insert Into with Select

    Hello, If column names are not the same but I want to add records from one file to another using only some of the fields (size are same), What am I missing in this INSERT statement? INSERT INTO QTEMP/FILE1 (F1POLCN, F1RENWN ) VALUES (F2POLCN , F2RENWN) ...

    Started by dhanuxp, May 31st, 2010 05:21 AM
    • Replies: 1
    • Views: 188
    May 31st, 2010 05:29 AM Go to last post
  25. What wrong in this?

    Please help me in this progrm. iam new to sql rpg plz find the attached...doc

    Started by rajapandian, May 26th, 2010 10:36 AM
    2 Pages
    1 2
    • Replies: 21
    • Views: 536
    May 28th, 2010 12:39 PM Go to last post

+ Post New Thread

Forum Information and Options

Moderators of this Forum
Users Browsing this Forum

There are currently 3 users browsing this forum. (0 members & 3 guests)

Thread Display Options

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.

Icon Legend

Contains unread posts
Contains unread posts
Contains no unread posts
Contains no unread posts
More than 15 replies or 10 views
Hot thread with unread posts
More than 15 replies or 10 views
Hot thread with no unread posts
Closed Thread
Thread is closed
Thread Contains a Message Written By You
You have posted in this thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts