Welcome, Guest. Please Login.
05/12/25 at 16:10:23
News:
Home Help Search Login


Pages: 1
Send Topic Print
Column names with brackets (Read 3928 times)
pkoebbe
Browser
*


I'd rather be using
Linux.

Posts: 5
Column names with brackets
09/14/05 at 10:21:06
 
First, I am very new to DBA, Pervasive, and all that is related.  Last week new.  I've been assigned the task of modifying a Delphi 6 application to insert data into the DBA database.  This app has pulled data from it for over 6 months, but now they want to "backfeed" sales/purchase/work orders from our custom software.
 
My problem:
It appears to me that some fields have brackets in them.  The specific ones I'm dealing with are in the BKARINV_BNB table:
 
BKAR_INV_CUSA2[  1] and BKAR_INV_CUSA2[  2]
 
A SELECT * in PCC will bring them back just fine, but trying to SELECT just those fields will result in a syntax error.  I need to put data into these fields in my "backfeed".
 
The error is:
 
ODBC Error: SQLSTATE = 37000, Native error code = 0  
Syntax Error: SELECT "BKAR_INV_CUSA2"  1<< ??? >>""
 FROM BKARINV_BNB
 
I am have tried a number of delimiters, including double quotes, with no success.
 
System:
Windows XP SP2, Pervasive 2000i SP4, DBA 2002.4 with ISTS Update 1/16/04.
 
Not sure what else is needed.  Any help greatly appreciated.
 
Phillip
Back to top
 
 
  IP Logged
Kelloggs
Active Member
*****


Do crazy people know
they are crazy?

Posts: 784
Gender: male
Re: Column names with brackets
Reply #1 - 09/15/05 at 06:20:52
 
Try this:
 
SELECT  
BKAR_INV_NUM AS INV,
BKAR_INV_CUSCOD AS CUSTID,
BKAR_INV_CUSA2_1 AS CUSA2_1,
BKAR_INV_CUSA2_2 AS CUSA2_2
FROM BKARINV  
 
Smiley
 
Kelloggs
Back to top
 
 

Evo ERP - 35 Users
Dumped MS Access like a hot potato (VB.Net rules!!!)
Email WWW   IP Logged
pkoebbe
Browser
*


I'd rather be using
Linux.

Posts: 5
Re: Column names with brackets
Reply #2 - 09/15/05 at 08:56:42
 
Kelloggs,
 
Thank you very much for taking the time to thinking about this problem and respond.  Unfortunately, I get an error of "Invalid column name 'BKAR_CUSA2_1'"
 
Peace,
Phillip
Back to top
 
 
  IP Logged
Kelloggs
Active Member
*****


Do crazy people know
they are crazy?

Posts: 784
Gender: male
Re: Column names with brackets
Reply #3 - 09/15/05 at 12:16:07
 
Hi,
On you original posting you had:
 
Syntax Error: SELECT "BKAR_INV_CUSA2"  1<<  >>""  
 FROM BKARINV_BNB  
 
why is that you have name your table BKARINV_BNB??
 
Are you using  Pervasive Control Center to query the sql server?
 
Back to top
 
 

Evo ERP - 35 Users
Dumped MS Access like a hot potato (VB.Net rules!!!)
Email WWW   IP Logged
pkoebbe
Browser
*


I'd rather be using
Linux.

Posts: 5
Re: Column names with brackets
Reply #4 - 09/15/05 at 12:47:33
 
I don't know why the tables are named the way they are.  I work for a technology company that is writing some custom software for use in a manufacturing environment and our client uses DBA for their accouting.  I was introduced to all of this last week when my boss said, "I've been pulling data out of DBA for the past 6 or so months, now I want you to write the code to push stuff back to DBA.  Have fun!"
 
So I got DBA 2002.4 (with ISTS Update 1/16/04) and Pervasive.SQL 2000i (SP4) installed, dug into his source code, and away I went.  Until this problem.
 
To answer your question, yes the query is executed using PCC.  As a database application developer, I generally get all my queries working with the engines "native" query tool, then move it to my application.  If I can't get it working in the "native" query tool, why bother trying to get it working in my application, eh?
 
