If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Is it possible to bind a "default" schema to a user?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-10-06, 09:18
Shizuma Shizuma is offline
Registered User
 
Join Date: Mar 2006
Posts: 14
Is it possible to bind a "default" schema to a user?

Hi,

I'm quite new on the db2-terrain. If got this problem, in my pro-c code, i would like to call a specific "to_char" function. The problem is, everytime i run the precompiler, it says the sysibm.to_char function is not compatible to the parameters...etc. etc. Thats correct, in my schema i changed the to_char function.

Now, one solution would be, to simply write <schema>.to_char, but thats something i'd like to avoid, cause the application should not be bind to one special schema.

Is there anything db2-specific, with which i can force the db2 precompiler to use the user's schema?

Thanks in advance
Reply With Quote
  #2 (permalink)  
Old 03-10-06, 10:31
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
Please give DB2 version and OS.

Look in the manual for "CURRENT PATH" special register. You should be able to change it through the "SET PATH" statement. Something like:

SET PATH = <schema>, CURRENT PATH

HTH

Andy
Reply With Quote
  #3 (permalink)  
Old 03-13-06, 06:00
Shizuma Shizuma is offline
Registered User
 
Join Date: Mar 2006
Posts: 14
Hi,

OS = Win2k
DB2 = 8.2

I tried to set the schema with the "set schema" command, but still, if I call my own "to_char" function, the precompiler uses the sysibm.to_char function instead and reports an error because the parameters won't fit. Which in fact is correct, but I don't get why the precompiler does not use my function.
For example, if there is no function with the same name in the sysibm schema, the precompiler uses my function.
Reply With Quote
  #4 (permalink)  
Old 03-13-06, 06:19
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
Please re-read Andy's post.

It is not set schema, but set path.

Routines (SPs and UDFs) use the CURRENT PATH special register and NOT Current Schema

HTH

Sathyaram
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #5 (permalink)  
Old 03-13-06, 07:03
Shizuma Shizuma is offline
Registered User
 
Join Date: Mar 2006
Posts: 14
I also tried it with set path, but the changes i made won't be saved. Its a bit strange in my opinion, because I set the path -> works fine; I re-read the path -> works fine, the path changed. But as soon as i close the db2cmd and reopen it, I get the old path value. Is this a normal behaviour ?
Reply With Quote
  #6 (permalink)  
Old 03-13-06, 07:27
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
Yes, it is the normal behaviour.

You may want to put this as part of a config file, at appl level or say, in db2cli.ini
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #7 (permalink)  
Old 03-14-06, 03:53
Shizuma Shizuma is offline
Registered User
 
Join Date: Mar 2006
Posts: 14
Ah, okay - thanks to both of you
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On