<?xml version="1.0" encoding="UTF-8"?>


<!-- RSS generated by OracleBR - www.oraclebr.com.br - Thu, 07 Aug 2008 16:31:16 -0300 -->
<rss version="2.0" xmlns:blogChannel="http://backend.userland.com/blogChannelModule">
<channel>
<title>OracleBR</title>
<link>http://www.oraclebr.com.br/rss.php</link>
<description>Grupo OracleBR</description>
<language>pt-br</language>


		<item>
		<title>Arquivo - Build Forms C .pdf</title>
		<link>http://www.oraclebr.com.br/arquivo/baixar/BuildFormsC.pdf</link>
		<description>Build Forms C</description>
		<author>OracleBR</author>
		<pubDate>Tue, 13 Feb 2007 00:00:00 -0200</pubDate>
		<guid>http://www.oraclebr.com.br/arquivo/baixar/BuildFormsC.pdf</guid>
		</item>
		<item>
		<title>Arquivo - Build Forms B .pdf</title>
		<link>http://www.oraclebr.com.br/arquivo/baixar/BuildFormsB.pdf</link>
		<description>Build Forms B</description>
		<author>OracleBR</author>
		<pubDate>Tue, 13 Feb 2007 00:00:00 -0200</pubDate>
		<guid>http://www.oraclebr.com.br/arquivo/baixar/BuildFormsB.pdf</guid>
		</item>
		<item>
		<title>Arquivo - Build Forms A .pdf</title>
		<link>http://www.oraclebr.com.br/arquivo/baixar/BuildFormsA.pdf</link>
		<description>Build Forms A</description>
		<author>OracleBR</author>
		<pubDate>Tue, 13 Feb 2007 00:00:00 -0200</pubDate>
		<guid>http://www.oraclebr.com.br/arquivo/baixar/BuildFormsA.pdf</guid>
		</item>
		<item>
		<title>Arquivo - Reports.zip</title>
		<link>http://www.oraclebr.com.br/arquivo/baixar/Reports.zip</link>
		<description>Oracle Developer: Build Reports I,II</description>
		<author>OracleBR</author>
		<pubDate>Tue, 13 Feb 2007 00:00:00 -0200</pubDate>
		<guid>http://www.oraclebr.com.br/arquivo/baixar/Reports.zip</guid>
		</item>
		<item>
		<title>Arquivo - Tunning de Forms.pdf</title>
		<link>http://www.oraclebr.com.br/arquivo/baixar/TunningdeForms.pdf</link>
		<description>Tunning de Forms</description>
		<author>OracleBR</author>
		<pubDate>Tue, 13 Feb 2007 00:00:00 -0200</pubDate>
		<guid>http://www.oraclebr.com.br/arquivo/baixar/TunningdeForms.pdf</guid>
		</item>
		<item>
		<title>Arquivo - Oracle_9i.ppt</title>
		<link>http://www.oraclebr.com.br/arquivo/baixar/Oracle_9i.ppt</link>
		<description>Oracle_9i</description>
		<author>OracleBR</author>
		<pubDate>Tue, 13 Feb 2007 00:00:00 -0200</pubDate>
		<guid>http://www.oraclebr.com.br/arquivo/baixar/Oracle_9i.ppt</guid>
		</item>
		<item>
		<title>Arquivo - Diagrama_Arquitetura_Oracle.pdf</title>
		<link>http://www.oraclebr.com.br/arquivo/baixar/Diagrama_Arquitetura_Oracle.pdf</link>
		<description>Diagrama_Arquitetura_Oracle</description>
		<author>OracleBR</author>
		<pubDate>Tue, 13 Feb 2007 00:00:00 -0200</pubDate>
		<guid>http://www.oraclebr.com.br/arquivo/baixar/Diagrama_Arquitetura_Oracle.pdf</guid>
		</item>
		<item>
		<title>Arquivo - Backup and Recovery Worshop V1 e V2.zip</title>
		<link>http://www.oraclebr.com.br/arquivo/baixar/BackupandRecoveryWorshopParte1B-V2.zip</link>
		<description>Backup and Recovery Worshop</description>
		<author>OracleBR</author>
		<pubDate>Tue, 13 Feb 2007 00:00:00 -0200</pubDate>
		<guid>http://www.oraclebr.com.br/arquivo/baixar/BackupandRecoveryWorshopParte1B-V2.zip</guid>
		</item>
		<item>
		<title>Arquivo - Fundamentos de Datawarehouse V2.pdf</title>
		<link>http://www.oraclebr.com.br/arquivo/baixar/FundamentosdeDatawarehouseV2.pdf</link>
		<description>Fundamentos de Datawarehouse V2</description>
		<author>OracleBR</author>
		<pubDate>Tue, 13 Feb 2007 00:00:00 -0200</pubDate>
		<guid>http://www.oraclebr.com.br/arquivo/baixar/FundamentosdeDatawarehouseV2.pdf</guid>
		</item>
		<item>
		<title>Arquivo - Fundamentos de Datawarehouse V1.pdf</title>
		<link>http://www.oraclebr.com.br/arquivo/baixar/FundamentosdeDatawarehouseV1.pdf</link>
		<description>Fundamentos de Datawarehouse V1</description>
		<author>OracleBR</author>
		<pubDate>Tue, 13 Feb 2007 00:00:00 -0200</pubDate>
		<guid>http://www.oraclebr.com.br/arquivo/baixar/FundamentosdeDatawarehouseV1.pdf</guid>
		</item>
		<item>
		<title>Consultor Oracle - Financeira (Sênior)</title>
		<link>http://www.oraclebr.com.br/proposta/proposta.php?seq=506</link>
		<description>A HIT Rh Executive Search assessora uma das maiores empresas de TI do Brasil na busca de um profissional com os seguintes requisitos:<br />
<br />
- Formação Superior completa; <br />
- Experiência mínima de 5 anos na área; <br />
- Inglês nível Avançado.</description>
		<pubDate>Tue, 05 Aug 2008 00:00:00 -0300</pubDate>
		<author> - Hit Rh Executive Search &lt;contato@hitrh.com.br&gt;</author>
		<guid>http://www.oraclebr.com.br/proposta/proposta.php?seq=506</guid>
		</item>
		<item>
		<title>Vaga Consultor Oracle Manufatura (Sênior)</title>
		<link>http://www.oraclebr.com.br/proposta/proposta.php?seq=505</link>
		<description>A HIT Rh Executive Search assessora uma das maiores empresas de TI do Brasil na busca de um profissional com os seguintes requisitos:<br />
<br />
- Formação Superior completa; <br />
- Experiência mínima de 5 anos na área<br />
- Inglês nível Avançado. <br />
<br />
Interessados enviar curriculo atualizado para: contato@hitrh.com.br com pretensão salarial.</description>
		<pubDate>Tue, 05 Aug 2008 00:00:00 -0300</pubDate>
		<author> - Hit Rh Executive Search &lt;contato@hitrh.com.br&gt;</author>
		<guid>http://www.oraclebr.com.br/proposta/proposta.php?seq=505</guid>
		</item>
		<item>
		<title>VAGAS - DIVERSAS ORACLE - URGENTES!! - SP</title>
		<link>http://www.oraclebr.com.br/proposta/proposta.php?seq=504</link>
		<description>1)  Profissional com conhecimento em Oracle Transportation Sênior (inglês fluente) - projeto até final-do-ano;<br />
2)  Profissional com conhecimento em Oracle Manufacturing Sênior (inglês fluente) - projeto até final-do-ano;<br />
3)  Profissional ATG Sênior conhecimento Mastersaf/E-Comex (inglês fluente) - projeto até final-do-ano;<br />
4)  Profissional Financial Sênior (inglês fluente) - projeto até final-do-ano;<br />
5)  Tradutor de documentos Júnior/Pleno (com inglês fluente) - projeto até o final-do-ano.<br />
 <br />
Aos interessados, favor enviarem cv para sonia.prado@technologbr.com<br />
 <br />
Muito obrigada,<br />
 <br />
 <br />
Sonia Esteves Prado<br />
TECHNOLOG Soluções de Software<br />
Tel.: (11) 3237-2100/Cel.: (11) 9974-6340<br />
www.technologbr</description>
		<pubDate>Mon, 04 Aug 2008 00:00:00 -0300</pubDate>
		<author> - Sonia Esteves Prado &lt;sonia.prado@technologbr.com&gt;</author>
		<guid>http://www.oraclebr.com.br/proposta/proposta.php?seq=504</guid>
		</item>
		<item>
		<title>VAGAS - DIVERSAS ORACLE - URGENTES!! - SP</title>
		<link>http://www.oraclebr.com.br/proposta/proposta.php?seq=503</link>
		<description>1)  Profissional com conhecimento em Oracle Transportation Sênior (inglês fluente) - projeto até final-do-ano;<br />
2)  Profissional com conhecimento em Oracle Manufacturing Sênior (inglês fluente) - projeto até final-do-ano;<br />
3)  Profissional ATG Sênior conhecimento Mastersaf/E-Comex (inglês fluente) - projeto até final-do-ano;<br />
4)  Profissional Financial Sênior (inglês fluente) - projeto até final-do-ano;<br />
5)  Tradutor de documentos Júnior/Pleno (com inglês fluente) - projeto até o final-do-ano.<br />
 <br />
Aos interessados, favor enviarem cv para sonia.prado@technologbr.com<br />
 <br />
Muito obrigada,<br />
 <br />
 <br />
Sonia Esteves Prado<br />
TECHNOLOG Soluções de Software<br />
Tel.: (11) 3237-2100/Cel.: (11) 9974-6340<br />
www.technologbr.com</description>
		<pubDate>Fri, 01 Aug 2008 00:00:00 -0300</pubDate>
		<author> - Sonia Esteves Prado &lt;sonia.prado@technologbr.com&gt;</author>
		<guid>http://www.oraclebr.com.br/proposta/proposta.php?seq=503</guid>
		</item>
		<item>
		<title>VAGAS - DIVERSAS ORACLE - URGENTES!! - SP</title>
		<link>http://www.oraclebr.com.br/proposta/proposta.php?seq=502</link>
		<description>1)  Profissional com conhecimento em Oracle Transportation Sênior (inglês fluente) - projeto até final-do-ano;<br />
2)  Profissional com conhecimento em Oracle Manufacturing Sênior (inglês fluente) - projeto até final-do-ano;<br />
3)  Profissional ATG Sênior conhecimento Mastersaf/E-Comex (inglês fluente) - projeto até final-do-ano;<br />
4)  Profissional Financial Sênior (inglês fluente) - projeto até final-do-ano;<br />
5)  Tradutor de documentos Júnior/Pleno (com inglês fluente) - projeto até o final-do-ano.<br />
 <br />
Aos interessados, favor enviarem cv para sonia.prado@technologbr.com<br />
 <br />
Muito obrigada,<br />
 <br />
 <br />
Sonia Esteves Prado<br />
TECHNOLOG Soluções de Software<br />
Tel.: (11) 3237-2100/Cel.: (11) 9974-6340<br />
www.technologbr.com</description>
		<pubDate>Fri, 01 Aug 2008 00:00:00 -0300</pubDate>
		<author> - Sonia Esteves Prado &lt;sonia.prado@technologbr.com&gt;</author>
		<guid>http://www.oraclebr.com.br/proposta/proposta.php?seq=502</guid>
		</item>
		<item>
		<title>Analista Programador</title>
		<link>http://www.oraclebr.com.br/proposta/proposta.php?seq=501</link>
		<description>Profissional atuará na manutenção do sistema de SPB.<br />
<br />
INDISPENSÁVEL: Experiência no desenvolvimento Visual Basic 6.0, ASP 3.0 e banco dados SQL Server;<br />
Conhecimento do funcionamento do SPB.<br />
<br />
Atuação em São Caetano do Sul.</description>
		<pubDate>Mon, 28 Jul 2008 00:00:00 -0300</pubDate>
		<author> - Gabrielli &lt;rh@crk.com.br&gt;</author>
		<guid>http://www.oraclebr.com.br/proposta/proposta.php?seq=501</guid>
		</item>
		<item>
		<title>Analista Programador Senior - Progress</title>
		<link>http://www.oraclebr.com.br/proposta/proposta.php?seq=500</link>
		<description>Profissional atuará com análise e programação em 4GL Progress. <br />
<br />
INDISPENSÁVEL: Experiência em 4GL Progress Gráfico, Banco de Dados SQL e ORACLE. <br />
<br />
DESEJÁVEL: PL/SQL, Matemática Financeira, Componentização e Experiência no Mercado Financeiro.<br />
<br />
Atuação em São Caetano do Sul.</description>
		<pubDate>Mon, 28 Jul 2008 00:00:00 -0300</pubDate>
		<author> - Gabrielli &lt;rh@crk.com.br&gt;</author>
		<guid>http://www.oraclebr.com.br/proposta/proposta.php?seq=500</guid>
		</item>
		<item>
		<title>Analista Programador Pl. - C#</title>
		<link>http://www.oraclebr.com.br/proposta/proposta.php?seq=499</link>
		<description>Buscamos profissional, que saiba lidar bem com ambiente de estresse, com perfil mais voltado ao desenvolvimento de sistemas web, sendo desejável certa experiência com documentações técnicas e planos de testes, tanto integrado como unitário. Atuará no desenvolvimento de Aplicação Web - Asp.NET utilizando C#, Banco de Dados SQL Server 2000, WebServices e COM+. <br />
