Posts by David Melo • 322 points
17 posts
-
0
votes1
answer25
viewsQ: Problems with get_blob using Cursor
I saved an image by turning it into a byte array, in a column in the Sqlite data-type byte. When I do a cursor to fetch this image from the bank using the class Cursor and the method get_blob(),…
-
3
votes3
answers1451
viewsA: View Oracle database data via Mysql
I only used it backwards, making the oracle access the tables in mysql through a DBLINK [https://hs2n.wordpress.com/2012/04/oracle-create-database-link-to-mysql-database/] Wouldn’t it be better for…
-
3
votes1
answer204
viewsQ: Consider the final term until the next day at 03 am using PLSQL
Guys, I need to do the following validation: When a record enters my database, I need to validate the effective date of this record. If the term is between the current date then the record is valid.…
-
2
votes3
answers8025
viewsA: Difference between decimal and Numeric
NUMERIC and DECIMAL types are implemented as the same type by Mysql, as permitted by the SQL92 standard. They are used for values for which it is important to preserve accuracy such as monetary…
-
2
votes2
answers1664
viewsA: UTL_SMTP: Sending Accents
You can create a Function that you pass a string and Function returns the string with the conversion in the default Ascii Code >127. Example: create or replace function converte(p_texto in…
-
1
votes1
answer2545
viewsA: Comparing data via Oracle Query
If I understood your question correctly, it would have to be something like this: The test checks if the value of the two columns is equal returns 1, if they are different returns 0(Zero). So all…
-
0
votes1
answer92
viewsA: How to fetch data from an Oracle sys_refcursor via PHP?
In php there is an OCI8 library, which is used for example for this type of problem. In php.net there is an example of how to use this type of return which is a type of data existing only in ORACLE.…
-
2
votes2
answers11707
viewsA: How, when and where to use PHP’s magic methods? Get and Set? What’s the difference? Should I use them in every class I create?
In object orientation GET and SET are used to encapsulate the class attribute so that it is not directly accessed. Creating the class: <?php class Aluno(){ private $nome; public function…
-
1
votes1
answer4207
viewsQ: Is there an API to work with QR code?
I need to read a QR code and check in an app I’m developing for Android. Is there any API ready to work with QR code?
-
1
votes3
answers633
viewsA: How to return the last query ID
Try it this way: SELECT MAX(idteste) ultimo_teste ,idaluno ,idmatricula ,ca.nome_aluno ,ca.escola FROM aluno ma INNER JOIN vw_consulta_alunos ca ON ca.idaluno = ma.idaluno INNER JOIN teste mt ON…
-
2
votes2
answers714
viewsA: Multiple Schemas on an Oracle Owner
ORACLE works differently. Creating a user is already associated with a schema with the same name. Here is an explanation of this: [http://oraclemais.blogspot.com.br/2008/10/o-que-um-schema.html]…
oracleanswered David Melo 322 -
0
votes4
answers2220
viewsA: How to select "1" or "2" depending on the column value, in PL/SQL?
Would that be: Select decode(TIPOCLIENTE,'CPF',1,'CNPJ',2,0) TIPOCLIENTE From tabela In this case, the value '0' zero will return if the value is different from CPF or CNPJ. You could also handle it…
-
0
votes2
answers6990
viewsA: CASE error in ORACLE’s WHERE
It would be something like that: AND CASE WHEN (t1.cd1 IS NOT NULL) THEN t2.cd1 ELSE t3.cd2 END = t1.cd2 In the first condition if t1.cd1 is not null, it brings the column t2.cd1, if t1.cd1 is null,…
oracleanswered David Melo 322 -
0
votes3
answers22309
viewsA: IF condition inside a WHERE - ORACLE PL/SQL
If to have the condition the two parameters should be informed, I think it solves: AND ( (in_cartao IS NOT NULL AND in_cpf IS NOT NULL AND a.cartao = in_cartao AND m.alt_member_id = in_cpf) OR…
-
3
votes4
answers33983
viewsA: How to copy column data from one table to another table
You can also do it with a for: BEGIN FOR rec IN (SELECT bk.email ,uc.id_consumidor FROM uc ,backup bk WHERE uc.idconsumidor = bk.idconsumidor) LOOP UPDATE uc SET uc.email = rec.email WHERE…
-
3
votes5
answers37379
viewsA: How to update with Oracle Inner Join
Can also be done with a sub-query in: UPDATE calculo_leituras_ucb clu SET clu.idnaoleitura = 0 WHERE clu.ano_mes = ('01/07/2014') AND clu.idnaoleitura = 24 AND clu.iduc IN (SELECT cd.iduc FROM…
-
3
votes2
answers3093
viewsA: PLSQL know the amount of records within a "for cursor"
Try it like this: BEGIN FOR r IN (SELECT COUNT(*) OVER() total_de_registros ,t.* FROM tabela t) LOOP .. .. .; END LOOP; END; In the above example, the clause COUNT(*) OVER() counts all records that…