| | |
Help cursor/procedure
Please support our Oracle advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Oct 2009
Posts: 24
Reputation:
Solved Threads: 0
Hi! I need a great favor... if someone could help i really appreciate...
heres the deal:
i made one year ago a webpage with a database on isQL*plus (pl/sql) language..
on my webpage i have this (i will show images to you understand better what i mean):
http://img36.imageshack.us/img36/578...rjogadores.jpg
code:
and when i click on the "Editar" (means edit) button (check the image), i enter on this:
http://img203.imageshack.us/img203/3...tarjogador.jpg
Code:
You understand what i'm making? i click on button to edit a player, that i choose from his id...
NOW, my problem is that i'm making a webpage but with a database on postgreSQL (PL/pgSQL) and the page is in PHP, i wanted to make something like that i made on that page...
In short: i want to show a page with my table with my client's name and when i click on the button that is in front of each name, i want to open a new page (sending that client ID), so on the next page i can edit them...
Thanks
heres the deal:
i made one year ago a webpage with a database on isQL*plus (pl/sql) language..
on my webpage i have this (i will show images to you understand better what i mean):
http://img36.imageshack.us/img36/578...rjogadores.jpg
code:
Oracle Syntax (Toggle Plain Text)
PROCEDURE gerir_jogadores IS CURSOR c_jogadores IS SELECT * FROM jogadores, equipas, tipoposic WHERE joga_equi_id = equi_id AND joga_tipoposic_id = tipoposic_id; BEGIN htp.p('<html>'); htp.p(' <body style="background-color: #339F2A;"> <h2>JOGADORES</h2> <table width="100%" border="1"> <tr> <th>Nome</th> <th>Data Nascimento</th> <th>Local Nascimento</th> <th>Nacionalidade</th> <th>Posição</th> <th>Personalidade</th> <th>Equipa</th> <th> </th> </tr> '); -- Cursor para preencher tabela com os resultados da tabela jogadores FOR r_jogadores IN c_jogadores LOOP htp.p('<tr>'); htp.p('<td align="center">'||r_jogadores.joga_nome||'</td>'); htp.p('<td align="center">'||to_char(r_jogadores.joga_data_nsc,'dd.mm.yyyy')||'</td>'); htp.p('<td align="center">'||r_jogadores.joga_local_nsc||'</td>'); htp.p('<td align="center">'||r_jogadores.joga_nacionalidade||'</td>'); htp.p('<td align="center">'||r_jogadores.tipoposic_posicao||'</td>'); htp.p('<td align="center">'||r_jogadores.joga_personalidade||'</td>'); htp.p('<td align="center">'||r_jogadores.equi_nome||'</td>'); htp.p('<td align="center"><input type="button" value="Editar" onclick="window.location=''est.form_editar_jogador?p_joga_id='||r_jogadores.joga_id||''';"></td>'); htp.p('</tr>'); END LOOP; htp.p('<tr><td align="center" colspan="11"><input type="button" value="Criar Novo Jogador" onclick="window.location=''est.form_inserir_jogador'';"></td></tr>'); htp.p('</table>'); htp.p('<br></br><br></br><br></br><p align="center"><input type="button" value="Voltar" onclick="window.location=''est.home'';"></p>'); htp.p('</body></html>'); END;
and when i click on the "Editar" (means edit) button (check the image), i enter on this:
http://img203.imageshack.us/img203/3...tarjogador.jpg
Code:
Oracle Syntax (Toggle Plain Text)
PROCEDURE form_editar_jogador(p_joga_id IN NUMBER) IS CURSOR c_jogadores IS SELECT * FROM jogadores WHERE joga_id = p_joga_id; CURSOR c_tipoposic IS SELECT * FROM tipoposic; r_jogadores c_jogadores%ROWTYPE; BEGIN OPEN c_jogadores; FETCH c_jogadores INTO r_jogadores; CLOSE c_jogadores; htp.p('<html>'); htp.p(' <body> <h2>Alterar/Apagar Jogador </h2> <form action="est.actualizar_jogador" method="post"> <input type="hidden" name="p_joga_id" value="'||r_jogadores.joga_id||'"> <table> <tr> <td>Nome:</td><td><input type="text" size="50" name="p_joga_nome" value="'||r_jogadores.joga_nome||'"></td> </tr> <tr> <td>Data de Nascimento:</td><td><input type="text" size="10" name="p_joga_data_nsc" value="'||to_char(r_jogadores.joga_data_nsc,'dd.mm.yyyy')||'"></td> </tr> <tr> <td>Local de Nascimento:</td><td><input type="text" size="50" name="p_joga_local_nsc" value="'||r_jogadores.joga_local_nsc||'"></td> </tr> <tr> <td>Nacionalidade:</td><td><input type="text" size="50" name="p_joga_nacionalidade" value="'||r_jogadores.joga_nacionalidade||'"></td> </tr> '); htp.p('<tr><td>Posição:</td><td><select name="p_joga_tipoposic_id">'); FOR r_tipoposic IN c_tipoposic LOOP htp.p('<option value="'||r_tipoposic.tipoposic_id||'"'); IF r_jogadores.joga_tipoposic_id = r_tipoposic.tipoposic_id THEN htp.p(' selected '); END IF; htp.p('>'||r_tipoposic.tipoposic_posicao); END LOOP; htp.p('</select></td></tr>'); htp.p(' <tr> <td>Personalidade:</td><td><input type="text" size="50" name="p_joga_personalidade" value="'||r_jogadores.joga_personalidade||'"></td> </tr> <tr> <td align="center" colspan="2"> <input type="submit" value="Alterar">  <input type="button" value="Apagar" onclick="window.location=''est.apagar_jogador?p_joga_id='||r_jogadores.joga_id||''';">  <input type="button" value="Voltar" onclick="window.location=''est.gerir_jogadores'';"> </td> </tr> </table> </form> </body> </html> '); END;
You understand what i'm making? i click on button to edit a player, that i choose from his id...
NOW, my problem is that i'm making a webpage but with a database on postgreSQL (PL/pgSQL) and the page is in PHP, i wanted to make something like that i made on that page...
In short: i want to show a page with my table with my client's name and when i click on the button that is in front of each name, i want to open a new page (sending that client ID), so on the next page i can edit them...
Thanks
![]() |
Similar Threads
- help in stored procedure-result of a loop using cursor (MS SQL)
- Maximum stored procedure, function, trigger, or view nesting level exceeded(limit 32) (MS SQL)
- Cursor within cursor problem (Oracle)
- Cursor%FOUND problem (Oracle)
- Help With Delphi Petrol Pump Logic. (Pascal and Delphi)
- select statement in a procedure (Oracle)
Other Threads in the Oracle Forum
- Previous Thread: sql using oracle
- Next Thread: last modified date of a table
| Thread Tools | Search this Thread |
Tag cloud for Oracle
2009predictions acquisition amazon.com bartz bernanke cia citrix cloudcomputing crm database dell economy editor enterprise enterprise2.0 enterprisesoftware erp federalreserve forbes hp ibm intellipedia internet larryellison layoffs linux loughridge mediawiki michaeljackson microsoft neverland nortel notebooks oil operatingsystem oracle palm rimm saas salesforce sap seagate socialcomputing sql sun sybase technologystocks virtualiron virtualization vmware wiki wikipedia xen yahoo zoho





