matrix0511
asked on
What is the AS400 Command to Run a Record Count on a Table?
I just need to run a simple record count on a table on an AS400. I'm running the command:
select count (*) from crpdta.f551201z
But that command is failing. I know the file exists. So I just want to make sure I"m stating the command correctly.
Can someone let me know real quick for me?
See below.
Thanks!
select count (*) from crpdta.f551201z
But that command is failing. I know the file exists. So I just want to make sure I"m stating the command correctly.
Can someone let me know real quick for me?
See below.
Thanks!
Your command is correct... SQL is complaining about the table name... It is either mistyped or you are not connected to the proper SQL server to access that table.
your command looks fine
are you sure you don't have a typo in the object name?
are you sure you don't have a typo in the object name?
ASKER
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
@davelash, that was it! You DA Man!! :-)
ASKER
Excellent work Dave!!
The problem is that you've specified *SYS naming convention instead of *SQL.
To expand just a little, the default on the STRSQL command is *SYS. You can prompt the command and change it to *SQL when you run the command. (Or simply type the command with the parm on the command line.)
Or, once you're already in an interactive SQL session, you can press <F13> to access session services. Option 1, 'Change session attributes', lets you switch naming convention among other things.
The "Naming convention" can be involved in just about every SQL interaction that you'll have with an AS/400. Usually, whichever client you're using will default according to the platform the client is running on. And every client that I've seen will allow you to change to the alternative mode. Keep it in mind.
Tom
To expand just a little, the default on the STRSQL command is *SYS. You can prompt the command and change it to *SQL when you run the command. (Or simply type the command with the parm on the command line.)
Or, once you're already in an interactive SQL session, you can press <F13> to access session services. Option 1, 'Change session attributes', lets you switch naming convention among other things.
The "Naming convention" can be involved in just about every SQL interaction that you'll have with an AS/400. Usually, whichever client you're using will default according to the platform the client is running on. And every client that I've seen will allow you to change to the alternative mode. Keep it in mind.
Tom