Discussion:
INSERT INTO...SELECT Issue - SOLVED!!!
Paul H. Tarver
2018-04-20 15:00:08 UTC
Permalink
Apparently, all of the SQL sins covered by the ODBC driver with the '*'
wildcards are laid bare when you start trying to expand your SQL command
with explicit field statements.

Before I got Ted's message, I tried to delimit fieldnames with brackets like
'[abc]' and I got a new ODBC error indicating I had created a circular
reference. After I got Ted's email I tried again with the backtick '`abc`'
and again got the circular reference error.

On a whim, I decided to add an alias to the table (ie: sheet) name and then
update the field names to the full bracketed column name notation
'[xs].[abc]' along with the table/sheet alias in the query and incredibly it
worked! Of course I was still in the development environment at the time, so
I quickly compiled the new code to an exe and it worked there too! The
relevant section of the query with the troublesome field now looks like
this: "..., [xs].[3rdPartySickPay] AS xrdPartySickPay,..."

Upon running the code with another Excel spreadsheet, I got a new error that
was related to the fact that the column name aliases were the same as the
original fieldnames unless the first character was a digit. Upon review, I
just changed the program so that an underscore is added to the original
column name which eliminates the need to check for first digits or keywords
or uniqueness. Additional checks can be added going forward, but this is the
fastest solution that covers multiple potential issues. Since these column
headers are only used during the import process and are discarded after
control is returned to the original program, the column name is irrelevant.

So I've now have the code working to make Craig Boyd's AppendXLSX.prg work
with column headers that start with numeric values instead of alpha
characters. I'm sure my code could use some refining, but my modifications
are now working in both development and compiled versions.

If anyone is interested in getting a copy of the modified version of
APPENDXLSX.prg, you can get it at https://pastebin.com/wxDnwFw2. Changes
start on line 110 and go through line 170. Or you can just email me at paul
AT tpcqpc DOT com.

Paul

-----Original Message-----
From: ProfoxTech [mailto:profoxtech-***@leafe.com] On Behalf Of Ted
Roche
Sent: Thursday, April 19, 2018 3:32 PM
To: ***@leafe.com
Subject: Re: INSERT INTO...SELECT Issue
"[Microsoft][ODBC Excel Driver] Syntax error (missing operator) in
query expression '3rdPartySickPay'."
Unsurprisingly, ODBC thinks it's a dumb name for a field, too.

You'll probably need to "escape" it. I'm decades out of ODBC, so I
don't recall if ODBC wants you to enclose the field name in single
quotes, square brackets or back ticks (that `` funny key in the upper
left corner no one ever uses). A web search might yield a suggestion,
or you can just try the Usual Suspects...
--
Ted Roche
Ted Roche & Associates, LLC
http://www.tedroche.com

[excessive quoting removed by server]

_______________________________________________
Post Messages to: ***@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/19ce01d3d8b8$461ca1e0$d255e5a0$@tpcqpc.com
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Ted Roche
2018-04-20 15:50:08 UTC
Permalink
Post by Paul H. Tarver
On a whim, I decided to add an alias to the table (ie: sheet) name and then
update the field names to the full bracketed column name notation
'[xs].[abc]' along with the table/sheet alias in the query and incredibly it
worked!
I'd like to nominate you for the WAG Of The Week Award! Well done!

Glad you've got it working.
--
Ted Roche
Ted Roche & Associates, LLC
http://www.tedroche.com

_______________________________________________
Post Messages to: ***@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/CACW6n4tg+Vnk657i7ZCKO4b5K+***@mail.gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Paul H. Tarver
2018-04-20 18:29:42 UTC
Permalink
I'd like to thank the Academy, my 7th grade guidance counselor who gave me
my first opportunity to debug a program and my peers here at ProFox who
voted for me to receive this award!

Thank you all so much! :)

PS: Does this mean I can raise my rates now?

Paul