I'm somewhat perplexed by this issue, as according to the documentation that I've either looked at or been informed of, brackets are not allowed as part of column names.  I found a post yesterday that points to a spreadsheet that describes many of the file layouts for DBA, and according to it, the field in question is actually an array (which makes sense), but I can find no information about how to work with arrays.  In fact, I couldn't even find anything about arrays in Pervasive's documentation, so I'm pretty much stumped.
 
Thanks for the time,
Phillip
Back to top
 
 
  IP Logged
Kelloggs
Active Member
*****


Do crazy people know
they are crazy?

Posts: 784
Gender: male
Re: Column names with brackets
Reply #5 - 09/15/05 at 13:45:25
 
when you open the PCC and browse your databases
do the tables show the extension?
 
if that's the case there is something wrong with the PCC.
 
In our case the Tables do not show the extension.
 
what puzzle me is the fact that it was working.  ???
 
send me your phone to my email and i will call you.
 
Regards,
 
Kelloggs
Back to top
 
 

Evo ERP - 35 Users
Dumped MS Access like a hot potato (VB.Net rules!!!)
Email WWW   IP Logged
JaySchmitendorf
Browser
*


EVO-ERP, Electronic
Assembly Contract
Manufacturer

Posts: 31
Gender: male
Re: Column names with brackets
Reply #6 - 04/07/06 at 13:06:09
 
I always get the unusual column names by letting the Pervasive Control Center  do the work.
 
It will give you the table name when you open the table.
When you click on the text results tab on the bottom, it will produce a first line with copiable ( Ctrl C)  field names:   like  BKAR_INV_CUSA2_1.    
 
The first line of the query text box will contain the table name.
Back to top
 
 
WWW   IP Logged
wildco
Full Member
***


I love YaBB 1G -
SP1!

Posts: 174
Re: Column names with brackets
Reply #7 - 04/10/06 at 09:41:00
 
I had the same problem with another software package (UPS Worldship).  There is a way to fix it, I would suggest looking at the old entries in the forum related to UPS integration.  Basically, the DDF files and system /file DSN had to be deleted.  Then recreate system/file DSN with the OEM/ANSI box checked.  Then recreate your DDF's.
 
Make a backup of everything first and make sure everyone is off the system!
Back to top
 
 

Aaron

2004.1 with ISTECH 1/12/06
  IP Logged
dameng
Senior Member
****


DBA / EVO Software
Consultant

Posts: 275
Gender: male
Re: Column names with brackets
Reply #8 - 06/22/06 at 17:23:16
 
the DDF's that are designed to be used with the ODBC, do NOT contain the extensions, they only contain the File ( hence Table ) name.
 
if you incorrectly used the DDF's that are in the Root dir of DBAMFG, which are only for use by Maintain Database, those DDF's DO List the files WITH their extensions.
 
consequently, use the ODBC for both read and write access.  
 
also, the DDF's again in the Root of DBAMFG, correctly show the original file / field structure, which are those Field Names that the programmer did use [ ] for multiple instances of the same name/type field. ( old programming technique...)  
 
the DDFs that are used for ODBC, have corrected that idiosyncracy, by omitting the [], and substituting the underscore  _  .
 
i think you are using the wrong DDF's for your development connection. since you listed the BKARINV_BNB table. the ODBC would only list that as: BKARINV  since the DDF's would reside in the same directory as your *.BNB files.
 
also, an added side note, it's not recommended to write back to the database. however, if you do, "push" data back in, make sure you follow the same logic that the software follows, as if the user had entered the data in the appropriate entry screen in the software. if not, there will be problems with data information not sync'd.
 
to create the proper DDF's for your specific company. make sure you are logged into DBA or EVO, in the NB company, go to Utilities on the System Manager menu, UT-A run a DBA program, type in ODBCDDF.RUN
 
then on your server, create a SYSTEM DSN that points to those DDF's in the NB directory. then on your Client workstation, create a SYSTEM DSN that points to your Server's DSN.
 
then if you use the pervasive development tools, oledb, or create your own db connection string, you can choose to use the odbc, rather than specifying the full db server connection. either way, you do need to use those DDF's that are ODBC compliant.
 
HTH,
dave
Back to top
 
 

Dave Mengelkamp
Digital Consulting
760.832.2536
davemeng@earthlink.net
Email WWW   IP Logged
Pages: 1
Send Topic Print