Checking for table existence

M

Miha Markic

No. I am saying you can test within a very good degree of likelihood
whether or not the command will execute properly based on past experience
and empirical data.

Can't you read or something?

I can, it looks like you can't. You are pinging OS and based on that ping
you know to a *very good degree of likelihood* (translate that into binary
world of computers, please) that command against *database server* will
execute. Is your ping telling you that database service is running and
database service is ready to execute you command? Furthermore your silly
ping doesn't even tell if connection to database server is still valid.
 
G

Guru

Bill McCarthy said:
Actually I got it right, but thanks for playing.

The wise reader will notice that you snipped the proof that you didn't get
it right.
Your first post was wrong, in fact all the assumptions you've made on the
code you have posted have been wrong.

No proof provided, your claim fails. Bad luck, loser.
As to this particular issue, I suggest you learn how to follow a thread in
a news reader rather than stomp your little feet like a child and start
name calling.

So, how is that last paragraph of yours that much different to what you
claim I am doing? Hmmm?
 
G

Guru

Miha Markic said:
I can, it looks like you can't. You are pinging OS and based on that ping
you know to a *very good degree of likelihood* (translate that into binary
world of computers, please)

Sure... in a pinch. 8, 16 or 32-bit wide binary?

01010100 01101110 10100110 01001110 10011110 00000100 11100110 11110110
11110110 00100110 00000100 00100110 10100110 11100110 01001110 10100110
10100110 00000100 11110110 01100110 00000100 00110110 10010110 11010110
10100110 00110110 10010110 00010110 11110110 11110110 00100110 01010100
that command against *database server* will execute.

No, that is not what I claimed. Do you need me to quote the text and shove
it up your nostrils yet again?
Is your ping telling
you that database service is running and database service is ready to
execute you command?

How did you manage to get that silly question from what I wrote originally?
Furthermore your silly ping doesn't even tell if
connection to database server is still valid.

Even Blind Freddy knows that a ping won't tell you if the connection to a
database server is still valid, you utter moron.
 
M

Miha Markic

that command against *database server* will execute.
No, that is not what I claimed. Do you need me to quote the text and shove
it up your nostrils yet again?


How did you manage to get that silly question from what I wrote
originally?


Even Blind Freddy knows that a ping won't tell you if the connection to a
database server is still valid, you utter moron.


Please, reread what have you written before. How can one "test within a very
good degree of likelihood whether or not the command will
execute properly " without knowing the connection state?

1.
"> Although you know that connection might drop, you can't know in advance.

This statement is false.
Dim WithEvents Pong as New Ping()
Pong.Send(IPAddress)
Private Sub Pong_PingCompleted(ByVal sender As Object, ByVal e As _
PingCompletedEventArgs) Handles Pong.PingCompleted

If e.Reply.Status <> IPStatus.Success Then
GiveUP()
ElseIf e.Reply.RoundtripTime > 750 Then
TryAgainLater()
End If
End Sub"

2.
"If so, then you
know just as well as I do that your previous claim that "you can't test
whether the command will execute properly..." is patently false; you can
test within a very good degree of likelihood whether or not the command will
execute properly based on past experience and empirical data."

3.
"No. I am saying you can test within a very good degree of likelihood
whether
or not the command will execute properly based on past experience and
empirical data."
 
G

Guru

Miha Markic said:
Please, reread what have you written before<BITCHSLAP>

Why should I when I wrote it and you haven't read it once?

You're not trying to play semantics to save face are you?
 
M

Mladen

how about you just do:
select table_name from information_schema.tables where table_name =
'yourTableName'

this will return one row if the table exists and no rows if the table
doesn't exist.
no need for exception etc...
 
M

ML

If you throw a tennis ball at an outer wall of a house and it comes back, can
you say that any of the residents are in the house at that very moment?


ML
 
H

Herfried K. Wagner [MVP]

Miha Markic said:
Sure, but that's an exception :)
I mean, you can't test whether the command will execute properly due to
parameters out of your control. Although you know that connection might
drop, you can't know in advance. You are assuming there is a valid
connection which won't fail.
That's why there are exceptions.
BTW, now that I think of, in normal flow exceptions might come handy in
recursions.

Well, I just wanted to give an example where (statistically) the exception
is the most common case and the case of no exception is the exceptional one
;-).
 
H

Herfried K. Wagner [MVP]

Addendum:
Guru seems to be a troll. However, he is not completely wrong. Even
exceptions are very often for known situations. Imagine a connection to a
database which often (90 %) cannot be established due to a bad network
connection. In this situation you would set up an exception handler
because I know the problem at design time:

\\\
Try
<Attempt to connect>
Catch ex As ...
...
End Try
///

I forgot to mention that it depends on the object model if an exception is
required here. Instead of providing a method for setting up the connection
in the above example that throws an exception, the method could instead
return a status code or Status description object. However, the advantage
over that is that exceptions which are not caught or rethrown will arrive in
the calling methods until they are either catched or never handled.

The Win32 API (with very few exceptions), for example, didn't know the
concept of exeptions and used return values indicating success or error.
 
H

Herfried K. Wagner [MVP]

Guru said:
Then post your own.

Your proof which should give substance to your claims is flawed (Bill
explained why). No need for anybody except /you/ to provide a serious
proof.
 
G

Guru

ML said:
If you throw a tennis ball at an outer wall of a house and it comes back,
can
you say that any of the residents are in the house at that very moment?

If a tree falls in a forest and nobody hears it, does it mak a sound?
 
G

Guru

Herfried K. Wagner said:
Your proof which should give substance to your claims is flawed (Bill
explained why). No need for anybody except /you/ to provide a serious
proof.

LOL (Bill explained why) by writing a segment of code exactly has I had
written it, then snipped the proof when his idiocy was rammed into his
gormless face.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top