Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Dynamic SQL giving a SQL error of -204

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
Anu R

New User


Joined: 09 Apr 2008
Posts: 18
Location: India

PostPosted: Mon Jun 16, 2008 3:17 pm    Post subject: Dynamic SQL giving a SQL error of -204
Reply with quote

Hi,

I have dynamic SQL in my program.When I try to execute the program my user Id is prefixed to the tablename and I am getting a SQL error of -204.

Eg:
Say I have a table as TABLE1
When I execute a dynamic SQL query the table is interpreted as USERID.TABLE1 and I get the following error

DSNT408I SQLCODE = -204, ERROR: USERID.TABLE1 IS AN UNDEFINED NAME

Please advise

Regards,
Anurekha.R
Back to top
View user's profile Send private message

Andi1982

New User


Joined: 27 Mar 2008
Posts: 31
Location: Karlsruhe / Germany

PostPosted: Mon Jun 16, 2008 3:34 pm    Post subject:
Reply with quote

Hey,

when you just say table1, it is right that db2 automatically interprets you as creater of the table. If you are not the creator you have to specify the full tablename in the sql: otheruid.table1

Regards
Andi
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Mon Jun 16, 2008 3:36 pm    Post subject:
Reply with quote

dynamic sql needs the creator attached to the table name, unlike imbedded sql.

And if you do not have access to the table creator, you need to revisit your design...
Back to top
View user's profile Send private message
Anu R

New User


Joined: 09 Apr 2008
Posts: 18
Location: India

PostPosted: Mon Jun 16, 2008 3:50 pm    Post subject: Reply to: Dynamic SQL giving a SQL error of -204
Reply with quote

Ho can I provide the creator name?the dynamic SQL area in my program is like this

01 SQL-WORK.
05 SQL-INSTRUCTION.
49 SQL-INSTRUCTION-LEN PIC S9(04) COMP.
49 SQL-BODY PIC X(100).
05 SQL-STATIC-BODY-PARTS.
10 SQL-STATIC-1 PIC X(13) VALUE
'SELECT DATE('''.
10 SQL-STATIC-2 PIC X(03) VALUE
''') '.
10 SQL-STATIC-3 PIC X(20) VALUE
' FROM VTRP_DATE_TIME'.

05 WS-VARIABLE-DURATION PIC X(54).
05 WS-VARIABLE-DURATION-LEN PIC 9(02).

Should I include the creator name in SQL-STATIC-3?For doing so I wuld have to increase the lnegth of the variable.I increased the length of the variable,but if I do so I am getting an error during compilation.

It says
1240 IGYPS2121-S "SQL-STATIC-3" was not defined as a data-name

So do i have to change my program or is there any other way I can do this?
Back to top
View user's profile Send private message
Sinkaravelan S

New User


Joined: 21 Apr 2008
Posts: 27
Location: coimbatore-TN india

PostPosted: Mon Jun 16, 2008 5:42 pm    Post subject: Reply to: Dynamic SQL giving a SQL error of -204
Reply with quote

Anu,

Please ask advice from your RACF team..B'cos they only provide the table access to you with creator permission(Data Owners)...

So you need not worry about creator..Just request to your pm to raise a query(Ticket) to RACF team...RACF team is nothing but just TSO id provisioning team..

I think,You don't have a access to that table..

Regards,
Back to top
View user's profile Send private message
ascelepius

New User


Joined: 16 Jun 2008
Posts: 35
Location: bangalore

PostPosted: Mon Jun 16, 2008 6:51 pm    Post subject: Reply to: Dynamic SQL giving a SQL error of -204
Reply with quote

Hi Anu, I dont think not having the creator name of the program is your problem. I donot give creator names in any of our programs that use Dynamic SQL. In fact thats not considered a good practice at some places..

What you could do is, in your bind card, give:

Code:

QUALIFIER   (SCHEMA1)                 -


This should assign qualifier SCHEMA1 to all unqualified Tables in your SQLs...
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
No new posts FTP Skip or ignore error and process ... AJAYREDDY All Other Mainframe Topics 3 Wed Sep 27, 2017 8:12 pm
No new posts Assembler Macro Copybook converted to... Ziquilix PL/I & Assembler 4 Tue Sep 26, 2017 3:07 am
No new posts FUSE - IBM MQ - CICS integration error Kevin Vaz CICS 1 Mon Sep 18, 2017 4:31 pm
No new posts Reply MQ open error Vignesh Sid COBOL Programming 6 Thu Sep 07, 2017 6:02 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us