Posts by Harry • 709 points
37 posts
-
0
votes1
answer64
viewsQ: Linux - incorrect result with find and xargs command
I’m trying to list the files of the last day, but through the command below it lists the files of the last day and then starts to list all the files: [oracle@orcl11 adump]$ find . -ctime -1 | xargs…
-
0
votes1
answer924
viewsQ: PL/SQL - Record Type vs Rowtype
When to use a record type, defined by the programmer, rather than declaring a variable of type %rowtype? ex: /**Definido pelo usuário**/ declare type bbb is record( id int, nome varchar(100)); v…
-
0
votes1
answer69
viewsQ: Lock in SQL Server and Oracle
Hi, I’ve been running some lock tests on SQL Server and noticed a difference from Oracle. In oracle I did an update on a line without effecting commit or rollback and in another session I was able…
-
0
votes2
answers114
viewsQ: Programming logic - Constant
If I create a variable int x = 10 and not alter it throughout the code it is considered a constant? or is only considered a constant if I use a reserved word of the language for example: final int x…
-
0
votes1
answer485
viewsQ: LINUX - how to use a string as a delimiter in the cut command
How do I use a string in the cut? command: cut -d"String" -f1 but he says it is only possible with a single character.
-
2
votes2
answers229
viewsQ: How to use the WHERE clause on top of a column made from row_number() over()
I’m trying to use Where on top of a column generated by row_number but it doesn’t work; it’s possible to do this?
-
2
votes1
answer239
viewsQ: Is it possible to inherit a python class without writing all attributes in the definition?
I have the following example code: from Testes import POO class Fisica(POO.Cliente): def __init__(self,sexo,nome,idade): super().__init__(nome,idade) self.sexo = sexo Note that the name and age…
-
0
votes1
answer376
viewsQ: Block comments on bash script
I need to comment on a code block and found the following way it worked: <<COMENTÁRIO meus comentários aqui... ... COMENTÁRIO I wonder if this is the right way to do it, I read on a website…
-
2
votes2
answers908
viewsQ: Python - Transforming lists into a single list
How can I turn a list into a single list? I need to turn this: lista = [["Danilo","Gilson"],["Eduarda",["Costa","Otávio"]]] therein: lista = ["Danilo","Gilson","Eduarda","Costa","Otávio"]…
-
2
votes1
answer185
viewsQ: How to access a protected attribute of a package in another package?
I have the animal pack with two attributes: name and rating. package heranca; public class Animal{ protected String nome = "Leão"; protected String tipo= "Mamífero"; } ... And I have another test…
-
1
votes2
answers7309
viewsQ: How to concatenate items from a python list?
Let’s say I got the result of a list: ['_', '_', '_', '_', '_', '_', '_'] how can I turn her into this?: ['_ _ _ _ _ _ _'] Or even in a variable with the above value…
-
2
votes3
answers2206
viewsQ: How to not return a None value in Python?
I have the following example code: lista = [100,200,1000,3000,2,3,4,5,6,7,8] def regras(x): if x < 100: if x % 2 == 0: return x if x >= 100: return (x+x) v1 = list(map(regras,lista)) print(v1)…
-
1
votes1
answer387
viewsQ: Exit command in PL/SQL
I noticed the command exit works like a break, it stops running the current block and switches to the next one, but which command can stop the whole procedure in PL/SQL?
-
1
votes1
answer62
viewsQ: How to view the columns of a system view in SQL Server?
Well I come from Oracle culture and want to learn about SQL Server. I would like to know how I see the columns of a system view, for example: I tried with sp_help teste.INFORMATION_SCHEMA.ROUTINES…
-
1
votes2
answers183
viewsQ: How to get the Exit code from a command block
Suppose I have the following commands in a script susd systemctl status firewalld If I look at the exit code through echo $? it returns 0 because the last command was executed successfully, but how…
-
2
votes1
answer1137
viewsQ: How do auto increment in Mysql without declaring columns in INSERT?
I noticed that when I have a column with auto_increment, I have to declare the columns on INSERT. For example, I created this test table: create table teste( id int auto_increment, nome varchar(100)…
-
0
votes1
answer41
viewsQ: User connection location in Mysql or Mariadb
It is recommended that I change a user’s connection location from the table mysql.user? For example, I create a user 'danilo'@'localhost' but then I want it to connect from any machine, there’s…
-
1
votes1
answer203
viewsQ: How to redirect the entire bash script within the script itself?
I need to throw his output into a file instead of playing on the default output which is the screen but without me having to spell it out with the command >> in the terminal, I want the script…
-
0
votes0
answers87
viewsQ: PL/SQL - how to see the amount of lines manipulated through a Rigger?
I already tried with the sql%rowcount but when it’s a Rigger it just doesn’t work.. how can I return the number of lines manipulated in a DML instruction from a Trigger?
-
2
votes1
answer1549
viewsQ: How to search for an exact word with the grep command
Well, whenever I use the grep command he looks for a word that contains the desired word + anything, how can I make him understand that I just want that word and nothing else? ex: ps aux|grep bc…
-
3
votes1
answer79
viewsQ: How do a script accept bash script completion?
Let’s say I have a script that asks for a user input as shown below Digite o caminho do arquivo: How do I make this input autocomplete the directory path in linux? I need this to avoid typos…
-
0
votes1
answer1219
viewsQ: I need explanations of OUT mode and INOUT PL/SQL and Mysql Procedure
Well, I put PL/SQL and mysql because these two modes have in the procedures both Oracle and mysql but anyway.. The IN mode I understood that it works as a Constant, it is passed by the parameter and…
-
3
votes1
answer55
viewsQ: How to scan a linux file based on creation time?
I am mounting a backup script and need to create a scan to analyze if any file in a folder was created in the last 7 days, what is the path to it? I know the command ls -lt lists the files in the…
-
2
votes1
answer482
viewsQ: Scroll through an array bash script
Can someone give me an example of an if and case running through an array in bash script? I’m just finding an example of what it’s for to list the items.. I’m trying to make sure ex: v1=("sim" "s"…
-
0
votes2
answers131
viewsQ: Error of logica shell script
I want to print on the screen a message according to the current time of the day but it always falls on Is, what would be the mistake? It’s 1:00 and I don’t understand what the mistake is.…
-
3
votes2
answers4327
viewsQ: How to compare the value of a variable to a string in the shell script
Well, I’m trying to make a comparison like this but bash is playing it like a command if "$V1" = "sim" then ... how I compare the value of V1 to the string "yes":…
-
0
votes2
answers241
viewsQ: Automation of tasks in linux
Well, I already know python and I know she’s very good at working with scripts and task automation but my question is, i can work comfortably with administration and automation of linux and database…
-
0
votes2
answers84
viewsA: How do I remove a git file with word spacing?
I just found the solution in case someone is having the same doubts, where there is space you must place a \ similar to linux ex: Novo\ Documento\ de\ Texto.txt…
-
-2
votes2
answers84
viewsQ: How do I remove a git file with word spacing?
Well, I managed to remove a file without spacing xd.txt but when I created my first file Novo Documento de Texto.txt it came with space and so the command is not working What can I do?…
-
6
votes1
answer662
viewsQ: SQL Server Data Dictionary
Hello, I come from Oracle culture and want to learn a little SQL Server, I’m having difficulty finding the data dictionary of SQL Server, I’ve searched in other forums and found nothing. In Oracle…
-
5
votes1
answer9144
viewsQ: UPDATE WITH CASE SQL
Is there any way I can use more than one column of the same table in a case statement in an update? for example, I have this table with these 3 lines create table produto2( codigo int primary key,…
-
1
votes1
answer484
viewsQ: Variable without pl/sql value
I tried to run this pl/sql but it didn’t work declare v teste%rowtype; begin v.ra; select ra into v.ra from teste where nome = 'Danilo'; dbms_output.put_line(v.ra); end; after a long time I decided…
-
1
votes1
answer102
viewsQ: POO and programming languages
I see thousands of courses talking about learning object-oriented programming, but when you learn POO you can apply that knowledge in all the languages that use POO or each language has its…
-
1
votes1
answer1902
viewsQ: how to add different record values?
I’m trying to add the value of id 1 and the value2 of id 2 which in this case would be equal to 220, as I do this consultation? ID VALOR VALOR2 ---------- ---------- ---------- 1 110 100 2 100 110…
-
1
votes1
answer36
viewsQ: Problem in SQL selection
Why even if I filter to return only the fiat manufacturer, keeps returning other values? SELECT FABRICANTE, MODELO, VALOR_DIARIA FROM VEICULO WHERE VALOR_DIARIA = (SELECT MIN(VALOR_DIARIA) FROM…
-
1
votes2
answers953
viewsA: How to use strip() next to a list or tuple in python?
I understood my own mistake, in case someone is having that same doubt. sim = ('S','Y') nao = ('N') v1 = str(input('Digite sim ou não ')).strip()[0].upper() if v1 in sim: print('você digitou sim ')…
python-3.xanswered Harry 709 -
2
votes2
answers953
viewsQ: How to use strip() next to a list or tuple in python?
I am creating a script and in a snippet I create a list and then use the strip() function next to the upper() inside the v1 input, but when calling the script and executing it does not return…
python-3.xasked Harry 709