sábado, 17 de março de 2007

Firebird Update


Índice

Veja a Tabela CADASTRO abaixo:

NOME ENDERECO TELEFONE CIDADE
FABIANA RUA SERGIPE, 233 222 5534 BELO HORIZONTE
SUELI RUA DA BAHIA, 1234 339 1100 BELO HORIZONTE
ALESSANDRA AV. AFONSO PENA, 600 465 2211 BELO HORIZONTE
WAGNER AV. PAULISTA, 200 211 1213 SAO PAULO
RIVA RUA MARIANA, 428 550 1133 FORTALEZA
REGINA AV. CRISTOVAO COLOMBO, 4000 600 2299 PORTO ALEGRE

Usando o comando Update:
O comando Update, altera os campos da sua tabela.

Update Cadastro
set nome = "JOSE";
Faça um select, e voce obterá o seguinte resultado:

NOME ENDERECO TELEFONE CIDADE
JOSE RUA SERGIPE, 233 222 5534 BELO HORIZONTE
JOSE RUA DA BAHIA, 1234 339 1100 BELO HORIZONTE
JOSE AV. AFONSO PENA, 600 465 2211 BELO HORIZONTE
JOSE AV. PAULISTA, 200 211 1213 SAO PAULO
JOSE RUA MARIANA, 428 550 1133 FORTALEZA
JOSE AV. CRISTOVAO COLOMBO, 4000 600 2299 PORTO ALEGRE

Observe que se voce não define o registro que deseja alterar,
a query mudará todos os nomes para JOSE.
Para voce alterar somente um registro, voce deverá incluir uma condição:

Update Cadastro
set nome = "JOSE" where nome = "RIVA";
Faça um select, e voce obterá o seguinte resultado:

NOME ENDERECO TELEFONE CIDADE
FABIANA RUA SERGIPE, 233 222 5534 BELO HORIZONTE
SUELI RUA DA BAHIA, 1234 339 1100 BELO HORIZONTE
ALESSANDRA AV. AFONSO PENA, 600 465 2211 BELO HORIZONTE
WAGNER AV. PAULISTA, 200 211 1213 SAO PAULO
JOSE RUA MARIANA, 428 550 1133 FORTALEZA
REGINA AV. CRISTOVAO COLOMBO, 4000 600 2299 PORTO ALEGRE


Firebird Insert


Índice
Veja a Tabela CADASTRO Abaixo:

NOME ENDERECO TELEFONE CIDADE
FABIANA RUA SERGIPE, 233 222 5534 BELO HORIZONTE
SUELI RUA DA BAHIA, 1234 339 1100 BELO HORIZONTE
ALESSANDRA AV. AFONSO PENA, 600 465 2211 BELO HORIZONTE
WAGNER AV. PAULISTA, 200 211 1213 SAO PAULO
RIVA RUA MARIANA, 428 550 1133 FORTALEZA
REGINA AV. CRISTOVAO COLOMBO, 4000 600 2299 PORTO ALEGRE


Usando o comando Insert:
O comando Insert, insere novos dados na tabela.

Insert into Cadastro
values ("CARLOS","RUA ICARAI, 890","339 1212","BELO HORIZONTE");

Voce vera o resultado, fazendo um select:
Select * from Cadastro;
Resultado:

NOME ENDERECO TELEFONE CIDADE
FABIANA RUA SERGIPE, 233 222 5534 BELO HORIZONTE
SUELI RUA DA BAHIA, 1234 339 1100 BELO HORIZONTE
ALESSANDRA AV. AFONSO PENA, 600 465 2211 BELO HORIZONTE
WAGNER AV. PAULISTA, 200 211 1213 SAO PAULO
RIVA RUA MARIANA, 428 550 1133 FORTALEZA
REGINA AV. CRISTOVAO COLOMBO, 4000 600 2299 PORTO ALEGRE
CARLOS RUA ICARAI, 890 339 1212 BELO HORIZONTE

Firebird Select

Índice
Usando o comando Select:
O comando Select, seleciona os dados especificados da tabela.
Quando voce usa *, selecionará todos os campos da tabela.
Voce pode selecionar campos determinados também.

Select * from Cadastro;
Resultado:

NOME ENDERECO TELEFONE CIDADE
FABIANA RUA SERGIPE, 233 222 5534 BELO HORIZONTE
SUELI RUA DA BAHIA, 1234 339 1100 BELO HORIZONTE
ALESSANDRA AV. AFONSO PENA, 600 465 2211 BELO HORIZONTE
WAGNER AV. PAULISTA, 200 211 1213 SAO PAULO
RIVA RUA MARIANA, 428 550 1133 FORTALEZA
REGINA AV. CRISTOVAO COLOMBO, 4000 600 2299 PORTO ALEGRE

Selecionando alguns itens:

Select nome, endereço from cadatro;
Resultado:

NOME ENDERECO
FABIANA RUA SERGIPE, 233
SUELI RUA DA BAHIA, 1234
ALESSANDRA AV. AFONSO PENA, 600
WAGNER AV. PAULISTA, 200
RIVA RUA MARIANA, 428
REGINA AV. CRISTOVAO COLOMBO, 4000


Tutorial de SQL


