473,324 Members | 2,246 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

SYSPROC.ADMIN_CMD

I am trying to do the following from within a procedure.

set vcsql = 'Call SYSPROC.ADMIN_CMD(' || '''load from /dev/null of del
replace into bi.Provisioned_Spam''' || ')';

execute immediate vcsql;

The documentation says that I can use the sysproc.admin_cmd for load,
but when i use the above statement, it throws me an error.

SQL0104N An unexpected token "load" was found following
"BEGIN-OF-STATEMENT".
Expected tokens may include: "DESCRIBE". SQLSTATE=42601

Aug 23 '06 #1
3 8359
Are you on v8 or v9? ADMIN_CMD supports LOAD in v9, but not in v8.

v8
DESCRIBE
EXPORT
PRUNE HISTORY/LOGFILE
REORG INDEXES/TABLE
RUNSTATS
UPDATE DATABASE CONFIGURATION

v9
ADD CONTACT
ADD CONTACTGROUP
AUTOCONFIGURE
BACKUP - online only
DESCRIBE
DROP CONTACT
DROP CONTACTGROUP
EXPORT
FORCE APPLICATION
IMPORT
INITIALIZE TAPE
LOAD
PRUNE HISTORY/LOGFILE
QUIESCE DATABASE
QUIESCE TABLESPACES FOR TABLE
REDISTRIBUTE
REORG INDEXES/TABLE
RESET ALERT CONFIGURATION
RESET DATABASE CONFIGURATION
RESET DATABASE MANAGER CONFIGURATION
REWIND TAPE
RUNSTATS
SET TAPE POSITION
UNQUIESCE DATABASE
UPDATE ALERT CONFIGURATION
UPDATE CONTACT
UPDATE CONTACTGROUP
UPDATE DATABASE CONFIGURATION
UPDATE DATABASE MANAGER CONFIGURATION
UPDATE HEALTH NOTIFICATION CONTACT LIST
UPDATE HISTORY

--Jeff

chettiar wrote:
I am trying to do the following from within a procedure.

set vcsql = 'Call SYSPROC.ADMIN_CMD(' || '''load from /dev/null of del
replace into bi.Provisioned_Spam''' || ')';

execute immediate vcsql;

The documentation says that I can use the sysproc.admin_cmd for load,
but when i use the above statement, it throws me an error.

SQL0104N An unexpected token "load" was found following
"BEGIN-OF-STATEMENT".
Expected tokens may include: "DESCRIBE". SQLSTATE=42601
Aug 23 '06 #2
Thanks for the clarification Jeff. I am still on v8..

I can use the sysproc.db2load procedure to truncate a table from the
command prompt, but when I wrap it within a procedure, I keep getting
errors.

Can someone please help.
jefftyzzer wrote:
Are you on v8 or v9? ADMIN_CMD supports LOAD in v9, but not in v8.

v8
DESCRIBE
EXPORT
PRUNE HISTORY/LOGFILE
REORG INDEXES/TABLE
RUNSTATS
UPDATE DATABASE CONFIGURATION

v9
ADD CONTACT
ADD CONTACTGROUP
AUTOCONFIGURE
BACKUP - online only
DESCRIBE
DROP CONTACT
DROP CONTACTGROUP
EXPORT
FORCE APPLICATION
IMPORT
INITIALIZE TAPE
LOAD
PRUNE HISTORY/LOGFILE
QUIESCE DATABASE
QUIESCE TABLESPACES FOR TABLE
REDISTRIBUTE
REORG INDEXES/TABLE
RESET ALERT CONFIGURATION
RESET DATABASE CONFIGURATION
RESET DATABASE MANAGER CONFIGURATION
REWIND TAPE
RUNSTATS
SET TAPE POSITION
UNQUIESCE DATABASE
UPDATE ALERT CONFIGURATION
UPDATE CONTACT
UPDATE CONTACTGROUP
UPDATE DATABASE CONFIGURATION
UPDATE DATABASE MANAGER CONFIGURATION
UPDATE HEALTH NOTIFICATION CONTACT LIST
UPDATE HISTORY

--Jeff

chettiar wrote:
I am trying to do the following from within a procedure.

set vcsql = 'Call SYSPROC.ADMIN_CMD(' || '''load from /dev/null of del
replace into bi.Provisioned_Spam''' || ')';

execute immediate vcsql;

The documentation says that I can use the sysproc.admin_cmd for load,
but when i use the above statement, it throws me an error.

SQL0104N An unexpected token "load" was found following
"BEGIN-OF-STATEMENT".
Expected tokens may include: "DESCRIBE". SQLSTATE=42601
Aug 24 '06 #3
If all you want to do is truncate the table, you can use ALTER TABLE
ACTIVATE NOT LOGGED INITIALLY WITH EMPTY TABLE
The only downside of this statement is that you can't do roll forward
recovery through it.
Also you can use IMPORT to truncate.

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab

IOD Conference
http://www.ibm.com/software/data/ond...ness/conf2006/
Aug 24 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Andy S. | last post by:
Hi, I'm running DB2 v 7.2 FP 9. After connecting to DB2, i ran the following commands: set path = "SYSIBM","SYSFUN","DB2ADMIN","SYSPROC" SELECT * FROM TABLE(SYSPROC.ENV_GET_INST_INFO())...
3
by: efiryago | last post by:
Are stored procedures in SYSPROC schema documented and supportedd? I am particularly intersted in the procedure SYSPROC.DB2LOAD which seems to be a SQL wrapper to the db2 load API. If that is true,...
1
by: UDBDBA | last post by:
Hi: How can one call SYSPROC.DB2LOAD procedure within a SQL stored procedure. I get the following error: DB21034E The command was processed as an SQL statement because it was not a valid...
7
by: db2adm1 | last post by:
I am getting the following error while trying to alter a table's column...I am trying to increase the decimal length of the column from 5 to 6 using altobj procedure. SQL0443N Routine...
1
by: Gregor KovaĨ | last post by:
Hi! I'm using procedure ADMIN_CMD to export/import tables into IXF files. Is there a way to tell what codepage EXPORT/IMPORT should use? Best regards, Kovi --...
0
by: kyma333 | last post by:
We're on AIX5.3/DB2 UDB 8.1 FP12. One of the production servers have ADMIN_CMD but not the other one. I'm new to stored procedures in V8. What would be the easiest way to copy it over?
1
by: jefftyzzer | last post by:
Friends: The (v9) documentation for invoking LOAD via the ADMIN_CMD SP has this to say: "Since all load processes (and all DB2 server processes, in general) are owned by the instance owner,...
1
by: Roger | last post by:
For some reason when i execute this : select table_name from table(sysproc.snapshot_tbreorg('',-1))as t I doesn't return any data on couple of databases, but works on others, yet when I do list...
0
by: David Beardsley | last post by:
I'm trying to write a stored procedure that will terminate a load for a given table using the SYSPROC.ADMIN_CMD procedure. When I take the syntax that works using Quest: LOAD FROM '/dev/null'...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.