-----Original Message-----
From: ProfoxTech [mailto:profoxtech-***@leafe.com] On Behalf Of Ted
Roche
Sent: Friday, April 20, 2018 10:50 AM
To: ***@leafe.com
Subject: Re: INSERT INTO...SELECT Issue - SOLVED!!!
Post by Paul H. Tarver
On a whim, I decided to add an alias to the table (ie: sheet) name and then
update the field names to the full bracketed column name notation
'[xs].[abc]' along with the table/sheet alias in the query and incredibly it
worked!
I'd like to nominate you for the WAG Of The Week Award! Well done!

Glad you've got it working.
--
Ted Roche
Ted Roche & Associates, LLC
http://www.tedroche.com

[excessive quoting removed by server]

_______________________________________________
Post Messages to: ***@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/1cce01d3d8d5$8cf95320$a6ebf960$@tpcqpc.com
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Ted Roche
2018-04-20 18:53:09 UTC
Permalink
Post by Paul H. Tarver
PS: Does this mean I can raise my rates now?
you can try!

And add it to your resume.
--
Ted Roche
Ted Roche & Associates, LLC
http://www.tedroche.com

_______________________________________________
Post Messages to: ***@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/CACW6n4sXfU5YK3+Ln+8HQ+***@mail.gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Vince Teachout
2018-04-20 18:44:59 UTC
Permalink
Post by Paul H. Tarver
I'd like to thank the Academy, my 7th grade guidance counselor who gave me
my first opportunity to debug a program and my peers here at ProFox who
voted for me to receive this award!
Thank you all so much! :)
Kudos, and well deserved praise, and new and exciting job titles to you!!!!
Post by Paul H. Tarver
PS: Does this mean I can raise my rates now?Uhm yeah, no. It doesn't actually work that way....
---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus


_______________________________________________
Post Messages to: ***@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/ce95431c-1801-260c-0cb7-***@taconic.net
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Paul H. Tarver
2018-04-23 15:00:27 UTC
Permalink
Post by Paul H. Tarver
PS: Does this mean I can raise my rates now?
Uhm yeah, no. It doesn't actually work that way....


Paul


-----Original Message-----
From: ProfoxTech [mailto:profoxtech-***@leafe.com] On Behalf Of Vince
Teachout
Sent: Friday, April 20, 2018 1:45 PM
To: ***@leafe.com
Subject: Re: INSERT INTO...SELECT Issue - SOLVED!!!
Post by Paul H. Tarver
I'd like to thank the Academy, my 7th grade guidance counselor who gave me
my first opportunity to debug a program and my peers here at ProFox who
voted for me to receive this award!
Thank you all so much! :)
Kudos, and well deserved praise, and new and exciting job titles to you!!!!
Post by Paul H. Tarver
PS: Does this mean I can raise my rates now?Uhm yeah, no. It doesn't
actually work that way....

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus


[excessive quoting removed by server]

_______________________________________________
Post Messages to: ***@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/032501d3db13$d0e5d0a0$72b171e0$@tpcqpc.com
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Gene Wirchenko
2018-04-20 19:02:05 UTC
Permalink
Post by Paul H. Tarver
I'd like to thank the Academy, my 7th grade guidance counselor who gave me
my first opportunity to debug a program and my peers here at ProFox who
voted for me to receive this award!
Thank you all so much! :)
PS: Does this mean I can raise my rates now?
You can always raise your rates. Collecting can be an issue though.

[snip]

Sincerely,

Gene Wirchenko