Structure Query Language (SQL)
  1. Para acesso a um banco de dados relacional, é necessário uma linguagem. A SQL é uma linguagem usada pela maioria dos bancos de dados relacionais.

  2. É uma linguagem baseada no inglês, fácil de escrever, ler e entender.

  3. SQL tem como características, a economia de tempo, flexibilidade e segurança na manutenção de bancos de dados.

  4. Existem pequenas diferenças da linguagem, em alguns bancos.
    1. No VisualFox por exemplo, quando o comando ocupa mais de uma linha, devemos colocar ponto e vírgula no final de cada linha, e no final do comando somente um enter.
    2. No oracle, ao contrário, devemos colocar um ponto e vírgula somente no final do comando, mesmo que este ocupe mais de uma linha.
    3. Estou usando a nomenclatura do Oracle e/ou FireBird, nestes exemplos.
1. Funções definidas pelo padrão SQL:
  • SELECT
  • INSERT
  • WHERE
  • UPDATE
  • DELETE
  • CREATE
  • ALTER
  • DROP
  • DISTINCT
  • ORDER BY
  • GROUP BY
  • SUM
  • MAX
  • MIN
  • AVG
  • JOIN
  • UNION
  • SUBQUERY
  • ALIAS
  • CONCATENACAO
  • NVL
  • BETWEEN
  • IN

Índice

  1. Introdução
  2. Select
  3. Insert
  4. Update
  5. Delete
  6. Where
  7. Create Table
  8. Alter Table
  9. Drop Table
  10. Distinct
  11. Order By
  12. Group By
  13. SUM
  14. MAX
  15. MIN
  16. AVG
  17. UNION
  18. Sub-Query
  19. Alias
  20. Concatenação
  21. NVL - Oracle
  22. Between
  23. IN



quarta-feira, 14 de março de 2007

DB Extract 2005 v.2.2 released

IB/FB Product News

03/13/2007

DB Extract 2005 v.2.2 released

We are pleased to announce new version of DB Extract 2005 - the powerful utility creating database backups in a form of SQL scripts for SQL Server, MySQL, PostgreSQL, InterBase/Firebird, Oracle and DB2 databases.

What’s new in DB Extract version 2.2?

  1. DB Extract for Oracle released. UTF-8 and SSH tunneling support implemented.
  2. DB Extract for DB2 released.
  3. Objects extraction algorithm considering object dependencies has been improved (ALL)
  4. Considerably increased data extraction speed (ALL)
  5. SSH tunneling support is improved: Private Key support for SSH authentication is implemented (IB/FB, MySQL, PostgreSQL, Oracle)
  6. Extraction of BLOBs is now possible (IB/FB, MS SQL, PostgreSQL)
  7. Extraction of Arrays is now possible (IB/FB, PostgreSQL)
  8. “Delete records before insert” option now uses the TRUNCATE command to empty tables instead of DELETE command (MS SQL).
  9. Additional extract options implemented (ALL)
  10. More user-friendly wizard interface (ALL).

You can download DB Extract 2.2 from the following links:
DB Extract 2005 for MySQL:
http://www.sqlmanager.net/products/mysql/extract/download

DB Extract 2005 for PostgreSQL:
http://www.sqlmanager.net/products/postgresql/extract/download

DB Extract 2005 for SQL Server:
http://www.sqlmanager.net/products/mssql/extract/download

DB Extract 2005 for InterBase/Firebird:
http://www.sqlmanager.net/products/ibfb/extract/download


DB Extract 2005 for Oracle:
http://www.sqlmanager.net/products/oracle/extract/download

DB Extract 2005 for DB2:
http://www.sqlmanager.net/products/db2/extract/download

We hope you'll enjoy working with our products.

© 1999-2007 EMS Database Management Solutions, Inc. All rights reserved.

quinta-feira, 8 de março de 2007

Data Import v.3.0 released

Data Import v.3.0 released

We are pleased to announce new version of EMS Data Import, a powerful tool to import your data quickly from MS Excel 97-2007, MS Access, DBF, XML, TXT, CSV, MS Word 2007, ODF and HTML files.

EMS Data Import version 3.0 is now available and can be downloaded from the download pages:

We have also released new Data Import for Oracle. You can learn more at the product info page and download the free trial version.

Upgrade to Data Import version 3.0

The upgrade fee will normally be 50% of the standard product price.

All customers who purchased Data Import within 60 days of the major upgrade release are eligible for a free major upgrade. However, there is a small fee for processing the upgrade request and generating a new registration key.

We would like to bring it to your attention that from this version on the EMS Data Import is sold with Maintenance under EMS Software Maintenance Program (read full information on Maintenance at our Maintenance FAQ). One year of Maintenance is already included in Data Import for free!

What’s new in Data Import version 3.0

  1. The new “Native” method of import is added which includes two algorithms – Single Commands and Batch Insert. Single Commands mode serves to generate and execute single SQL commands on the server; whereas Batch Insert uses native commands for a particular server: BULK INSERT (SQL Server), LOAD DATA INFILE (MySQL) and COPY (PostgreSQL). With the help of Native mode your data can be imported dozen (!) times faster compared to Universal mode which was used in the previous versions.
  2. Unicode support. Now you are able to import Unicode data (for SQL Server, MySQL, PostgreSQL).
  3. Import from new formats is available now:
    • MS Excel 2007
    • MS Word 2007
    • HTML
    • Generic XML
    • Open Document Format (Open Document Text and Open Document Spreadsheet)
  4. Now there is a short field type description next to field names that appear in different lists. This option is enabled by default. When necessary, it can be disabled from Tools>Preferences.
  5. Utility source code significantly optimized, work speed increased.
  6. Identity fields support implemented (for SQL Server).
  7. Ability to import data from text files containing TAB symbols as a separator is added.
  8. Other small improvements and bugfixes.
We hope you'll enjoy working with our products!

© 1999-2007 EMS Database Management Solutions, Inc. All rights reserved.
Thank you for choosing EMS!

Neobux