<br />
INDISPENSÁVEL: Sólidos conhecimentos em .NET (C#); SQL Server (Transact SQL); Possuir perfil de desenvolvedor como primeira opção dentre suas proficiências. <br />
<br />
DESEJÁVEL: Experiência com especificações técnicas e ter Inglês intermediário.<br />
<br />
Atuação na região da Faria Lima.</description>
		<pubDate>Mon, 28 Jul 2008 00:00:00 -0300</pubDate>
		<author> - Gabrielli &lt;rh@crk.com.br&gt;</author>
		<guid>http://www.oraclebr.com.br/proposta/proposta.php?seq=499</guid>
		</item>
		<item>
		<title>Analista Programador Pleno - VB, ASP, SQL</title>
		<link>http://www.oraclebr.com.br/proposta/proposta.php?seq=498</link>
		<description>Profissional atuará no desenvolvimento e manutenção do sistema de Cartões de Crédito.<br />
<br />
INDISPENSÁVEL: Experiência no desenvolvimento Visual Basic 6.0, ASP 3.0 e banco dados SQL Server; Conhecimento de DOT NET.<br />
<br />
Atuação na região da Av. Paulista.</description>
		<pubDate>Mon, 28 Jul 2008 00:00:00 -0300</pubDate>
		<author> - Gabrielli &lt;rh@crk.com.br&gt;</author>
		<guid>http://www.oraclebr.com.br/proposta/proposta.php?seq=498</guid>
		</item>
		<item>
		<title>Oportunidades</title>
		<link>http://www.oraclebr.com.br/proposta/proposta.php?seq=497</link>
		<description>Estamos com algumas oportunidades de trabalho numa empresa de Telcom no <br />
Rio de Janeiro. Segue o perfil abaixo:<br />
<br />
 Cargo: Analista Desenvolvedor Java(J2EE)<br />
 Vagas: 15 Vagas<br />
<br />
 Cargo: Analista de Teste(Qualidade)<br />
 Vagas: 10 Vagas<br />
<br />
 Cargo: Analista de Performance(LoadRunner)<br />
 Vagas: 2 Vagas<br />
<br />
 Cargo: Analista de Teste Siebel(Qualidade)<br />
 Vagas: 5 Vagas<br />
<br />
 Cargo: Analista de Teste Arbor(Qualidade)<br />
 Vagas: 4 Vagas<br />
<br />
 Cargo: Analista de Teste SAP(Qualidade)<br />
 Vagas: 3 Vagas<br />
<br />
 Cargo: Analista Desenvolvedor JScript<br />
 Vagas: 4 Vagas<br />
<br />
 Cargo: Analista Desenvolvedor PLSql(Migração Oracle)<br />
 Vagas: 6 Vagas<br />
<br />
 Cargo: Analista Desenvolvedor Siebel(CRM)<br />
 Vagas: 4 Vagas<br />
<br />
 Cargo: Analista Desenvolvedor Arbor(Billing)<br />
 Vagas: 4 Vagas<br />
<br />
 Cargo: Analista Desenvolvedor Vitria(EAI)<br />
 Vagas: 2 Vagas<br />
<br />
 Cargo: Analista Desenvolvedor C#(CSharp)<br />
 Vagas: 6 Vagas<br />
<br />
 Cargo: Analista Desenvolvedor C (ansi)<br />
 Vagas: 5 Vagas<br />
<br />
 Cargo: Analista Desenvolvedor VB(DotNet)<br />
 Vagas: 2 Vagas<br />
<br />
 Cargo: Analista Desenvolvedor Teradata(DW)<br />
 Vagas: 2 Vagas<br />
<br />
Todas as Vagas segue ao formato abaixo:<br />
 Contratação:  Pessoa Jurídica.<br />
 Taxa: À Combinar.<br />
 Experiência: Mais de 6 meses.<br />
 Duração: Indeterminado.<br />
<br />
Aos interessados que se enquadrem no perfil, enviem as informações<br />
abaixo para o endereço rh@ecase.com.br mencionando no assunto o<br />
cargo pretendido :<br />
 - CV Atualizado;<br />
 - Valor Horas Atual;<br />
 - Disponibilidade;<br />
 - Area pretendida(Mencione a Area no "Assunto" do Email).</description>
		<pubDate>Fri, 25 Jul 2008 00:00:00 -0300</pubDate>
		<author> - Flavio Sergio Da Silva &lt;rh@ecase.com.br&gt;</author>
		<guid>http://www.oraclebr.com.br/proposta/proposta.php?seq=497</guid>
		</item>
		<item>
		<title>WorkShop Abap SAP em Campinas e Sorocaba</title>
		<link>http://www.oraclebr.com.br/proposta/proposta.php?seq=492</link>
		<description>WorkShop Abap SAP em Campinas e Sorocaba. Turmas de Agosto.Confira  abilita_tecn... <br />
 Offline <br />
 Enviar mensagem <br />
 Opções de associação  <br />
<br />
Olá, Grupo.<br />
<br />
A Abilità Tecnologia iniciará novas turmas de Abap SAP, sendo :<br />
<br />
- Sorocaba inicio 02/08 realizado aos Sábados das 09:00 às 18:00,<br />
(total 05 Sábados).<br />
<br />
- Campinas inicio 09/08 realizado aos Sábados das 09:00 às 18:00,<br />
(total 05 Sábados).<br />
<br />
O WorkShop Abap da Abilità conta com 40 horas de duração sendo<br />
totalmente apostilado (apostilas próprias em português), instrutor<br />
Abap Sênior certificado SAP com mais de 8 anos de mercado.<br />
<br />
O aluno alem do material didático (apostilas, DVD com o mini SAP),<br />
conta ainda com o apoio e orientação do Grupos da Abilità na sua<br />
alocação, neste grupo ele poderá manter-se informado sobre todas as<br />
vagas disponíveis no mercado.<br />
<br />
Vagas limitadas (somente 10 alunos por turma).<br />
<br />
Já estamos realizando inscrições !!!!!<br />
<br />
Participantes do Grupo desconto de 10 %<br />
<br />
Entre em contato para tirar suas dúvidas e obter maiores<br />
informações:<br />
<br />
e-mail: luciana.alves@abilitatecnologia.com.br<br />
msn: luciana_palomares@hotmail.com<br />
Tel: (15) 3234-6805.<br />
<br />
Obrigada.</description>
		<author> - Moderador Oracle_br (moderador@oraclebr.com.br)</author>
		<pubDate>Tue, 15 Jul 2008 00:00:00 -0300</pubDate>
		<guid>http://www.oraclebr.com.br/proposta/proposta.php?seq=492</guid>
		</item>
		<item>
		<title>Eliminando sessões Inativas no bd Oracle</title>
		<link>http://www.oraclebr.com.br/artigo/artigo.php?seq=1</link>
		<description>Muitas vezes é necessário a eliminação "forçada" de sessões inativas num bd Oracle (normalmente porque o operador encerrou o seu trabalho mas não desconectou, deixando erradamente a tale do aplicativo aberta, ainda conectada.<br />
<br />
Pensando em conexão dedicada e banco 9i ou superior, que são o caso mais comum, essa eliminação seria feita num job que periodicamente, seja via comandos ALTER SYSTEM DISCONNECT 'sid, serial' IMMEDIATE; , ou até mais diretamente eliminando-se o processo shadow dessa conexão diretamente no servidor. <br />
<br />
Há porém um ponto a considerar, qual seja : no bd Oracle quando vc elimina uma sessão ela NÃO é removida até que expire OU que o usuário tente fazer um novo acesso ao banco, quando aí sim receberá uma mensagem "vc foi desconectado" e só então efetivamente será desconectado e a respectiva sessão eliminada - se quisermos que a sessão seja removida antes mesmo que o usuário tente fazer novo acesso ao banco, poderíamos utilizar um PROFILE, cfrme : <br />
<br />
system@BDDEV:SQL>show parameters resource_limit<br />
<br />
NAME TYPE VALUE<br />
------------------------------------ -----------<br />
------------------------------<br />
resource_limit boolean TRUE<br />
<br />
system@BDDEV:SQL>create profile prof_idle_2_minutos limit idle_time 120;<br />
<br />
Perfil criado.<br />
<br />
<br />
system@BDDEV:SQL>alter user scott profile prof_idle_2_minutos;<br />
<br />
Usuário alterado.<br />
<br />
==> aí conecto no usuário SCOTT. Veja que enquanto a sessão não está fazendo<br />
NADA mas está conectada o idle_time não atua :<br />
<br />
scott@BDDEV:SQL>select sysdate from dual;<br />
<br />
SYSDATE<br />
-------------------<br />
04/07/2006 09:47:41<br />
<br />
... não estou fazendo nada , espero uns minutos e volto à sessão, tento fazer<br />
outro acesso ao banco, vai ok :<br />
<br />
scott@BDDEV:SQL>/<br />
<br />
SYSDATE<br />
-------------------<br />
04/07/2006 09:50:18<br />
<br />
==> agora vem o teste: vou fazer uma QUERY "grande" e demorada (*** NÃO *** é<br />
DML, pois no caso de DMLs há que se remover locks, fazer rollback, isso é MESMO<br />
demorado) :<br />
<br />
scott@BDDEV:SQL>select * from all_tab_columns;<br />
... executando ...<br />
<br />
==> aí consulto a situação na v$session, está lá, está ativa, normal :<br />
<br />
..... SID SERIAL# ... STATUS SERVER ...<br />
---- ------- -------- --------- <br />
20 34889 ACTIVE DEDICATED <br />
<br />
system@BDDEV:SQL>alter system disconnect session '20, 34889' immediate;<br />
<br />
==> imediatamente a sessão foi marcada como KILLED<br />
<br />
system@BDDEV:SQL>select * from v$session where username='SCOTT';<br />
<br />
..... SID SERIAL# ... STATUS SERVER ...<br />
..... ---- ------- ... -------- --------- <br />
..... 20 34889 ... KILLED PSEUDO <br />
<br />
==> espero um pouco pra dar o tempo de inatividade...<br />
<br />
system@BDDEV:SQL>/<br />
<br />
não há linhas selecionadas<br />
<br />
==> e senm ter feito nada, na sessão que "morreu" eu obtenho :<br />
<br />
SYS EXU8NXPU NAME <br />
SYS EXU9TABU DOBJID <br />
ERROR:<br />
ORA-00028: your session has been killed<br />
<br />
e realmente a sessão foi eliminada, se tentar um acesso ao banco :<br />
<br />
scott@BDDEV:SQL>select 1 from dual;<br />
select 1 from dual<br />
*<br />
ERRO na linha 1:<br />
ORA-01012: not logged on<br />
<br />
<br />
Abraços,<br />
<br />
Chiappa<br />
<br />
<br />
</description>
		<author> - José Laurindo Chiappa (jlchiappa@yahoo.com.br)</author>
		<pubDate>Wed, 30 Aug 2006 00:00:00 -0300</pubDate>
		<guid>http://www.oraclebr.com.br/artigo/artigo.php?seq=1</guid>
		</item>
		<item>
		<title> - Mundo Oracle</title>
		<link>http://www.oraclebr.com.br/codigo/codigo.php?seq=37</link>
		<description></description>
		<author> - Mario Jorge Paula (mariojpaula@yahoo.com.br)</author>
		<pubDate>Wed, 01 Aug 2007 00:00:00 -0300</pubDate>
		<guid>http://www.oraclebr.com.br/codigo/codigo.php?seq=37</guid>
		</item>
		<item>
		<title>SQLPlus e AutoCommit - Chiappa - Dicas e Exemplos</title>
		<link>http://www.oraclebr.com.br/codigo/codigo.php?seq=36</link>
		<description>Mensagem circulada no grupo em 13/03/2007<br />
--------------------------------------------------<br />
<br />
Não, Renato, vc está absolutamente enganado, o comportamento de <br />
comitar quando sai normalmente do sqlplus com uma transação pendente <br />
** não é ** controlado pelo AUTOCOMMIT, o que o AUTOCOMMIT faz é <br />
mandar um commit automático após cada comando, é OUTRA coisa. O <br />
manual do sqlplus já nos diz :<br />
<br />
"SET AUTO[COMMIT]{ON|OFF|IMM[EDIATE]|n}<br />
Controls when Oracle commits pending changes to the database. ON <br />
commits pending changes to the database after Oracle executes each <br />
successful INSERT, UPDATE, or DELETE command or PL/SQL block. OFF <br />
suppresses automatic committing so that you must commit changes <br />
manually (for example, with the SQL command COMMIT). "<br />
<br />
exemplo :<br />
<br />
D:\>sqlplus scott/tiger@bddev<br />
<br />
Conectado a:<br />
Oracle9i Enterprise Edition Release 9.2.0.5.0 - 64bit Production<br />
With the Partitioning option<br />
JServer Release 9.2.0.5.0 - Production<br />
<br />
scott@bddev:SQL>set autocommit OFF<br />
scott@bddev:SQL>insert into dept values(33, 'dep33', null);<br />
<br />
1 linha criada.<br />
<br />
==> vou sair graciosamente, ie, NÂO VOU abortar o programa, nem usar <br />
o botão de "x" pra fechar a janela ...<br />
<br />
scott@bddev:SQL>exit<br />
Desconectado de Oracle9i Enterprise Edition Release 9.2.0.5.0 - 64bit <br />
Production<br />
<br />
With the Partitioning option<br />
JServer Release 9.2.0.5.0 - Production<br />
<br />
==> agora entro de novo ...<br />
<br />
D:\>sqlplus scott/tiger@bddev<br />
<br />
Conectado a:<br />
Oracle9i Enterprise Edition Release 9.2.0.5.0 - 64bit Production<br />
With the Partitioning option<br />
JServer Release 9.2.0.5.0 - Production<br />
<br />
scott@bddev:SQL>select * from dept;<br />
<br />
DEPTNO DNAME LOC<br />
------------------ -------------- -------------<br />
10 ACCOUNTING NEW YORK<br />
20 RESEARCH DALLAS<br />
30 SALES CHICAGO<br />
40 OPERATIONS BOSTON<br />
41 Depto ~<br />
33 dep33<br />
<br />
6 linhas selecionadas.<br />
<br />
scott@bddev:SQL><br />
<br />
===> ** OLHA LÁ A ALTERAÇÂO COMITADA, MESMO COM O AUTOCOMMIT <br />
OFF !!!!! ** NADA A VER, portanto, a sua suposição, o comportamento <br />
de comitar quando vc sai graciosamente da sessão plus é ** programado <br />
nele **, é interno, ok ?? Exemplo da atuação do AUTOCOMMIT ON :<br />
<br />
scott@bddev:SQL>set autocommit on<br />
scott@bddev:SQL>insert into dept values (34, 'dep 34', null);<br />
<br />
1 linha criada.<br />
<br />
Commit concluÝdo.<br />
<br />
==> viu acima ??? Automaticamente ele mandou um COMMIT após o meu <br />
DML, vamos ver que é verdade :<br />
<br />
scott@bddev:SQL>rollback;<br />
<br />
Rollback completo.<br />
<br />
scott@bddev:SQL>select * from dept;<br />
<br />
DEPTNO DNAME LOC<br />
------------------ -------------- -------------<br />
10 ACCOUNTING NEW YORK<br />
20 RESEARCH DALLAS<br />
30 SALES CHICAGO<br />
40 OPERATIONS BOSTON<br />
34 dep 34<br />
41 Depto ~<br />
33 dep33<br />
<br />
7 linhas selecionadas.<br />
<br />
Assim Alessandro, vc NÂO TEM problema algum, é o jeito que a <br />
ferramenta funciona, é característica NATIVA, certo ?? Só <br />
complementando, Alessandro, no Forms o comportamento nativo quando vc <br />
sai graciosamente com transação pendente é exibir uma janela "Do you <br />
want to save ? [yes] [no]' , SE a sua aplicação não está fazendo isso <br />
com absoluta certeza tem SIM alguma customização nela...<br />
<br />
[]s<br />
<br />
Chiappa<br />
</description>
		<author> - Moderador Oracle_br (moderador@oraclebr.com.br)</author>
		<pubDate>Fri, 16 Mar 2007 00:00:00 -0300</pubDate>
		<guid>http://www.oraclebr.com.br/codigo/codigo.php?seq=36</guid>
		</item>
		<item>
		<title>Stored Procedures In Oracle - Dicas e Exemplos</title>
		<link>http://www.oraclebr.com.br/codigo/codigo.php?seq=35</link>
		<description>Result Sets from Stored Procedures In Oracle A frequently asked question is: <br />
<br />
I'd like to know whether ORACLE supports procedures (functions) which returns result sets. <br />
<br />
The answer is most definitely yes.  In short, it'll look like this for a function: <br />
  <br />
create or replace function sp_ListEmp return types.cursortype <br />
as <br />
    l_cursor    types.cursorType; <br />
begin <br />
    open l_cursor for select ename, empno from emp order by ename; <br />
    return l_cursor; <br />
end; <br />
/<br />
<br />
Or like this for a procedure:<br />
<br />
 <br />
<br />
create or replace procedure getemps( p_cursor in out types.cursorType )<br />
<br />
as<br />
<br />
begin<br />
<br />
      open p_cursor for select ename, empno from emp order by ename;<br />
<br />
end;<br />
<br />
With 7.2 on up of the database you have cursor variables.  Cursor variables are cursors opened by a pl/sql routine and fetched from by another application or pl/sql routine (in 7.3 pl/sql routines can fetch from cursor variables as well as open them). The cursor variables are opened with the privelegs of the owner of the procedure and behave just like they were completely contained within the pl/sql routine. It uses the inputs to decide what database it will run a query on. <br />
<br />
Here is an example: <br />
  <br />
<br />
create or replace package types <br />
as <br />
    type cursorType is ref cursor; <br />
end; <br />
/ <br />
<br />
create or replace function sp_ListEmp return types.cursortype <br />
as <br />
    l_cursor    types.cursorType; <br />
begin <br />
    open l_cursor for select ename, empno from emp order by ename; <br />
<br />
    return l_cursor; <br />
end; <br />
/<br />
create or replace procedure getemps( p_cursor in out types.cursorType )<br />
<br />
as<br />
<br />
begin<br />
<br />
      open p_cursor for select ename, empno from emp order by ename;<br />
<br />
end;<br />
<br />
/<br />
<br />
 <br />
<br />
examples for SQLPlus, Pro*C, Java/JDBC, ODBC, ADO/ASP, DBI Perl and OCI follow: <br />
<br />
REM SQL*Plus commands to use a cursor variable <br />
<br />
variable c refcursor <br />
exec :c := sp_ListEmp <br />
print c<br />
<br />
exec getEmps( :c )<br />
<br />
print c<br />
<br />
<br />
and the Pro*C to use this would look like: <br />
<br />
static void process() <br />
{ <br />
EXEC SQL BEGIN DECLARE SECTION; <br />
    SQL_CURSOR  my_cursor; <br />
    VARCHAR     ename[40]; <br />
    int         empno; <br />
EXEC SQL END DECLARE SECTION; <br />
<br />
    EXEC SQL WHENEVER SQLERROR DO sqlerror_hard(); <br />
<br />
    EXEC SQL ALLOCATE :my_cursor; <br />
<br />
    EXEC SQL EXECUTE BEGIN <br />
        :my_cursor := sp_listEmp; <br />
    END; END-EXEC; <br />
<br />
    for( ;; ) <br />
    { <br />
        EXEC SQL WHENEVER NOTFOUND DO break; <br />
        EXEC SQL FETCH :my_cursor INTO :ename, empno; <br />
<br />
        printf( "'%.*s', %d\n", ename.len, ename.arr, empno ); <br />
    } <br />
    EXEC SQL CLOSE :my_cursor; <br />
}<br />
<br />
And the java to use this could be: <br />
  <br />
<br />
import java.sql.*; <br />
import java.io.*; <br />
import oracle.jdbc.driver.*; <br />
  <br />
<br />
class curvar <br />
{ <br />
  public static void main (String args []) <br />
                     throws SQLException, ClassNotFoundException <br />
  { <br />
      String driver_class = "oracle.jdbc.driver.OracleDriver"; <br />
      String connect_string = "jdbc:oracle:thin:@slackdog:1521:oracle8"; <br />
<br />
      String query = "begin :1 := sp_listEmp; end;"; <br />
      Connection conn; <br />
<br />
      Class.forName(driver_class); <br />
      conn = DriverManager.getConnection(connect_string, "scott", "tiger"); <br />
<br />
      CallableStatement cstmt = conn.prepareCall(query); <br />
      cstmt.registerOutParameter(1,OracleTypes.CURSOR); <br />
      cstmt.execute(); <br />
      ResultSet rset = (ResultSet)cstmt.getObject(1); <br />
<br />
      while (rset.next ()) <br />
        System.out.println( rset.getString (1) ); <br />
      cstmt.close(); <br />
  } <br />
}<br />
<br />
<br />
  <br />
<br />
The following is thanks to marktoml@hotmail.com (mark tomlinson).. <br />
  <br />
<br />
If you use ODBC here is a working example, but it requires the use of the <br />
8.0.5.2.0 or later Oracle ODBC driver, and an 8.0.5 server. <br />
<br />
' <br />
' 1) Create a form with 1 Text control (Text1) and 1 List Control (List1) and <br />
'    1 Button (btnExecute). <br />
' 2) The only code that you need is a Click method on your button. Here is the Code. <br />
' <br />
' <br />
Private Sub btnExecute_Click() <br />
'PL/SQL Code <br />
'=========== <br />
' <br />
'CREATE OR REPLACE package reftest as <br />
' cursor c1 is select ename from emp; <br />
' type empCur is ref cursor return c1%ROWTYPE; <br />
' Procedure GetEmpData(en in varchar2,EmpCursor in out empCur); <br />
'END; <br />
' <br />
' <br />
'CREATE OR REPLACE package body reftest as <br />
'   Procedure GetEmpData <br />
'(en in varchar2,EmpCursor in out empCur) is <br />
'begin <br />
' open EmpCursor for select ename from emp where ename LIKE en; <br />
'end; <br />
'end; <br />
' <br />
     Dim cn As New rdoConnection <br />
     Dim qd As rdoQuery <br />
     Dim rs As rdoResultset <br />
     Dim cl As rdoColumn <br />
     Static Number As Integer <br />
<br />
     List1.Clear <br />
     Number = 0 <br />
     cn.Connect = "uid=scott; pwd=tiger; DSN=MSLANGORL;" <br />
     'enable the MS Cursor library <br />
     cn.CursorDriver = rdUseOdbc <br />
     'Make the connection <br />
     cn.EstablishConnection rdNoDriverPrompt <br />
<br />
     sSQL = "{call RefTest.GetEmpData(?,?)}" <br />
<br />
     Set qd = cn.CreateQuery("", sSQL) <br />
<br />
     qd.rdoParameters(0).Type = rdTypeVARCHAR <br />
     qd(0).Direction = rdParamInputOutput <br />
     qd(0).Value = Text1.Text <br />
     qd.rdoParameters(1).Type = rdTypeVARCHAR <br />
<br />
     'Dynamic or Keyset is meaningless here <br />
     Set rs = qd.OpenResultset(rdOpenStatic) <br />
<br />
     Do <br />
        Debug.Print <br />
        Debug.Print <br />
<br />
        Do Until rs.EOF <br />
            For Each cl In rs.rdoColumns <br />
                 If IsNull(cl.Value) Then <br />
                    List1.AddItem "(null)" <br />
                    ' Debug.Print " "; cl.Name; "NULL"; Error trap for <br />
null fields <br />
                Else <br />
                    List1.AddItem cl.Value <br />
                    ' Debug.Print " "; cl.Name; " "; cl.Value; <br />
                End If <br />
            Next <br />
            Debug.Print <br />
            rs.MoveNext <br />
        Loop <br />
     Loop While rs.MoreResults <br />
     cn.Close <br />
<br />
End Sub<br />
<br />
<br />
  And now, for a full ASP example (thanks to Jim Hoien and John Durst ) <br />
 <br />
--<br />
ASP CODE<br />
--<br />
 <br />
        ' This demonstration draws heavily from the information contained in the article at<br />
        ' <a href="http://govt.us.oracle.com/~tkyte/ResultSets/index.html">http://govt.us.oracle.com/~tkyte/ResultSets/index.html</a><br />
        ' with special attention to the details provided by Mark Tomlinson.<br />
        ' Make sure you have the correct Oracle ODBC driver so it will support Ref Cursors.<br />
        '<br />
        '<br />
        ' This demonstration was a joint project by Jim Hoien (jhoien@yahoo.com) and John Durst (jpdurst@yahoo.com)<br />
        '<br />
        ' These are the statements used on the Oracle server:<br />
        '<br />
        ' /*******************************************************************************************/<br />
        ' /* Create the EMP demo table and populate. (extracted from Oracle's provided demobld.sql)  */<br />
        ' /*******************************************************************************************/<br />
        '<br />
        ' CREATE TABLE EMP<br />
        '        (EMPNO NUMBER(4) NOT NULL,<br />
        '         ENAME VARCHAR2(10),<br />
        '         JOB VARCHAR2(9),<br />
        '         MGR NUMBER(4),<br />
        '         HIREDATE DATE,<br />
        '         SAL NUMBER(7,2),<br />
        '         COMM NUMBER(7,2),<br />
        '         DEPTNO NUMBER(2));<br />
        ' <br />
        ' INSERT INTO EMP VALUES<br />
        '         (7369,'SMITH','CLERK',7902,'17-DEC-80',800,NULL,20);<br />
        ' INSERT INTO EMP VALUES<br />
        '         (7499,'ALLEN','SALESMAN',7698,'20-FEB-81',1600,300,30);<br />
        ' INSERT INTO EMP VALUES<br />
        '         (7521,'WARD','SALESMAN',7698,'22-FEB-81',1250,500,30);<br />
        ' INSERT INTO EMP VALUES<br />
        '         (7566,'JONES','MANAGER',7839,'2-APR-81',2975,NULL,20);<br />
        ' INSERT INTO EMP VALUES<br />
        '         (7654,'MARTIN','SALESMAN',7698,'28-SEP-81',1250,1400,30);<br />
        ' INSERT INTO EMP VALUES<br />
        '         (7698,'BLAKE','MANAGER',7839,'1-MAY-81',2850,NULL,30);<br />
        ' INSERT INTO EMP VALUES<br />
        '         (7782,'CLARK','MANAGER',7839,'9-JUN-81',2450,NULL,10);<br />
        ' INSERT INTO EMP VALUES<br />
        '         (7788,'SCOTT','ANALYST',7566,'09-DEC-82',3000,NULL,20);<br />
        ' INSERT INTO EMP VALUES<br />
        '         (7839,'KING','PRESIDENT',NULL,'17-NOV-81',5000,NULL,10);<br />
        ' INSERT INTO EMP VALUES<br />
        '         (7844,'TURNER','SALESMAN',7698,'8-SEP-81',1500,0,30);<br />
        ' INSERT INTO EMP VALUES<br />
        '         (7876,'ADAMS','CLERK',7788,'12-JAN-83',1100,NULL,20);<br />
        ' INSERT INTO EMP VALUES<br />
        '         (7900,'JAMES','CLERK',7698,'3-DEC-81',950,NULL,30);<br />
        ' INSERT INTO EMP VALUES<br />
        '         (7902,'FORD','ANALYST',7566,'3-DEC-81',3000,NULL,20);<br />
        ' INSERT INTO EMP VALUES<br />
        '         (7934,'MILLER','CLERK',7782,'23-JAN-82',1300,NULL,10);<br />
        '<br />
        ' /*******************************************************************************************/<br />
        ' /* Create a packaged procedure that accepts a department number and returns the employees. */<br />
        ' /*     [Note: A standalone procedure will not work, it must be a packaged procedure!]      */<br />
        ' /*******************************************************************************************/<br />
        ' <br />
        ' CREATE OR REPLACE<br />
        ' PACKAGE DEPARTMENT AS<br />
        '   TYPE  CURSOR_TYPE IS REF CURSOR;<br />
        '   PROCEDURE GET_EMPS (I_DEPTNO     IN  NUMBER,<br />
        '                       O_RESULT_SET OUT CURSOR_TYPE);<br />
        ' END;<br />
        ' /<br />
        ' CREATE OR REPLACE<br />
        ' PACKAGE BODY DEPARTMENT AS<br />
        '   PROCEDURE GET_EMPS (I_DEPTNO     IN  NUMBER,<br />
        '                       O_RESULT_SET OUT CURSOR_TYPE)<br />
        '   AS<br />
        '   BEGIN<br />
        '     OPEN O_RESULT_SET FOR<br />
        '     SELECT EMPNO, ENAME<br />
        '     FROM EMP<br />
        '     WHERE DEPTNO = I_DEPTNO;<br />
        '   END;<br />
        ' END;<br />
        ' /<br />
 <br />
--<br />
END ASP CODE<br />
--<br />
 <br />
<HTML><br />
<HEAD><br />
        <TITLE>Oracle ADO Test</TITLE><br />
</HEAD><br />
<BODY><br />
 <br />
<H2>Test of ADO and Oracle Stored Procedures using Ref Cursors</H2><br />
 <br />
--<br />
ASP CODE<br />
--<br />
 <br />
        Dim objConn<br />
        Dim connString<br />
        Dim cmdStoredProc<br />
        Dim param1<br />
        Dim testDeptNo<br />
        <br />
 <br />
        testDeptNo = 10<br />
'       testDeptNo = 20<br />
'       testDeptNo = 30<br />
        <br />
                       <br />
        set objConn = server.createobject("adodb.connection")<br />
        <br />
        ' System DSN connection<br />
        ' Replace the values below with your own<br />
        connString = "DSN=<YourDSN>;UID=<YourUserName>;PWD=<YourPassword>"<br />
        <br />
        objConn.Open connString<br />
 <br />
        Set cmdStoredProc = Server.CreateObject ("ADODB.Command")<br />
        Set cmdStoredProc.ActiveConnection = objConn<br />
        cmdStoredProc.CommandText = "Department.Get_Emps"<br />
        cmdStoredProc.CommandType = adCmdStoredProc<br />
               <br />
        Set param1 = cmdStoredProc.CreateParameter ("Dept_ID", adInteger, adParamInput)<br />
        cmdStoredProc.Parameters.Append param1<br />
        param1.Value = testDeptNo<br />
 <br />
        Set rs = cmdStoredProc.Execute<br />
 <br />
        Response.Write ("<h3>Employees in Department # " & testDeptNo & "</h3>" & vbCrLf)<br />
        Response.Write ("<p>" & vbCrLf)<br />
 <br />
        Response.Write ("<table>" & vbCrLf)<br />
        Response.Write ("      <tr>" & vbCrLf)<br />
        Response.Write ("              <th>Emp #</th>" & vbCrLf)<br />
        Response.Write ("              <th>Name</th>" & vbCrLf)<br />
        Response.Write ("      </tr>" & vbCrLf)<br />
 <br />
        While (Not rs.EOF)<br />
               Response.Write ("      <tr>" & vbCrLf)<br />
               Response.Write ("              <td>" & rs (0) & "</td>" & vbCrLf)<br />
               Response.Write ("              <td>" & rs (1) & "</td>" & vbCrLf)<br />
               Response.Write ("      </tr>" & vbCrLf)<br />
               <br />
               rs.MoveNext<br />
        Wend<br />
 <br />
        Response.Write ("</table>" & vbCrLf)<br />
 <br />
        rs.Close<br />
        <br />
        objConn.Close<br />
                       <br />
        Set rs = nothing<br />
 <br />
        Set param1 = nothing<br />
 <br />
        Set cmdStoredProc = nothing<br />
 <br />
        Set objConn = nothing<br />
 <br />
--<br />
END ASP CODE<br />
--<br />
 <br />
</BODY><br />
</HTML><br />
And the following is thanks to Brett Rosen : <br />
<br />
 <br />
I noticed that you didn't have an OCI entry<br />
on <a href="http://osi.oracle.com/~tkyte/ResultSets/index.html">http://osi.oracle.com/~tkyte/ResultSets/index.html</a> .<br />
 <br />
Here is OCI code to do this (Oracle 81) if you want to include it on<br />
that page.<br />
Some error checking and cleanup has been removed, but the below should<br />
work. (once dbname has been replaced appropriately)<br />
 <br />
    Brett<br />
 <br />
int main(int argc, char* argv[])<br />
{<br />
        OCIError*           pOciError;<br />
        char*                   pConnectChar    = "dbname";<br />
        char*                   pUsernameChar   = "scott";<br />
        char*                   pPasswordChar   = "tiger";<br />
        int                       answer;<br />
        OCIStmt*           pOciStatement;<br />
        char*                  sqlCharArray = "BEGIN :success := sp_ListEmp; END;";<br />
        int                       id;<br />
        char                    ename[40];<br />
        OCIEnv*            g_pOciEnvironment = NULL;<br />
        OCIServer*        g_pOciServer = NULL;<br />
        OCISession*       g_pOciSession = NULL;<br />
        OCISvcCtx*       g_pOciServiceContext = NULL;<br />
        sb2*                    pIndicator=0;<br />
        sb2*                    pIndicator2=0;<br />
        sb2*                    pIndicator3=0;<br />
        OCIDefine*         pOciDefine;<br />
        OCIDefine*         pOciDefine2;<br />
        OCIBind*            pBind;<br />
        OCIStmt*            cursor;<br />
 <br />
 <br />
        answer = OCIInitialize(OCI_THREADED, NULL, NULL, NULL, NULL);<br />
        answer = OCIEnvInit(&g_pOciEnvironment, OCI_DEFAULT, 0, NULL);<br />
        answer = OCIHandleAlloc(g_pOciEnvironment, (void **)&pOciError, OCI_HTYPE_ERROR, 0, NULL);<br />
        answer = OCIHandleAlloc(g_pOciEnvironment, (void **)&g_pOciSession, OCI_HTYPE_SESSION, 0, NULL);<br />
        answer = OCIHandleAlloc(g_pOciEnvironment, (void **)&g_pOciServer, OCI_HTYPE_SERVER, 0, NULL);<br />
        answer = OCIHandleAlloc(g_pOciEnvironment, (void **)&g_pOciServiceContext, OCI_HTYPE_SVCCTX, 0, NULL);<br />
        answer = OCIServerAttach(g_pOciServer, pOciError, (unsigned char *)pConnectChar, strlen(pConnectChar),<br />
                                 OCI_DEFAULT);<br />
        answer = OCIAttrSet(g_pOciSession, OCI_HTYPE_SESSION, (unsigned char *)pUsernameChar, strlen(pUsernameChar),<br />
                            OCI_ATTR_USERNAME, pOciError);<br />
        answer = OCIAttrSet(g_pOciSession, OCI_HTYPE_SESSION, (unsigned char *)pPasswordChar, strlen(pPasswordChar),<br />
                            OCI_ATTR_PASSWORD, pOciError);<br />
        answer = OCIAttrSet(g_pOciServiceContext, OCI_HTYPE_SVCCTX, g_pOciServer, 0, OCI_ATTR_SERVER, pOciError);<br />
        answer = OCIAttrSet(g_pOciServiceContext, OCI_HTYPE_SVCCTX, g_pOciSession, 0, OCI_ATTR_SESSION, pOciError);<br />
        answer = OCISessionBegin(g_pOciServiceContext, pOciError, g_pOciSession, OCI_CRED_RDBMS, OCI_DEFAULT);<br />
        answer = OCIHandleAlloc(g_pOciEnvironment, (void **)(&pOciStatement),  OCI_HTYPE_STMT, 0, NULL);<br />
        answer = OCIStmtPrepare(pOciStatement, pOciError, (unsigned char *)sqlCharArray, strlen(sqlCharArray),<br />
                                OCI_NTV_SYNTAX, OCI_DEFAULT);<br />
        answer = OCIHandleAlloc(g_pOciEnvironment, (void **)(&cursor), OCI_HTYPE_STMT, 0, NULL);<br />
        answer = OCIBindByPos(pOciStatement,&pBind, pOciError, 1, &cursor, 0,SQLT_RSET,<br />
                                  pIndicator2, 0,NULL, 0,0,OCI_DEFAULT);<br />
 <br />
        answer = OCIStmtExecute(g_pOciServiceContext, pOciStatement, pOciError, 1, 0, NULL, NULL,<br />
                                OCI_COMMIT_ON_SUCCESS);<br />
        answer = OCIDefineByPos(cursor,&pOciDefine, pOciError,2,&id,sizeof(int),<br />
                                SQLT_INT,pIndicator, 0, 0,OCI_DEFAULT);<br />
       answer = OCIDefineByPos(cursor,&pOciDefine2, pOciError,1,ename,40,<br />
                                SQLT_STR,pIndicator3, 0, 0,OCI_DEFAULT);<br />
 <br />
        if (answer == 0)<br />
            while ((answer = OCIStmtFetch(cursor,pOciError, 1,OCI_FETCH_NEXT,OCI_DEFAULT)) == 0)<br />
            {<br />
                printf("fetched id %d and name %s\n",id,ename);<br />
            }<br />
        answer = OCIHandleFree(pOciError, OCI_HTYPE_ERROR);<br />
        return 0;<br />
}<br />
 <br />
 <br />
And the following DBI perl example is thanks to q_richard_chen@yahoo.com (Richard Chen):<br />
<br />
Hello Tom,<br />
    I was looking for such compilation of tips on the topic. I did not find the section about doing<br />
it using the popular perl DBI. After some fiddling I get it working there too. Here is a complete working example following your model using perl DBI. I think it is a good idea that you include this in your howto so that more people will benefit from it.<br />
 <br />
Thanks<br />
 <br />
Richard Chen<br />
 <br />
$ cat demo.pl<br />
#!/usr/local/bin/perl -w<br />
use strict;<br />
use DBI;<br />
use DBD::Oracle qw(:ora_types);<br />
my $dbh = DBI->connect('dbi:Oracle:','scott','tiger') or die $DBI::errstr;<br />
my $sth1 = $dbh->prepare(q{create or replace package types as<br />
          type cursorType is ref cursor;<br />
end;});<br />
$sth1->execute;<br />
> ><br />
$sth1 = $dbh->prepare(q{<br />
create or replace function sp_ListEmp return types.cursorType<br />
as l_cursor types.cursorType;<br />
begin<br />
   open l_cursor for select ename, empno from emp order by ename;<br />
   return l_cursor;<br />
end;});<br />
$sth1->execute;<br />
$sth1 = $dbh->prepare(q{<br />
BEGIN<br />
        :cursor := sp_ListEmp;<br />
END;<br />
});<br />
my $sth2;<br />
$sth1->bind_param_inout(":cursor", \$sth2, 0, { ora_type => ORA_RSET } );<br />
$sth1->execute();<br />
while ( my @row = $sth2->fetchrow_array ) { print join("|",@row),"\n"; }<br />
<br />
--------------------------------------------------------------------------------<br />
<br />
MFC + ODBC VERSION (example checked by Marcin Buchwald) marcin.buchwald@gazeta.pl Oracle server side code is just like in the VB example <br />
<br />
 <br />
        CDatabase m_DB;<br />
        BOOL ok = m_DB.OpenEx(_T("DSN=orcl;UID=velvet"),CDatabase::useCursorLib);<br />
        COraSet set(&m_DB);<br />
        set.m_Value = Text1.Text;<br />
        set.Open();<br />
        while (!set.IsEOF()) {<br />
               // set members contain values of single row<br />
               // use it here<br />
 <br />
               set.MoveNext();<br />
        }<br />
        set.Close();<br />
 <br />
where<br />
 <br />
        COraSet::COraSet(CDatabase* pdb) : CRecordset(pdb) {<br />
               m_nParams = 1;<br />
               m_nFields = ;<br />
               m_nDefaultType = snapshot;<br />
        }<br />
 <br />
        CString COraSet::GetDefaultSQL() {<br />
               return _T("{call RefTest.GetEmpData(?,?)}");<br />
        }<br />
Fonte: <a href="http://asktom.oracle.com/tkyte/ResultSets/index.html">http://asktom.oracle.com/tkyte/ResultSets/index.html</a> </description>
		<author> - Moderador Oracle_br (moderador@oraclebr.com.br)</author>
		<pubDate>Thu, 12 Jul 2007 00:00:00 -0300</pubDate>
		<guid>http://www.oraclebr.com.br/codigo/codigo.php?seq=35</guid>
		</item>
		<item>
		<title>Gerador Dinâmico de HTML/CSV - Package</title>
		<link>http://www.oraclebr.com.br/codigo/codigo.php?seq=34</link>
		<description>-- Versão do RDBMS testada: 9.2.0.4<br />
create or replace package nk4xgrid<br />
timestamp '1998-07-07:10:10:10'<br />
authid current_user<br />
is<br />
  ------------------------------------------------------------------<br />
  -- (c) Copyright 1998-2004 Nulaya Knowledge<br />
  ------------------------------------------------------------------<br />
  -- NK4XGRID: Dynamic HTML/CSV Grid Generator<br />
  ------------------------------------------------------------------<br />
<br />
  ------------------------------------------------------------------<br />
  -- Collections, Records, Variables, Constants, Exceptions, Cursors<br />
  ------------------------------------------------------------------<br />
  -- Oracle types constants<br />
  varchar2_type constant integer := 1;<br />
  number_type   constant integer := 2;<br />
  long_type     constant integer := 8;<br />
  varchar_type  constant integer := 9;<br />
  date_type     constant integer := 12;<br />
  rowid_type    constant integer := 69;<br />
  char_type     constant integer := 96;<br />
  clob_type     constant integer := 112;<br />
  blob_type     constant integer := 113;<br />
  bfile_type    constant integer := 114;<br />
  cfile_type    constant integer := 115;<br />
  urowid_type   constant integer := 208;<br />
<br />
  -- Format Constants<br />
  csv_format      constant varchar2(10) := 'CSV';<br />
  html_format     constant varchar2(10) := 'HTML';<br />
<br />
  -- HTML Constants<br />
  justify_left    constant varchar2(10) := 'LEFT';<br />
  justify_right   constant varchar2(10) := 'RIGHT';<br />
<br />
  -- GRID Structure<br />
  type grid_columns is table of varchar2(4000) index by binary_integer;<br />
  type grid_array   is table of grid_columns   index by binary_integer;<br />
<br />
  -- Buffers<br />
  type buffer_array is table of varchar2(32767) index by binary_integer;<br />
  gt_public_buffer  buffer_array;<br />
<br />
  ------------------------------------------------------------------<br />
  -- GRID<br />
  ------------------------------------------------------------------<br />
  procedure grid(ft_buffer  out buffer_array,<br />
                 fv_stmt    in  varchar2,<br />
                 fv_format  in  varchar2);<br />
<br />
  ------------------------------------------------------------------<br />
  -- HTML_DEFAULT<br />
  ------------------------------------------------------------------<br />
  procedure html_default(ft_buffer    out buffer_array,<br />
                         ft_grid      in out nocopy grid_array,<br />
                         ft_template  in grid_columns);<br />
<br />
  ------------------------------------------------------------------<br />
  -- CSV_DEFAULT<br />
  ------------------------------------------------------------------<br />
  procedure csv_default(ft_buffer  out buffer_array,<br />
                        ft_grid    in out nocopy grid_array);<br />
<br />
end nk4xgrid;<br />
/<br />
show errors<br />
<br />
<br />
<br />
<br />
<br />
create or replace package body nk4xgrid<br />
timestamp '1998-07-07:10:10:10'<br />
is<br />
  ------------------------------------------------------------------<br />
  -- (c) Copyright 1998-2004 Nulaya Knowledge<br />
  ------------------------------------------------------------------<br />
  -- NK4XGRID: Dynamic HTML/CSV Grid Generator<br />
  ------------------------------------------------------------------<br />
<br />
  ------------------------------------------------------------------<br />
  -- Collections, Records, Variables, Constants, Exceptions, Cursors<br />
  ------------------------------------------------------------------<br />
  gv_package_name  constant varchar2(30) := 'NK4XGRID';<br />
<br />
  -- Subtypes<br />
  subtype dbms_sql_array is dbms_sql.varchar2a;<br />
<br />
  -- Current cursor<br />
  gv_cursor   integer;<br />
<br />
  -- Allowed column title chars<br />
  gv_allowedchars  constant varchar2(256) := 'abcdefghijklmnopqrstuvwxyz' ||<br />
                                             'ABCDEFGHIJKLMNOPQRSTUVWXYZ' ||<br />
                                             '~!@#$%^&*()_+-=/|\?,[.]{;}<:>0123456789' ||<br />
                                             'ÀÁÂÃÄàáâãäÈÉÊËèéêëÌÍÎÏìíîïÒÓÔÕÖòóôõöÙÚÛÜùúûü' ||<br />
                                             'ÇçÑñªº®£¥" ';<br />
<br />
  gv_grid_stmt_1  constant varchar2(512) := '<br />
declare<br />
  lv__         constant varchar2(100) := ''NK4XGRID.GV_GRID_STMT'';<br />
  lv_cursor    constant integer := :lv_cursor;<br />
  lv_format    constant varchar2(255) := :lv_format;<br />
  lt_grid      nk4xgrid.grid_array;<br />
  lt_template  nk4xgrid.grid_columns;';<br />
--LT_DECLARE<br />
  gv_grid_stmt_2  varchar2(512) := '<br />
  lv_rows      integer;<br />
  i            binary_integer := 2;<br />
begin';<br />
--LT_TEMPLATE<br />
--LT_TITLE<br />
--LT_DEFINE<br />
  gv_grid_stmt_3  constant varchar2(512) := '<br />
  lv_rows := dbms_sql.execute(lv_cursor);<br />
  while (dbms_sql.fetch_rows(lv_cursor) > 0) loop';<br />
--LT_COLVAL<br />
--LT_GRIDDING<br />
  gv_grid_stmt_4  constant varchar2(1024) := '<br />
    i := i + 1;<br />
  end loop;<br />
  if (lv_format = nk4xgrid.csv_format) then<br />
    nk4xgrid.csv_default(ft_buffer   => nk4xgrid.gt_public_buffer,<br />
                         ft_grid     => lt_grid);<br />
  else<br />
    nk4xgrid.html_default(ft_buffer   => nk4xgrid.gt_public_buffer,<br />
                          ft_grid     => lt_grid,<br />
                          ft_template => lt_template);<br />
  end if;<br />
  lt_grid.delete;<br />
  lt_template.delete;<br />
exception when others then<br />
  raise_application_error(-20904, lv__ || chr(10) || sqlerrm);<br />
end;';<br />
<br />
  -- HTML Data<br />
  gv_html_begin constant varchar2(4096) :=<br />
'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><br />
<html><head><meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"><br />
<meta http-equiv="Expires" content="Thu, 01 Jan 1970 00:00:00 GMT"><br />
<title>Nulaya Knowledge - GRID Generator</title><br />
<style type="text/css"><br />
BODY {<br />
  Font-Family      : Tahoma, Verdana, Helvetica, Sans-Serif;<br />
  Font-Size        : 8pt;<br />
  Font-Weight      : Normal;<br />
  Color            : rgb(51, 102, 204);<br />
  Margin           : 0px 0px 0px 0px;<br />
  Padding          : 0px 0px 0px 0px;<br />
  Border           : 0px solid #006400;<br />
  Background-Color : #FFFFFF; }<br />
TABLE {<br />
  Float   : Left;<br />
  Margin  : 0px 0px 0px 0px;<br />
  Padding : 0px 0px 0px 0px;<br />
  Border  : 0px solid rgb(51, 102, 204); }<br />
TD {<br />
  Text-Align       : Left;<br />
  Font-Family      : MS Sans Serif, Arial, Verdana, Courier New, Courier, Monospace;<br />
  Font-Size        : 8pt;<br />
  Font-Weight      : Normal;<br />
  Color            : rgb(0, 0, 0);<br />
  Vertical-Align   : Top;<br />
  Border-Right     : 1px solid rgb(220, 220, 220);<br />
  Border-Bottom    : 1px solid rgb(220, 220, 220);<br />
  Padding          : 0px 2px 2px 2px;<br />
  White-Space      : NoWrap;<br />
  Background-Color : rgb(255, 255, 255); }<br />
TD.hl {<br />
  Font-Family : Tahoma;<br />
  Font-Size   : 10pt;<br />
  Font-Weight : Bold;<br />
  Padding     : 2px 4px 0px 4px;<br />
  Background-Color : rgb(204, 255, 255); }<br />
TD.hr {<br />
  Text-Align  : Right;<br />
  Font-Family : Tahoma;<br />
  Font-Size   : 10pt;<br />
  Font-Weight : Bold;<br />
  Padding     : 2px 4px 0px 4px;<br />
  Background-Color : rgb(204, 255, 255); }<br />
TD.ol {<br />
  Text-Align       : Left;<br />
  Background-Color : rgb(255, 255, 255); }<br />
TD.or {<br />
  Text-Align       : Right;<br />
  Background-Color : rgb(255, 255, 255); }<br />
TD.el {<br />
  Text-Align       : Left;<br />
  Background-Color : rgb(255, 255, 255); }<br />
TD.er {<br />
  Text-Align       : Right;<br />
  Background-Color : rgb(255, 255, 255); }<br />
PRE {<br />
  Font-Family      : Courier New, Courier, Monospace;<br />
  Font-Size        : 8pt;<br />
  Color            : rgb(0, 0, 0);<br />
  Margin-Left      : 6px;<br />
  Background-Color : rgb(255, 255, 237); }<br />
</style></head><table cellspacing="0" cellpadding="0"><tbody>' || chr(10);<br />
  gv_tr_open       constant varchar2(25) := '<tr>' || chr(10);<br />
  gv_thl           constant varchar2(25) := '<td class="hl">';           -- Table Header: left justified<br />
  gv_thr           constant varchar2(25) := '<td class="hr">';           -- Table Header: right justified<br />
  gv_tdol          constant varchar2(25) := '<td class="ol">';           -- Table Data: odd row left justified<br />
  gv_tdor          constant varchar2(25) := '<td class="or">';           -- Table Data: odd row right justified<br />
  gv_tdel          constant varchar2(25) := '<td class="el">';           -- Table Data: even row left justified<br />
  gv_tder          constant varchar2(25) := '<td class="er">';           -- Table Data: even row right justified<br />
  gv_td_close      constant varchar2(25) := '</td>' || chr(10);<br />
  gv_tr_close      constant varchar2(25) := '</tr>' || chr(10);<br />
  gv_html_end      constant varchar2(25) := '</tbody></body></html>' || chr(10);<br />
<br />
  -- Internals<br />
  gv_format    varchar(10);<br />
  gv_columns   integer;<br />
  gt_buffer    buffer_array;<br />
  gt_template  grid_columns;<br />
<br />
  ------------------------------------------------------------------<br />
  ----------------------- Private Session --------------------------<br />
  ------------------------------------------------------------------<br />
<br />
  ------------------------------------------------------------------<br />
  -- FILTER_PVT - Remove any characters that wasn't allowed<br />
  ------------------------------------------------------------------<br />
  procedure filter_pvt(fv_text          in out nocopy varchar2,<br />
                       fv_allowedchars  in varchar2 := gv_allowedchars)<br />
  is<br />
    lv__                constant varchar2(100) := gv_package_name || '.FILTER_PVT: ';<br />
    lv_allowedchar      constant varchar2(1) := substrb(fv_allowedchars, 1, 1);<br />
    lv_notallowedchars  constant varchar2(32767) := replace(translate(fv_text, fv_allowedchars, lv_allowedchar), lv_allowedchar, null);<br />
    lv_nacslength       constant integer := nvl(lengthb(lv_notallowedchars),0);<br />
    lv_notallowedchar   constant varchar2(1) := substrb(lv_notallowedchars, 1, 1);<br />
  begin<br />
    if (lv_nacslength > 0) then<br />
      fv_text := replace(translate(fv_text, lv_notallowedchars,<br />
                         rpad(lv_notallowedchar, lv_nacslength, lv_notallowedchar)), lv_notallowedchar, null);<br />
    end if;<br />
  exception when others then<br />
    raise_application_error(-20904, lv__ || chr(10) || sqlerrm);<br />
  end filter_pvt;<br />
<br />
  ------------------------------------------------------------------<br />
  -- CLEANOUT_PVT<br />
  ------------------------------------------------------------------<br />
  procedure cleanout_pvt<br />
  is<br />
    lv__   constant varchar2(100) := gv_package_name || '.CLEANOUT_PVT: ';<br />
  begin<br />
    gv_format := null;<br />
    gv_columns := null;<br />
    gt_buffer.delete;<br />
    gt_template.delete;<br />
  exception when others then<br />
    raise_application_error(-20904, lv__ || chr(10) || sqlerrm);<br />
  end cleanout_pvt;<br />
<br />
  ------------------------------------------------------------------<br />
  -- ESCAPE_TAGS_PVT<br />
  ------------------------------------------------------------------<br />
  procedure escape_tags_pvt(fv_text    in out nocopy varchar2,<br />
                            fv_format  in varchar2)<br />
  is<br />
    lv__   constant varchar2(100) := gv_package_name || '.ESCAPE_TAGS_PVT: ';<br />
  begin<br />
    if (fv_format = html_format) then<br />
      fv_text := replace(replace(replace(replace(fv_text, '<', '&' || 'lt;'), '>', '&' || 'gt;'), chr(9), ' '), chr(10), '<br>');<br />
      fv_text := nvl(fv_text, '&' || 'nbsp;');<br />
    elsif (fv_format = csv_format) then<br />
      fv_text := replace(fv_text, '"', '""');<br />
    end if;<br />
  exception when others then<br />
    raise_application_error(-20904, lv__ || chr(10) || sqlerrm);<br />
  end escape_tags_pvt;<br />
<br />
  ------------------------------------------------------------------<br />
  -- GRID_SANITY_PVT<br />
  ------------------------------------------------------------------<br />
  procedure grid_sanity_pvt(ft_grid  in grid_array)<br />
  is<br />
    lv__    constant varchar2(100) := gv_package_name || '.GRID_SANITY_PVT: ';<br />
    i       binary_integer;<br />
    j       binary_integer;<br />
    haetsl  boolean := TRUE;    -- has all elements the same length<br />
  begin<br />
    i := ft_grid.first;<br />
    while (i is not null) loop<br />
      if (i = ft_grid.first) then<br />
        j := ft_grid(i).count;<br />
      elsif (j <> ft_grid(i).count) then<br />
        haetsl := FALSE;<br />
        exit;<br />
      end if;<br />
      i := ft_grid.next(i);<br />
    end loop;<br />
    if (not haetsl) then<br />
      raise_application_error(-20904, '*** Grid data has distinct sizes ***');<br />
    end if;<br />
    if (gv_format = html_format) then<br />
      if (j <> gt_template.count) then<br />
        raise_application_error(-20904, '*** Invalid template size ***');<br />
      end if;<br />
    end if;<br />
  exception when others then<br />
    raise_application_error(-20904, lv__ || chr(10) || sqlerrm);<br />
  end grid_sanity_pvt;<br />
<br />
  ------------------------------------------------------------------<br />
  -- CSV_DEFAULT_PVT<br />
  ------------------------------------------------------------------<br />
  procedure csv_default_pvt(ft_grid  in out nocopy grid_array)<br />
  is<br />
    lv__       constant varchar2(100) := gv_package_name || '.CSV_DEFAULT_PVT: ';<br />
    lv_column  varchar2(4000);<br />
    lv_row     varchar2(32767);<br />
    i          binary_integer;<br />
    j          binary_integer;<br />
    k          binary_integer;<br />
  begin<br />
    grid_sanity_pvt(ft_grid => ft_grid);<br />
    i := ft_grid.first;<br />
    while (i is not null) loop<br />
      j := ft_grid(i).first;<br />
      while (j is not null) loop<br />
        lv_column := ft_grid(i)(j);<br />
        escape_tags_pvt(fv_text   => lv_column,<br />
                        fv_format => csv_format);<br />
        if (j <> ft_grid(i).last) then<br />
          lv_row := lv_row || '"' || lv_column || '";';<br />
        else<br />
          lv_row := lv_row || '"' || lv_column || '"';<br />
        end if;<br />
        j := ft_grid(i).next(j);<br />
      end loop;<br />
      gt_buffer(nvl(gt_buffer.last,0) + 1) := lv_row;<br />
      lv_row := null;<br />
      k := i;<br />
      i := ft_grid.next(i);<br />
      ft_grid(k).delete;<br />
    end loop;<br />
    ft_grid.delete;<br />
  exception when others then<br />
    raise_application_error(-20904, lv__ || chr(10) || sqlerrm);<br />
  end csv_default_pvt;<br />
<br />
  ------------------------------------------------------------------<br />
  -- HTML_DEFAULT_PVT<br />
  ------------------------------------------------------------------<br />
  procedure html_default_pvt(ft_grid  in out nocopy grid_array)<br />
  is<br />
    lv__       constant varchar2(100) := gv_package_name || '.HTML_DEFAULT_PVT: ';<br />
    lv_text    varchar2(32767);<br />
    shift      boolean := TRUE;<br />
    i          binary_integer;<br />
    j          binary_integer;<br />
    k          binary_integer;<br />
  begin<br />
    gt_buffer(nvl(gt_buffer.last,0) + 1) := gv_html_begin;<br />
    i := ft_grid.first;<br />
    while (i is not null) loop<br />
      gt_buffer(nvl(gt_buffer.last,0) + 1) := gv_tr_open;<br />
      j := ft_grid(i).first;<br />
      while (j is not null) loop<br />
        lv_text := ft_grid(i)(j);<br />
        escape_tags_pvt(fv_text   => lv_text,<br />
                        fv_format => html_format);<br />
        if (i = ft_grid.first) then                         -- Header<br />
          if (gt_template(j) = justify_right) then<br />
            lv_text := gv_thr || lv_text || gv_td_close;<br />
          else<br />
            lv_text := gv_thl || lv_text || gv_td_close;<br />
          end if;<br />
        else                                                -- Rows<br />
          if (shift) then                                   -- Odd row<br />
            if (gt_template(j) = justify_right) then<br />
              lv_text := gv_tdor || lv_text || gv_td_close;<br />
            else<br />
              lv_text := gv_tdol || lv_text || gv_td_close;<br />
            end if;<br />
          else                                              -- Even row<br />
            if (gt_template(j) = justify_right) then<br />
              lv_text := gv_tder || lv_text || gv_td_close;<br />
            else<br />
              lv_text := gv_tdel || lv_text || gv_td_close;<br />
            end if;<br />
          end if;<br />
        end if;<br />
        gt_buffer(nvl(gt_buffer.last,0) + 1) := lv_text;<br />
        j := ft_grid(i).next(j);<br />
      end loop;<br />
      gt_buffer(nvl(gt_buffer.last,0) + 1) := gv_tr_close;<br />
      if (shift) then<br />
        shift := FALSE;<br />
      else<br />
        shift := TRUE;<br />
      end if;<br />
      k := i;<br />
      i := ft_grid.next(i);<br />
      ft_grid(k).delete;<br />
    end loop;<br />
    ft_grid.delete;<br />
  exception when others then<br />
    raise_application_error(-20904, lv__ || chr(10) || sqlerrm);<br />
  end html_default_pvt;<br />
<br />
  ------------------------------------------------------------------<br />
  -- POP_GRID_PVT<br />
  ------------------------------------------------------------------<br />
  procedure pop_grid_pvt(fv_format  in varchar2)<br />
  is<br />
    lv__  constant varchar2(100) := gv_package_name || '.POP_GRID_PVT: ';<br />
    lt_stmt        dbms_sql_array;<br />
    lt_columns     dbms_sql.desc_tab2;<br />
    lv_columns     integer;<br />
    lv_title       varchar2(255);<br />
    lt_declare     buffer_array;<br />
    lt_template    buffer_array;<br />
    lt_title       buffer_array;<br />
    lt_define      buffer_array;<br />
    lt_colval      buffer_array;<br />
    lt_gridding    buffer_array;<br />
    job2do         boolean := TRUE;<br />
    lv_cursor      integer;<br />
    lv_rows        integer;<br />
    i              binary_integer;<br />
    j              binary_integer := 1;<br />
  begin<br />
    dbms_sql.describe_columns2(gv_cursor, lv_columns, lt_columns);<br />
    i := lt_columns.first;<br />
    while (i is not null) loop<br />
      if (lt_columns(i).col_type = varchar2_type) then<br />
        lt_declare(lt_declare.count+1)   := '  lv_col' || to_char(i) || '  varchar2(' || to_char(lt_columns(i).col_max_len) || ');' || chr(10);<br />
        lt_template(lt_template.count+1) := '  lt_template(' || to_char(j) ||') := nk4xgrid.justify_left;' || chr(10);<br />
        lt_define(lt_define.count+1)     := '  dbms_sql.define_column(lv_cursor, ' || to_char(i) || ', lv_col' || to_char(i) ||<br />
                                            ', ' || to_char(lt_columns(i).col_max_len) || ');' || chr(10);<br />
        lt_gridding(lt_gridding.count+1) := '    lt_grid(i)(' || to_char(j) ||') := lv_col' || to_char(i) || ';' || chr(10);<br />
      elsif (lt_columns(i).col_type = number_type) then<br />
        lt_declare(lt_declare.count+1)   := '  lv_col' || to_char(i) || '  number;' || chr(10);<br />
        lt_template(lt_template.count+1) := '  lt_template(' || to_char(j) ||') := nk4xgrid.justify_right;' || chr(10);<br />
        lt_define(lt_define.count+1)     := '  dbms_sql.define_column(lv_cursor, ' || to_char(i) || ', lv_col' || to_char(i) || ');' || chr(10);<br />
        lt_gridding(lt_gridding.count+1) := '    lt_grid(i)(' || to_char(j) || ') := to_char(lv_col' || to_char(i) || ');' || chr(10);<br />
      elsif (lt_columns(i).col_type = date_type) then<br />
        lt_declare(lt_declare.count+1)   := '  lv_col' || to_char(i) || '  date;' || chr(10);<br />
        lt_template(lt_template.count+1) := '  lt_template(' || to_char(j) ||') := nk4xgrid.justify_left;' || chr(10);<br />
        lt_define(lt_define.count+1)     := '  dbms_sql.define_column(lv_cursor, ' || to_char(i) || ', lv_col' || to_char(i) ||<br />
                                            ');' || chr(10);<br />
        lt_gridding(lt_gridding.count+1) := '    lt_grid(i)(' || to_char(j) ||') := to_char(lv_col' || to_char(i) || ', ' ||<br />
                                            '''DD/MM/YYYY HH24:MI:SS'');' || chr(10);<br />
      elsif (lt_columns(i).col_type = char_type) then<br />
        lt_declare(lt_declare.count+1)   := '  lv_col' || to_char(i) || '  varchar2(' || to_char(lt_columns(i).col_max_len) || ');' || chr(10);<br />
        lt_template(lt_template.count+1) := '  lt_template(' || to_char(j) ||') := nk4xgrid.justify_left;' || chr(10);<br />
        lt_define(lt_define.count+1)     := '  dbms_sql.define_column(lv_cursor, ' || to_char(i) || ', lv_col' || to_char(i) ||<br />
                                            ', ' || to_char(lt_columns(i).col_max_len) || ');' || chr(10);<br />
        lt_gridding(lt_gridding.count+1) := '    lt_grid(i)(' || to_char(j) ||') := lv_col' || to_char(i) || ';' || chr(10);<br />
      else<br />
        job2do := FALSE;<br />
      end if;<br />
      if (job2do) then<br />
        lt_colval(lt_colval.count+1) := '    dbms_sql.column_value(lv_cursor, ' || to_char(i) || ', lv_col' || to_char(i) || ');' || chr(10);<br />
        lv_title := substrb(lt_columns(i).col_name, 1, 255);<br />
        filter_pvt(fv_text         => lv_title,<br />
                   fv_allowedchars => gv_allowedchars);<br />
        lt_title(lt_title.count+1) := '  lt_grid(1)(' || to_char(j) ||') := ''' || lv_title || ''';' || chr(10);<br />
        j := j + 1;<br />
      end if;<br />
      job2do := TRUE;<br />
      i := lt_columns.next(i);<br />
    end loop;<br />
    lt_stmt(lt_stmt.count+1) := gv_grid_stmt_1;<br />
    for n in 1 .. lt_declare.count loop<br />
      lt_stmt(lt_stmt.count+1) := lt_declare(n);<br />
    end loop;<br />
    lt_declare.delete;<br />
    lt_stmt(lt_stmt.count+1) := gv_grid_stmt_2;<br />
    for n in 1 .. lt_template.count loop<br />
      lt_stmt(lt_stmt.count+1) := lt_template(n);<br />
    end loop;<br />
    lt_template.delete;<br />
    for n in 1 .. lt_title.count loop<br />
      lt_stmt(lt_stmt.count+1) := lt_title(n);<br />
    end loop;<br />
    lt_title.delete;<br />
    for n in 1 .. lt_define.count loop<br />
      lt_stmt(lt_stmt.count+1) := lt_define(n);<br />
    end loop;<br />
    lt_define.delete;<br />
    lt_stmt(lt_stmt.count+1) := gv_grid_stmt_3;<br />
    for n in 1 .. lt_colval.count loop<br />
      lt_stmt(lt_stmt.count+1) := lt_colval(n);<br />
    end loop;<br />
    lt_colval.delete;<br />
    for n in 1 .. lt_gridding.count loop<br />
      lt_stmt(lt_stmt.count+1) := lt_gridding(n);<br />
    end loop;<br />
    lt_gridding.delete;<br />
    lt_stmt(lt_stmt.count+1) := gv_grid_stmt_4;<br />
    lv_cursor := dbms_sql.open_cursor;<br />
    dbms_sql.parse(lv_cursor, lt_stmt, lt_stmt.first, lt_stmt.last, false, dbms_sql.native);<br />
    dbms_sql.bind_variable(lv_cursor, 'lv_cursor', gv_cursor);<br />
    dbms_sql.bind_variable(lv_cursor, 'lv_format', nk4xgrid.html_format);<br />
    lv_rows := dbms_sql.execute(lv_cursor);<br />
    dbms_sql.close_cursor(lv_cursor);<br />
  exception when others then<br />
    if (dbms_sql.is_open(lv_cursor)) then<br />
      dbms_sql.close_cursor(lv_cursor);<br />
    end if;<br />
    raise_application_error(-20904, lv__ || chr(10) || sqlerrm);<br />
  end pop_grid_pvt;<br />
<br />
  ------------------------------------------------------------------<br />
  ------------------------ Public Session --------------------------<br />
  ------------------------------------------------------------------<br />
<br />
  ------------------------------------------------------------------<br />
  -- GRID<br />
  ------------------------------------------------------------------<br />
  procedure grid(ft_buffer  out buffer_array,<br />
                 fv_stmt    in varchar2,<br />
                 fv_format  in varchar2)<br />
  is<br />
    lv__  constant varchar2(100) := gv_package_name || '.GRID: ';<br />
  begin<br />
    if (fv_stmt is not null) then<br />
      gv_cursor := dbms_sql.open_cursor;<br />
      dbms_sql.parse(gv_cursor, fv_stmt, dbms_sql.native);<br />
      pop_grid_pvt(fv_format => fv_format);<br />
      dbms_sql.close_cursor(gv_cursor);<br />
    end if;<br />
    ft_buffer := gt_public_buffer;<br />
  exception when others then<br />
    if (dbms_sql.is_open(gv_cursor)) then<br />
      dbms_sql.close_cursor(gv_cursor);<br />
    end if;<br />
    raise_application_error(-20904, lv__ || chr(10) || sqlerrm);<br />
  end grid;<br />
<br />
  ------------------------------------------------------------------<br />
  -- HTML_DEFAULT<br />
  ------------------------------------------------------------------<br />
  procedure html_default(ft_buffer    out buffer_array,<br />
                         ft_grid      in out nocopy grid_array,<br />
                         ft_template  in grid_columns)<br />
  is<br />
    lv__   constant varchar2(100) := gv_package_name || '.HTML_DEFAULT: ';<br />
  begin<br />
    cleanout_pvt;<br />
    gt_template := ft_template;<br />
    html_default_pvt(ft_grid  => ft_grid);<br />
    ft_buffer := gt_buffer;<br />
    cleanout_pvt;<br />
  exception when others then<br />
    raise_application_error(-20904, lv__ || chr(10) || sqlerrm);<br />
  end html_default;<br />
<br />
  ------------------------------------------------------------------<br />
  -- CSV_DEFAULT<br />
  ------------------------------------------------------------------<br />
  procedure csv_default(ft_buffer  out buffer_array,<br />
                        ft_grid    in out nocopy grid_array)<br />
  is<br />
    lv__   constant varchar2(100) := gv_package_name || '.CSV_DEFAULT: ';<br />
  begin<br />
    cleanout_pvt;<br />
    gv_format := csv_format;<br />
    csv_default_pvt(ft_grid  => ft_grid);<br />
    ft_buffer := gt_buffer;<br />
    cleanout_pvt;<br />
  exception when others then<br />
    raise_application_error(-20904, lv__ || chr(10) || sqlerrm);<br />
  end csv_default;<br />
<br />
end nk4xgrid;<br />
/<br />
show errors<br />
<br />
</description>
		<author> - Geraldo Viana De Paula Junior (nulaya@yahoo.com)</author>
		<pubDate>Fri, 24 Nov 2006 00:00:00 -0200</pubDate>
		<guid>http://www.oraclebr.com.br/codigo/codigo.php?seq=34</guid>
		</item>
		<item>
		<title>O Sistema Oracle está democratizando o conhecimento de TI - Mundo Oracle</title>
		<link>http://www.oraclebr.com.br/codigo/codigo.php?seq=33</link>
		<description><br />
Qualquer empresa na área de TI que busca um crescimento sustentado<br />
deverá investir na educação. Atualmente na linha de sistemas<br />
integrados ERP (Enterprise Resource Planning - Atividades e<br />
aplicativos que auxiliam a empresa a gerenciar com mais eficiência<br />
os aspectos fundamentais de seu negócio), a SAP (empresa Alemã que<br />
distribui ERP SAP), monopoliza o conhecimento com custos altíssimos.<br />
Por outro lado, com a mudança do mercado para o SMB (ERP de baixo<br />
custo utilizado por empresas de médio e pequeno porte), a SAP já<br />
esta tendo problemas com a falta de consultores no mercado (Motivo -<br />
custo elevado da consultoria). Por ser novidade, antigamente, vender<br />
ERP para grandes empresas ficava fácil, pois o custo do projeto<br />
absorvia os altos valores da consultoria. Exemplo: Petrobras, CVRD,<br />
etc. Atualmente a briga mudou de área, pois a SMB tem licença que<br />
gira em torno de 50% da normal. Logo, seguindo este pensamento, o<br />
custo da consultoria deveria também reduzir. Errado, cada vez mais a<br />
consultoria aumenta! A demanda X necessidade, está ditando os preços<br />
deste mercado. Logo, os custos de consultoria estão inviabilizando<br />
os projetos de SMB. Preocupado com esse problema, a SAP apresentou<br />
um projeto de 1000 consultores em 500 dias (cobrando de 50% do custo<br />
do curso para seus parceiros), terceirizou a sua área de educação,<br />
mais mesmo assim não teve o êxito esperado. Enfim, continua uma<br />
educação "Sapiana" cara e nada democrática. A Oracle, o seu<br />
principal concorrente, esta seguindo por outro caminho. Caminho que<br />
a pioneira Microsoft sempre procurou andar (treinamentos<br />
democráticos de baixo custo). Para que uma empresa consiga aumentar<br />
a sua venda de licenças, será necessário um investimento educacional<br />
constante em técnicos e consultores na sua base. Oferecer para o<br />
mercado cursos de baixo custo, com qualidade, será um importante<br />
nicho de mercado. A Oracle, com o apoio das Universidades, esta<br />
procurando democratizar o conhecimento no Brasil, seguindo os passos<br />
da pioneira Microsoft. Nesta linha, como coordenador e professor<br />
Oracle da Universidade Veiga de Almeida UVA RJ apresento os inéditos<br />
cursos Oficiais de Pós-graduação e Graduação de Aplicativos ERP<br />
Oracle.                               . Com a parceria oficial<br />
Oracle assinada, a Universidade UVA democratizou o conhecimento para<br />
seus alunos, oferecendo, com baixo custo, o acesso educacional ao<br />
ERP Oracle . O objetivo da Universidade UVA em 2007 será oferecer<br />
treinamentos, com laboratórios "on line" Oracle (MBA e Graduação ERP<br />
e DBA ) com preços acessíveis para os graduados e alunos iniciantes.<br />
Nos cursos de graduação Oracle, o aluno na área de TI (tecnologia da<br />
informação) receberá um treinamento profissionalizante de boa<br />
qualidade para o mercado. O futuro graduado, além do diploma<br />
Universitário, poderá atuar rapidamente como um ATG ou DBA em 03<br />
anos. Com essa iniciativa, a Universidade Veiga de Almeida oferecerá<br />
rapidamente mão obra especializada, revolucionando o mercado. O<br />
Professor Joaquim Farias é Coordenador Oracle da Universidade Veiga<br />
de Almeida  UVA.</description>
		<author> - Moderador Oracle_br (moderador@oraclebr.com.br)</author>
		<pubDate>Tue, 21 Nov 2006 00:00:00 -0200</pubDate>
		<guid>http://www.oraclebr.com.br/codigo/codigo.php?seq=33</guid>
		</item>
		<item>
		<title>Oracle inaugura projeto educacional Think no Brasil - Mundo Oracle</title>
		<link>http://www.oraclebr.com.br/codigo/codigo.php?seq=32</link>
		<description>Fundação de Educação Oracle inaugura projeto educacional Think no Brasil<br />
<br />
Publicada em 09 de novembro de 2006 às 13h28<br />
<br />
São Paulo - Baseado em Web 2.0, Think.com estréia em português com 12 colégios que formularão projetos colaborativos entre alunos e professores.<br />
<br />
A Fundação de Educação Oracle, organização sem fins lucrativos financiada pela Oracle, lançou nesta quinta-feira (09/11) a versão em português do projeto educacional Think.com.<br />
<br />
Definido como uma "comunidade online de aprendizado", o Think.com oferece ferramentas de interação para que professores do ensino básico desenvolvam projetos educacionais pela internet com seus alunos.<br />
<br />
O projeto piloto do Think.com no Brasil já conta com a participação de 12 colégios dentro do estado de São Paulo, segundo Cyro Diehl, vice-presidente de vendas indiretas para a América Latina da companhia.<br />
<br />
Baseado em dados relativos ao projeto no Chile, Diehl projeta que o Think.com deverá atingir cerca de 200 mil estudantes em 400 escolas primárias espalhadas pelo Brasil dentro de três anos.<br />
<br />
O Think.com também propõe acordos dos colégios de ensino básico com instituições de ensino como forma de aproximar professores e formular novas iniciativas.<br />
<br />
Neste âmbito, o projeto brasileiro já conta com a participação de Prodesp, Escola do Futuro, ligada à Universidade de São Paulo, e Fundação Bradesco.<br />
<br />
A aproximação, segundo James Ballard, vice-presidente global da Fundação de Educação Oracle, amenizará mais rápido o principal problema com a comunidade em seu início: a falta de projetos colaborativos em português.<br />
<br />
Ballard também vê a Web 2.0 como ferramenta imprescindível para o futuro da educação. "O movimento (de Web 2.0) inspira estudantes a criar, compartilhar e comparar conteúdo alheio, além de impulsionar a inclusão digital de uma maneira global".<br />
<br />
Projetos capitaneados por grandes companhias, como o Think.com, que consome parte dos 18 milhões de dólares investidos anualmente pela Oracle na Fundação de Educação Oracle, é uma maneira de "diminuir o abismo digital" em pouco tempo, segundo o executivo. <br />
<br />
Ballard, no entanto, crê que a inclusão digital passe pela combinação entre ferramentas de educação e doações de equipamentos para colégios. "Um não se faz sem o outro. O software precisa do hardware e vice-versa".<br />
<br />
<br />
Fonte: <a href="http://idgnow.uol.com.br/internet/2006/11/09/idgnoticia.2006-11-09.9826809593/IDGNoticia_view">http://idgnow.uol.com.br/internet/2006/11/09/idgnoticia.2006-11-09.9826809593/IDGNoticia_view</a> </description>
		<author> - Moderador Oracle_br (moderador@oraclebr.com.br)</author>
		<pubDate>Fri, 10 Nov 2006 00:00:00 -0200</pubDate>
		<guid>http://www.oraclebr.com.br/codigo/codigo.php?seq=32</guid>
		</item>
		<item>
		<title>Oracle Kids - Mundo Oracle</title>
		<link>http://www.oraclebr.com.br/codigo/codigo.php?seq=31</link>
		<description>Oracle comemora mês das crianças com programação especial para seus colaboradores  <br />
<br />
Funcionários trarão seus filhos para vivenciar um clima de circo com mágicos, malabarismos e guloseimas; tarde será livre para continuar com as crianças  <br />
 <br />
 SÃO PAULO, Brasil   17-OCT-2006  A Oracle comemora o mês das crianças globalmente, num evento batizado de Oracle Kids. No Brasil, no dia 20 de outubro, próxima sexta-feira, os filhos dos funcionários terão uma manhã especial. Na ocasião, grupos circences irão comandar um show de mágicas e malabarismos nos escritórios da empresa em todo o País. <br />
<br />
O evento vai contar com uma programação intensa até o início da tarde, incluindo apresentação teatral, cujo tema será apresentar a Oracle para as crianças, de forma lúdica. ?Essa manhã recreativa permite que os filhos dos nossos colaboradores conheçam o ambiente de trabalho dos pais e, além disso, é mais uma oportunidade para que nossos colaboradores e suas famílias se confraternizem, o que consideramos fundamental?, afirma Alberto Brisola, diretor de Recursos Humanos da Oracle do Brasil.<br />
<br />
No Brasil, a expectativa é que mais de 100 crianças entre três e 12 anos participem do Oracle Kids. Os menores de três anos também poderão participar de todas as brincadeiras, desde que acompanhados por seus responsáveis.<br />
<br />
O Oracle Kids é uma iniciativa promovida no Brasil desde o ano 2000. Atualmente, já é realizada em todas os escritórios da empresa na América Latina. ?O mais interessante é a energia que transforma o ambiente?, completa Brisola.<br />
 </description>
		<author> - Moderador Oracle_br (moderador@oraclebr.com.br)</author>
		<pubDate>Fri, 20 Oct 2006 00:00:00 -0200</pubDate>
		<guid>http://www.oraclebr.com.br/codigo/codigo.php?seq=31</guid>
		</item>
		<item>
		<title>Saiba como a Oracle avalia seus profissionais - Mundo Oracle</title>
		<link>http://www.oraclebr.com.br/codigo/codigo.php?seq=30</link>
		<description>Saiba como a Oracle avalia seus profissionais<br />
Transparência, consenso e objetividade. Esses valores são a base do novo método para a avaliação do desempenho individual dos profissionais adotado pela área de Consultoria da Oracle do Brasil, que tem boa parte de seus quadros alocada no cliente, em projetos de vários meses. <br />
<br />
?Quando avaliamos pessoas com as quais nos relacionamos no ambiente de trabalho há o risco de a subjetividade permear todo o processo?, comenta Michel Setzer, diretor sênior de Consultoria da Oracle do Brasil. ?Por isso, adotamos ferramentas e processos que tornem as avaliações de desempenho objetivas e justas, para que possam se transformar em um componente construtivo para a orientação das carreiras?, resume ele. <br />
<br />
Além dos tradicionais relatórios de auto-avaliação dos consultores que são cruzados com os de seus gerentes, a Consultoria da Oracle do Brasil criou há quatro semestres um ?Comitê de Avaliação?. Esse grupo é formado executivos e gestores seniores e recebe as auto-avaliações dos consultores e avaliações dos gerentes para revisá-las. Eles também analisam um dossiê sobre cada um dos funcionários feito pelo gestor do time ao longo do semestre. Nele estão reunidos os e-mails de elogios e de reclamações dos clientes, informações sobre os treinamentos realizados, os detalhes dos projetos nos quais o consultor participou e outros dados importantes que possam ser coletados ao longo do semestre. O processo de discussões caso a caso toma de dois a três dias úteis por semestre. <br />
<br />
Consenso nas avaliações <br />
Setzer reforça a importância da participação de outros gerentes ? além do superior direto de cada consultor ? no processo de avaliação. ?É natural que um gerente tenda, até por seu relacionamento afetivo, a avaliar positivamente o seu funcionário. Contudo, quando outros executivos participam, fica mais fácil ser mais objetivo?, defende. <br />
<br />
Cada membro do Comitê de Avaliação recebe um guia com as orientações de como reavaliar o material sobre cada consultor, dando especial atenção a fatos concretos, como o cumprimento das metas estabelecidas previamente, a profundidade do conhecimento que detêm sobre tecnologias específicas, qualidade do relacionamento com clientes, colegas e superiores, assim como o seu comportamento no período, segundo quesitos como capacidade de liderança, desenvoltura na comunicação verbal e postura no atendimento ao cliente. As promoções e aumentos de salários, ao final, são definidos em consenso pelo grupo de executivos. <br />
<br />
Curva de desempenho <br />
?Cada consultor é avaliado individualmente de acordo com as metas que cumpriu e segundo o seu desempenho, à luz da sua comparação com todo o grupo do seu mesmo nível hierárquico?, informa Setzer. Segundo ele, a Consultoria da Oracle adota, ainda, o conceito de ?ranking forçado? ? uma classificação dos profissionais em quatro categorias: desempenho excepcional, desempenho acima das expectativas, desempenho dentro das expectativas e aquém do desejável. Este método evita que os gestores sejam condescendentes com sua equipe e coloquem todos no grupo dos melhores e garante uma avaliação comparativa. Como sempre há diferenças de performance, deve-se motivar a evolução do time focando naqueles que precisam de maior desenvolvimento. <br />
<br />
?Estatisticamente sabemos que é normal nas consultorias que 70% da equipe tenha um desempenho dentro das expectativas; 20% acima das expectativas; 3% apresente um desempenho excepcional e 7% precise de um cuidado especial para atingir um desenvolvimento profissional melhor?, detalha o diretor. <br />
<br />
?Tendo em vista esta curva, fica mais fácil definirmos as promoções e aumentos de salário por mérito?, argumenta Setzer. ?Por outro lado, torna-se mais objetivo, também, avaliar o que pode ser feito para apoiar aquela parte do time que precisa de treinamentos específicos, aconselhamento profissional (coaching) ou orientação dirigida para superar seus desafios pessoais?, acrescenta. <br />
<br />
Adesão da equipe <br />
Setzer frisa que, nesses últimos quatro semestres, a prática de avaliação de desempenho por esses procedimentos foi fundamental para motivar a equipe. ?Temos de ter em mente que nossos profissionais passam a maior parte do tempo fisicamente longe da empresa, pois estão em projetos alocados no cliente?, ressalta. ?Nesse contexto, ter a oportunidade de ver seus feitos e realizações discutidos seriamente por uma equipe de gerentes e diretores tem trazido um maior envolvimento do time?, avalia Setzer. Para o diretor, os consultores perceberam que a avaliação pode se transformar em uma ferramenta objetiva para a evolução de sua carreira. <br />
<br />
?Esse processo vem ganhando um apoio surpreendente entre os profissionais, pois eles já notaram que dele, efetivamente, saem promoções, aumento de salários e o encaminhamento a treinamentos diversos ? desde cursos técnicos até programas de ?soft skills?, como cursos para liderança, apresentações em público, negociação e planejamento?, explica Setzer. ?Hoje temos maior justiça nas promoções e estamos a caminho de uma meritocracia genuína?, comemora o executivo. Com o sucesso desta iniciativa no Brasil, a empresa começa a replicar o mesmo modelo para todas as consultorias Oracle da América Latina. <br />
<br />
<a href="http://www.cadernodigital.inf.br/interna_noticia.php?idN=1264">http://www.cadernodigital.inf.br/interna_noticia.php?idN=1264</a><br />
</description>
		<author> - Moderador Oracle_br (moderador@oraclebr.com.br)</author>
		<pubDate>Wed, 18 Oct 2006 00:00:00 -0200</pubDate>
		<guid>http://www.oraclebr.com.br/codigo/codigo.php?seq=30</guid>
		</item>
		<item>
		<title>Ordenar por campo  display no Forms - Dicas e Exemplos</title>
		<link>http://www.oraclebr.com.br/codigo/codigo.php?seq=29</link>
		<description>Mensagem postada no grupo oracle_br dia 06/10/2006:<br />
<br />
A ordenação do Forms nativa é feita PELO BANCO,<br />
portanto vc pode tranquilamente ordenar pela info não-base table DESDE<br />
QUE seja possível ** AO BANCO ** ecuperar a informação, ok ? Exemplo,<br />
Forms 6i C/S com banco 8i : <br />
<br />
a) pra efeito de demonstração, crio um Forms bem simples, um só bloco<br />
na tabela EMP do usuário SCOTT (o usuário-padrão de demos no 8i), com<br />
os campos EMPNO, ENAME, DEPTO e SAL<br />
<br />
b) manualmente crio um campo não-base table chamado NOME_DEPTO, a<br />
informação dele (que será o nome de departamento) É POSSÌVEL de ser<br />
recuperada no banco só com as colunas da tabela base-table EMP, então<br />
poderei ordenar <br />
<br />
c) crio ** NO BANCO ** - não é no Forms !! - a seguinte função :<br />
<br />
FUNCTION BUSCA_NOME_DEPTO (P_DEPTO number) RETURN VARCHAR2 IS<br />
   v_nome_depto varchar2(80);<br />
BEGIN<br />
  select dname into v_nome_depto from dept where deptno=P_DEPTO;<br />
  return v_nome_depto;<br />
END;<br />
<br />
d) seja depois duma query, seja quando o item base table DEPTNO for<br />
alterado manualmente, quero buscar a descrição, assim crio a nível do<br />
campo DEPTNO uma trigger POST-CHANGE com o seguinte código :<br />
<br />
-- trigger POST-CHANGE<br />
:NOME_DEPTO := BUSCA_NOME_DEPTO(:DEPTNO);<br />
<br />
e pronto, a info será buscada. Usar a trigger POST-CHANGE (que<br />
funciona em ambos os casos) é ao invés da POST-QUERY (que só funciona<br />
pra queries) é técnica-padrão no Forms, mas não sei por que cargas<br />
dágua quando dava treinamento de Forms quase ** nenhum ** dos meus<br />
alunos a tinha usado antes :/<br />
<br />
<br />
e) finalmente : como já tinha dito em msg anterior , o que o Forms faz<br />
é montar um SQL com o nome dos campos, e adiconar o que estiver nas<br />
propriedades de WHERE e de ORDER BY - na situação-exemplo até agora, o<br />
SQL que seria  montado e enviado seria :<br />
<br />
SELECT ROWID,EMPNO,ENAME,SAL,DEPTNO FROM EMP<br />
<br />
até aqui, tamos seguros ??? Muito bem, no seu caso provavelmente<br />
ERRADAMENTE vc tascou na propriedade ORDER BY o texto :<br />
<br />
:nomedobloco.nomedocamponãobasetable<br />
<br />
assim sendo o SQL enviado pro banco foi :<br />
<br />
SELECT ROWID,EMPNO,ENAME,SAL,DEPTNO FROM EMP ORDER BY<br />
:nomedobloco.nomedocamponãobasetable<br />
<br />
==> eu PERGUNTO, isso é valido pro banco, o banco SABE o que é esse<br />
tal :nomedobloco.nomedocamponãobasetable pra odrenar por ele ?? Eu<br />
mesmo respondo, È CLARO QUE NÃO, esse<br />
:nomedobloco.nomedocamponãobasetable é algo que reside LÁ no Forms !!!<br />
<br />
Pra obter o efeito desejado, na propriedade OPRDER BY vc deve colocar :<br />
<br />
BUSCA_NOME_DEPTO(DEPTNO)<br />
<br />
vamos ver o SQL que será montado e enviado pro banco com esse cara :<br />
<br />
SELECT ROWID,EMPNO,ENAME,SAL,DEPTNO FROM EMP order by<br />
BUSCA_NOME_DEPTO(DEPTNO)<br />
<br />
==> eu pergunto, o banco SABE o que é esse BUSCA_NOME_DEPTO ??? SIM<br />
!!! Sabe o que é esse DEPTNO ? SIM, é uma COLUNA da tabela! Portanto<br />
ele PODERÁ ordenar por isso, o Forms IRÁ receber os regs ordenados...<br />
<br />
Feita a fofoca, obtido o efeito, capicce ?<br />
<br />
[]s<br />
<br />
 Chiappa<br />
<br />
<br />
===========================================================<br />
Participe do ENPO - Encontro de Profissionais Oracle 2006 ! <br />
Informações e inscrições em www.enpo-br.org<br />
José Laurindo Chiappa, Palestrante ENPO-2006<br />
===========================================================<br />
</description>
		<author> - Moderador Oracle_br (moderador@oraclebr.com.br)</author>
		<pubDate>Fri, 06 Oct 2006 00:00:00 -0300</pubDate>
		<guid>http://www.oraclebr.com.br/codigo/codigo.php?seq=29</guid>
		</item>
		<item>
		<title>Procedure para envio de e-mail's. Oracle 8.1.6 ou superior - Procedure</title>
		<link>http://www.oraclebr.com.br/codigo/codigo.php?seq=28</link>
		<description>/*********************************************************************************************<br />
 *** 'Mailhost' is the name of the remote host when connection is established. The port    ***<br />
 ***  number on which SMTP server is listening is usually 25.                              ***<br />
 ***                                                                                       ***<br />
 ***  Open_connection(): Allows open connection to an SMTP server.                         ***<br />
 ***  Helo(): Performs initial handshaking with SMTP server after connecting.              ***<br />
 ***  Mail(): Initiates a mail transaction with the server. The destination is a mailbox.  ***<br />
 ***  Rcpt(): Specifies the recipient of an email message.                                 ***<br />
 ***  Data(): Specifies the body of an email message.                                      ***<br />
 ***  Quit(): Terminates an SMTP session and disconnects from the server                   ***<br />
*********************************************************************************************/<br />
<br />
CREATE OR REPLACE PROCEDURE send_mail(  p_mailhost   IN VARCHAR2,<br />
                                        p_sender     IN VARCHAR2,<br />
                                        p_recipient  IN VARCHAR2,<br />
                                        p_subject    IN VARCHAR2,<br />
                                        p_message    IN VARCHAR2 ) IS<br />
<br />
   mail_conn UTL_SMTP.CONNECTION;<br />
         <br />
   crlf VARCHAR2( 2 ) := CHR( 13 ) || CHR( 10 );<br />
   mesg VARCHAR2( 1000 );<br />
<br />
BEGIN<br />
  mail_conn := UTL_SMTP.OPEN_CONNECTION( p_mailhost, 25 );<br />
       <br />
  mesg:= 'Date: '    || TO_CHAR( SYSDATE, 'dd Mon yy hh24:mi:ss' ) || crlf ||<br />
         'From:  <'  || p_sender || '>'                            || crlf ||<br />
         'Subject: ' || p_subject                                  || crlf ||<br />
         'To: '      || p_recipient                                || crlf ||<br />
         ''                                                        || crlf || <br />
         p_message;<br />
             <br />
  UTL_SMTP.HELO( mail_conn, p_mailhost );<br />
  UTL_SMTP.MAIL( mail_conn, p_sender );<br />
  UTL_SMTP.RCPT( mail_conn, p_recipient);<br />
  UTL_SMTP.DATA( mail_conn, mesg );<br />
  UTL_SMTP.QUIT( mail_conn );<br />
END;<br />
/<br />
</description>
		<author> - Moderador Oracle_br (moderador@oraclebr.com.br)</author>
		<pubDate>Sat, 02 Sep 2006 00:00:00 -0300</pubDate>
		<guid>http://www.oraclebr.com.br/codigo/codigo.php?seq=28</guid>
		</item>
</channel>
</rss>