QSQPTABL

Any IBM i topic that does not fit in another forum
Post Reply
agahir
Posts: 1
Joined: Wed May 22, 2024 2:22 pm

QSQPTABL

Post by agahir »

Hi All
I have accidentally cleared the table QSQPTABL in QSYS2.

This file, QSQPTABL had 1 row with a value of 1.

I have tried to update the value without success, sql, upddta etc won't work.

This is a PF with 103 logicals attached and has object locks on files that cannot end.

Any help will be appreciated.

Thanks

A Gahir
moti
Posts: 6
Joined: Tue Aug 17, 2021 12:37 pm

Re: QSQPTABL

Post by moti »

Hi,
1. Try and duplicate the PHYSICAL file to your library.
2. If you succeed, update the new file with the relevant data.
3. Copy the new file to the original file (*Replace or *Add).

Hope it helps....

Have a nice day,
Moti.
Scott Klement
Site Admin
Posts: 693
Joined: Sun Jul 04, 2021 5:12 am

Re: QSQPTABL

Post by Scott Klement »

You cleared QSQPTABL?

As you said, it should only have one row and one column, containing the number 1. It shouldn't ever be updated or changed -- that's always what that table contains.

Moti's message makes no sense. QSQPTABL *is* a physical file. And I don't see why you'd ever have a copy of it anywhere... this file doesn't contain useful data. It is only a simple one row table containing the number 1, it's only purpose is to let you do select statements where everything gets calculated and you dont' need anything from the actual table.

For example, you could do this to get the current date:

Code: Select all

select current_date from QSQPTABL
So you aren't actually USING the data in QSQPTABL, it's purpose is just to provide something you can run a select statement against so that you can get the output of an expression/function/etc.

If QSQPTABL somehow got cleared (I don't know how that's possible -- the system blocks you from doing stuff like that) you could just fix it the same way you cleared it... run a statement like INSERT INTO QSQPTABL VALUES(1)

But.. again... this shouldn't be possible. It should always have just the one column containing a 1. It shouldn't be possible to change that.
Post Reply