logs archiveIRC Archive / Freenode / #oracle / 2015 / July / 17 / 1
KermitTheFragger
hi im trying to do something really simple; Add a procedure via sqlplus by pasting it
but somehow sqlplus spits out a lot of garbage numbers
im guessing its trying to be smart and make line numbers or something?
hali
yes, sql block line numbers
close the block with /
KermitTheFragger
is there anyway i can disable that obnoxious behavior?
the terminal doesn't understand it so the line numbers get sprayed all over the place
hali
set the correct termianl type in the pts before you launch sqlplus?
terminal*
KermitTheFragger
terminal type gets set by ssh, should be correct
petteja
save it to a file, and do @file
KermitTheFragger
petteja: thanks, ill give that a shot
petteja
should work
it it "hangs", close the block with / as hali said
MarkyC
I'm using the Oracle DB Developer VM. When I shut down and boot it back up, I get "The Network Adaptor could not establish the connection" when trying to connect. Can someone help me troubleshoot
         

MikeD_
select count(*) from table where datetimefield > someconstant <-- does that actually find and count rows or does it use the index on the datetimefield (one exists) to do metadata operations?
hmm. that's badly worded: "metadata operation" meaning not looking up the rows, but instead counting the pages/leaf entries in the index
Dormir
MikeD_: check the explain plan and see
yottabyte
hi guys, I want have this table and I want to see the count of rows for differently values, so I was doing select count(1) from RULES where ruleid=3; and changing the 3 to different things. Is there a way I can run the query for numerous ones all at once and get like 3 columns back?
like subqueries
MikeD_
where ruleid in ( 1, 2, 3)
yottabyte
but I want 3 columns
so I know howm any have ruleid 1, 2, 3, etc
this gets the total sum
Dormir
yottabyte: try using decode or case
MikeD_
do you need 3 columns or would you be happy with three rows?
yottabyte
MikeD_: 3 rows is fine
MikeD_
select ruleid, count(*) ... where ruleid in (1,2,3) group by ruleid
yottabyte
how do that work
and does it not show those that have 0 count?
yeah, apparently so
it doesn't show count 0 for those that have 0 count
MikeD_
how does it know what groups to count numbers for if there aren't any?
do you have a table that describes the ruleids themselves?
yottabyte
yeah
Xgc
yottabyte: Then just join with that ruleid table and GROUP BY that table.ruleid
yottabyte: Use an outer join./
retrospectacus
what is a "DSN" and a "TNSNAME" and why do they exist? what is wrong with a simple network hostname or IP
Xgc
retrospectacus: It's a way to hide the details of the connection and then connect by a simple alias without having to know anything else about the ip address / hostname / etc.
retrospectacus: You don't really want to sprinkle that detail around in individual applications and also don't want every development project to need to create their own method of caching their own alias mechanisms.
retrospectacus
maybe this app I am working on is especially poorly thought out in that regard
it is Access. Whenever anyone tries to use it, it doesn't work because they don't have this DSN and/or TNS set up right
MikeD_
btw, DSN can be exported from the registry and imported to another registry. It might be worth exporting individual keys so you could conceivably email the .reg file (inside your company, most likely) and all they have to do is double-click it and the DSN would work.
retrospectacus
that's cool
« prev