What database engine? That looks like postgresql. If so, add the schema you are interested in working with into the search path or explicitly use the schema in your query.<div><br></div><div>schema.function(args) rather than just function(args)</div>
<div><br></div><div>You can set the search path using alter user ...<br><br><div class="gmail_quote">On Mon, Nov 15, 2010 at 10:56 AM, Jerry Richards <span dir="ltr"><<a href="mailto:jerry.richards@teotech.com">jerry.richards@teotech.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div lang="EN-US" link="blue" vlink="purple"><div><p class="MsoNormal">Hello,</p><p class="MsoNormal"> </p><p class="MsoNormal">
I need to access a database using two different schemas. During initialization the default schema is set as follows:</p><p class="MsoNormal"> </p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">set schema 'ucm';</span></p>
<p class="MsoNormal"> </p><p class="MsoNormal">Then later, I need to get data from a table in another schema 'ts_sofia_internal', so I tried the following, but it returns an error as shown:</p><p class="MsoNormal">
</p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">teo=# select * from sip_presence('ts_sofia_internal') where sip_presence.sip_user='1003';</span></p><p class="MsoNormal">
<span style="font-size:10.0pt;font-family:"Courier New"">ERROR: function sip_presence(unknown) does not exist</span></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">LINE 1: select * from sip_presence('ts_sofia_internal') where sip_pr...</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New""> ^</span></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">HINT: No function matches the given name and argument types. You might need to add explicit type casts.</span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Courier New"">teo=#</span></p><p class="MsoNormal"> </p><p class="MsoNormal">Does anyone know how I can do this? By the way, I will actually implement the query in C and connect to the DB via ODBC.</p>
<p class="MsoNormal"> </p><p class="MsoNormal">Thanks,</p><p class="MsoNormal">Jerry</p><font color="#888888"><p class="MsoNormal"> </p><p class="MsoNormal"> </p><p class="MsoNormal"> </p></font></div></div><br>_______________________________________________<br>
FreeSWITCH-dev mailing list<br>
<a href="mailto:FreeSWITCH-dev@lists.freeswitch.org">FreeSWITCH-dev@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-dev</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-dev" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-dev</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>-Rupa<br>
</div>