_______________________________________________
Post Messages to: ***@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/***@mtlp000085
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Paul H. Tarver
2018-04-21 18:11:20 UTC
Permalink
You've got a point...

Paul

-----Original Message-----
From: ProfoxTech [mailto:profoxtech-***@leafe.com] On Behalf Of Gene
Wirchenko
Sent: Friday, April 20, 2018 2:02 PM
To: ***@leafe.com
Subject: RE: INSERT INTO...SELECT Issue - SOLVED!!!
Post by Paul H. Tarver
I'd like to thank the Academy, my 7th grade guidance counselor who gave me
my first opportunity to debug a program and my peers here at ProFox who
voted for me to receive this award!
Thank you all so much! :)
PS: Does this mean I can raise my rates now?
You can always raise your rates. Collecting can be an issue though.

[snip]

Sincerely,

Gene Wirchenko


[excessive quoting removed by server]

_______________________________________________
Post Messages to: ***@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/03c601d3d99c$26f089a0$74d19ce0$@tpcqpc.com
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Dave Crozier
2018-04-23 08:59:47 UTC
Permalink
Paul,
Unfortunately, now you have been elevated to greatness... our rates to yourself will also increase proportionately .... and Cash in advance is required!!!

😉

Dave Crozier
Software Development Manager
Flexipol Packaging Ltd.



---------------------------------------------------------------
This communication and the information it contains is intended for the person or organisation to whom it is addressed. Its contents are confidential and may be protected in law. If you have received this e-mail in error you must not copy, distribute or take any action in reliance on it. Unauthorised use, copying or disclosure of any of it may be unlawful. If you have received this message in error, please notify us immediately by telephone or email.

Flexipol Packaging Ltd. has taken every reasonable precaution to minimise the risk of virus transmission through email and therefore any files sent via e-mail will have been checked for known viruses. However, you are advised to run your own virus check before opening any
attachments received as Flexipol Packaging Ltd will not in any event accept any liability whatsoever once an e-mail and/or any attachment is received.

It is the responsibility of the recipient to ensure that they have adequate virus protection.

Flexipol Packaging Ltd.
Unit 14 Bentwood Road
Carrs
Industrial Estate
Haslingden
Rossendale
Lancashire
BB4 5HH

Tel:01706-222792
Fax: 01706-224683
www.Flexipol.co.uk
---------------------------------------------------------------

Terms & Conditions:

Notwithstanding delivery and the passing of risk in the goods, the property in the goods shall not pass to the buyer until the seller
Flexipol Packaging Ltd. ("The Company") has received in cash or cleared funds payment in full of the price of the goods and all other goods agreed to be sold by the seller to the buyer for which payment is then due. Until such time as the property in the goods passes to the buyer, the buyer shall hold the goods as the seller's fiduciary agent and bailee and keep the goods separate from those of the buyer and third parties and properly stored protected and insured and identified as the seller's property but shall be entitled to resell or use the goods in the ordinary course of its business. Until such time as the property in the goods passes to the buyer the seller shall be entitled at any time

-----Original Message-----
From: ProFox <profox-***@leafe.com> On Behalf Of Paul H. Tarver
Sent: 21 April 2018 19:11
To: ***@leafe.com
Subject: RE: INSERT INTO...SELECT Issue - SOLVED!!!

You've got a point...

Paul

-----Original Message-----
From: ProfoxTech [mailto:profoxtech-***@leafe.com] On Behalf Of Gene Wirchenko
Sent: Friday, April 20, 2018 2:02 PM
To: ***@leafe.com
Subject: RE: INSERT INTO...SELECT Issue - SOLVED!!!
Post by Paul H. Tarver
I'd like to thank the Academy, my 7th grade guidance counselor who gave
me my first opportunity to debug a program and my peers here at ProFox
who voted for me to receive this award!
Thank you all so much! :)
PS: Does this mean I can raise my rates now?
You can always raise your rates. Collecting can be an issue though.

[snip]

Sincerely,

Gene Wirchenko


[excessive quoting removed by server]

_______________________________________________
Post Messages to: ***@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/03c601d3d99c$26f089a0$74d19ce0$@tpcqpc.com
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
_______________________________________________
Post Messages to: ***@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/***@EX2010-A-FPL.FPL.LOCAL
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid
Paul H. Tarver
2018-04-23 15:00:54 UTC
Permalink
I know myself and I'd still ask for three references on a check...:)

Paul



-----Original Message-----
From: ProfoxTech [mailto:profoxtech-***@leafe.com] On Behalf Of Dave Crozier
Sent: Monday, April 23, 2018 4:00 AM
To: ***@leafe.com
Subject: RE: INSERT INTO...SELECT Issue - SOLVED!!!

Paul,
Unfortunately, now you have been elevated to greatness... our rates to yourself will also increase proportionately .... and Cash in advance is required!!!

😉

Dave Crozier
Software Development Manager
Flexipol Packaging Ltd.



---------------------------------------------------------------
This communication and the information it contains is intended for the person or organisation to whom it is addressed. Its contents are confidential and may be protected in law. If you have received this e-mail in error you must not copy, distribute or take any action in reliance on it. Unauthorised use, copying or disclosure of any of it may be unlawful. If you have received this message in error, please notify us immediately by telephone or email.

Flexipol Packaging Ltd. has taken every reasonable precaution to minimise the risk of virus transmission through email and therefore any files sent via e-mail will have been checked for known viruses. However, you are advised to run your own virus check before opening any
attachments received as Flexipol Packaging Ltd will not in any event accept any liability whatsoever once an e-mail and/or any attachment is received.

It is the responsibility of the recipient to ensure that they have adequate virus protection.

Flexipol Packaging Ltd.
Unit 14 Bentwood Road
Carrs
Industrial Estate
Haslingden
Rossendale
Lancashire
BB4 5HH

Tel:01706-222792
Fax: 01706-224683
www.Flexipol.co.uk
---------------------------------------------------------------

Terms & Conditions:

Notwithstanding delivery and the passing of risk in the goods, the property in the goods shall not pass to the buyer until the seller
Flexipol Packaging Ltd. ("The Company") has received in cash or cleared funds payment in full of the price of the goods and all other goods agreed to be sold by the seller to the buyer for which payment is then due. Until such time as the property in the goods passes to the buyer, the buyer shall hold the goods as the seller's fiduciary agent and bailee and keep the goods separate from those of the buyer and third parties and properly stored protected and insured and identified as the seller's property but shall be entitled to resell or use the goods in the ordinary course of its business. Until such time as the property in the goods passes to the buyer the seller shall be entitled at any time

-----Original Message-----
From: ProFox <profox-***@leafe.com> On Behalf Of Paul H. Tarver
Sent: 21 April 2018 19:11
To: ***@leafe.com
Subject: RE: INSERT INTO...SELECT Issue - SOLVED!!!

You've got a point...

Paul

-----Original Message-----
From: ProfoxTech [mailto:profoxtech-***@leafe.com] On Behalf Of Gene Wirchenko
Sent: Friday, April 20, 2018 2:02 PM
To: ***@leafe.com
Subject: RE: INSERT INTO...SELECT Issue - SOLVED!!!
Post by Paul H. Tarver
I'd like to thank the Academy, my 7th grade guidance counselor who gave
me my first opportunity to debug a program and my peers here at ProFox
who voted for me to receive this award!
Thank you all so much! :)
PS: Does this mean I can raise my rates now?
You can always raise your rates. Collecting can be an issue though.

[snip]

Sincerely,

Gene Wirchenko


[excessive quoting removed by server]

_______________________________________________
Post Messages to: ***@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/037a01d3db13$e0c0a720$a241f560$@tpcqpc.com
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages
Gene Wirchenko
2018-04-20 16:39:28 UTC
Permalink
Post by Paul H. Tarver
Post by Paul H. Tarver
On a whim, I decided to add an alias to the table (ie: sheet) name and then
update the field names to the full bracketed column name notation
'[xs].[abc]' along with the table/sheet alias in the query and
incredibly it
Post by Paul H. Tarver
worked!
I'd like to nominate you for the WAG Of The Week Award! Well done!
Seconded. Well done.
Post by Paul H. Tarver
Glad you've got it working.
Indeed.

Sincerely,

Gene Wirchenko


_______________________________________________
Post Messages to: ***@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/***@mtlp000083
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.
Continue reading on narkive:
Loading...