domenica 28 febbraio 2010

HTML TABLE - TABELLE

ESEMPIO:

<table border="1">
<thead>
<tr>
<th>Dipendente</th>
<th>Sottocategoria bene</th>
<th>Data richiesta</th>
<th>Motivazione</th>
<th>Esito</th>
</tr>
</thead>
<tbody>
<% while(rs.next()) { %>
<tr>
<td><%= rs.getInt("dipendente") %></td>
<td><%= rs.getString("sottocategoria_bene") %></td>
<td><%= rs.getDate("data") %></td>
<td><%= rs.getString("motivazione") %></td>
<td><%= rs.getString("esito") %></td>
</tr>
<% }
rs.close();
st.close();
%>
</tbody>
</table>


SINTASSI:

<table> apre la tabella. oppure: <table border="N"> apre una tabella con bordo "N".
<tr> "table row" apertura riga
<td> "table data" indica una cella all'interno di una riga.

ESEMPIO:
<table border="1">
<tr>
<td>prima cella</td>
<td>seconda cella</td>
</tr>

<tr>
<td>terza cella</td>
<td>quarta cella</td>
</tr>
</table>

sabato 27 febbraio 2010

TAG - HTML - menù a tendina

ESEMPIO:
<select name="regione">
while(rs.next()) {
<option value="<%= rs.getParameter("nome")%>"><%= rs.getParameter("nome")%>
}

INFO:
selezionando nome, si seleziona il rispettivo codice dentro il parametro regione nel GET/POST

ESEMPIO2:
<select name="nome">
<option value="1">Franco</option>
<option value="2">Mario</option>
<option value="3">Piero</option>
</select>
selezionando Mario, spedisci 2 dentro il parametro nome nel GET/POST

mercoledì 24 febbraio 2010

Confrontare Date SQL - ORACLE

ESEMPIO:

SELECT dotazione.* FROM dotazione, bene WHERE dotazione.dipendente=matricola' AND dotazione.bene=bene.numero_inventario_generico AND data_scadenza < (SELECT sysdate FROM dual)


SINTASSI DATA ATTUALE DI SISTEMA:

(SELECT sysdate FROM dual)


sabato 20 febbraio 2010

SQL - Oracle - formato data

Exsample Query:

insert into allocazione(codice, dipendente, gruppo_di_lavoro, data_inizio, data_fine) values (1, 1, 1, TO_DATE ('13-02-2010', 'DD-MM-YYYY'), TO_DATE ('13-03-2010', 'DD-MM-YYYY'))


format date:

TO_DATE ('13-02-2010', 'DD-MM-YYYY')