rlarranaga / bafprp

Automatically exported from code.google.com/p/bafprp
0 stars 0 forks source link

MSSQL process problem #1

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Use this CL entry: bafprp BAF_2009-02-21_08h47_30_UTC -rmssql -
prdsn:dsnCDR -prdatabase:emerald5 -prserver:localhost -pruser:CDR -
prpassword:pw -prtable:callrecords -emssql -pedsn:dsnCDR -
pedatabase:emerald5 -peserver:localhost -peuser:CDR -pepassword:pw -
petable:callerrors -lmssql -pldsn:dsnCDR -pldatabase:emerald5 -
plserver:localhost -pluser:emerald -plpassword:pw -pltable:calllogs
2. Also tried the above with -p?server:JIMLAPTOP\SQLEXPRESS
3. Have tested the user id/pw on SQL Mgt Studio and when the DSN was 
created and both work

What is the expected output? 
Expected records to be posted to mssql tables callrecords, callerrors, etc
What do you see instead?
IM008:1:0:[Microsoft][SQL Native Client]Dialog failed
Failed to connect to the database: emerald5, ms sql output will not be 
available

What am i missing?  Do you have a sample MS command line?  I've attached 
the command line BAT and the output zipped.

TIA,

Jim

What version of the product are you using? On what operating system?

Please provide any additional information below.

Original issue reported on code.google.com by jschu...@ntslink.net on 7 Apr 2009 at 7:53

Attachments:

GoogleCodeExporter commented 9 years ago
Product is latest version 1.2 win32 running on XP SP3.

Original comment by jschu...@ntslink.net on 7 Apr 2009 at 8:40

GoogleCodeExporter commented 9 years ago
First thing I noticed right away is you might want to move the filename to the 
end of
the command.  That is the way I have always done it anyway :)  I am kinda 
surprised
that the command line parser did not complain about that tbh.

Another kinda extra thing is you need to supply either a dsn OR the
database/username/password/etc.  If you supply a dsn then the program does not 
need
anything else. (oh, but it does also need the table name)

Another thing I do is use 127.0.0.1 instead of localhost, but I do not think 
that
should matter.

I would maybe try using 127.0.0.1 and remove either the dsn property or the 
extra
login info stuff, that only serves to confuse the program.  But really I do not 
see
anything wrong with your commands at the moment.  I will have to take a deeper 
look
later this evening.

Here is the command I use in my scripts, has some extra stuff in there for file
output properties but its pretty much the same as what you are trying to do.

bafprp -prfilename:$main::log_dir\\".$filename."_record.log
-plfilename:$main::log_dir\\".$filename."_log.log
-pefilename:$main::log_dir\\".$filename."_error.log -rmssql -prserver:127.0.0.1
-prdatabase:plat -pruser:cdr -prpassword:password -prtable:callrecords -lmssql
-plserver:127.0.0.1 -pldatabase:plat -pluser:cdr -plpassword:password
-pltable:calllogs -emssql -peserver:127.0.0.1 -pedatabase:plat -peuser:cdr
-pepassword:password -petable:callerrors $file 

Original comment by charless...@gmail.com on 7 Apr 2009 at 8:55

GoogleCodeExporter commented 9 years ago
I tried your suggestions and modified the CL to:
bafprp -rmssql -prserver:127.0.0.1 -prdsn:dsnCDR -prtable:CallRecords -emssql -
peserver:127.0.0.1 -pedsn:dsnCDR -petable:CallErrors -lmssql 
-plserver:127.0.0.1 -
pldsn:dsnCDR -pltable:CallLogs BAF_2009-02-21_08h47_30_UTC

and still get this log back:
- 2009-04-07 16:14:15 ERROR: Failed to connect to the database, or you failed 
to 
supply a table, check your properties

Original comment by jschu...@ntslink.net on 7 Apr 2009 at 9:18

GoogleCodeExporter commented 9 years ago
Ok I did a little research on DSN connections and came up with the problem.  The
message you are getting 'Dialog Failed' means that it could not initiate a 
dialog box
to ask for a username and password.  
I put DSN connectivity in there for someone who requested it but I guess I did 
not
test it very well for MS SQL. (it worked fine in MySQL I swear ;p)  
Needless to say, DSN connections to MS SQL will not work with that version.  I 
will
have to update the program to include username and password with the 
connections.

To get your program to work, do not use the dsn property.  Remove that property 
and
add back in the database name, username, password, and server.  This will allow 
you
do connect to your database in the mean time.

Original comment by charless...@gmail.com on 7 Apr 2009 at 9:36

GoogleCodeExporter commented 9 years ago
This CL works for my SQL Express conncetion.  We prefer to use the connection 
info 
vs a DNS, so you don't have to fix the DSN dialog for us.

"bafprp BAF_2009-02-21_08h47_30_UTC -rmssql -prdatabase:emerald5 -
prserver:.\sqlexpress -pruser:CDR -prpassword:pw -prtable:CallRecords -emssql -
pedatabase:emerald5 -peserver:.\sqlexpress -peuser:CDR -pepassword:pw -
petable:CallErrors -lmssql -pldatabase:emerald5 -plserver:.\sqlexpress 
-pluser:CDR -
plpassword:pw -pltable:CallLogs"

Seems to work with listing the filename first.

I did notice that neither the originatingnumber (bigint default 0) or the     
terminatingnumber (bigint default 0) were populated.  Is that a problem with 
our 
input file or bafprp?  The file that I processed is attached above.

Again thanks for your help!

Jim

Original comment by jschu...@ntslink.net on 8 Apr 2009 at 1:51

GoogleCodeExporter commented 9 years ago
According to the text output your file is should be fine.  It handles the 
numbers
correctly.  
Try running the sql server profiler to find out what insert queries are being 
sent to
the database.  

Original comment by charless...@gmail.com on 9 Apr 2009 at 1:55

GoogleCodeExporter commented 9 years ago
i ran the profiler and here is a sample of the insert for a call:

"INSERT INTO CallRecords ( crc, elapsedtime, filename, filepos, originatingnpa, 
originatingnumber, overseasindicator, terminatingnpa, terminatingnumber) VALUES 
( '272183505', 
'18700', 'BAF_2009-02-21_08h47_30_UTC', '716', '309', '0', '1', '309', '0')"  
The originatingnumber & terminatingnumber are '0'.

I did run to text file and the result is correct.  I assume that it is related 
to MS 
SQL logic, because the same file input to MySQl works fine.  We do need MS SQL.

Jim

Original comment by jschu...@ntslink.net on 9 Apr 2009 at 2:26

GoogleCodeExporter commented 9 years ago
I have had a few changes in the trunk revision waiting for a new release and 
finally
got around to repackaging everything today after fixing the DSN bug.  The 0 
number
problem was something I fixed many months ago but left it sitting in the trunk 
and
never made a new release.  
Therefore, please download the newest bafprp v1.2.1, this will fix both of these
issues :)

Original comment by charless...@gmail.com on 9 Apr 2009 at 3:13