Unable to convert SQL INSERT Script to DBExec

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
skiko
Newbie
Posts: 8
Joined: Sun Dec 16, 2007 8:40 pm
Location: USA
Contact:

Unable to convert SQL INSERT Script to DBExec

Post by skiko » Thu Apr 01, 2010 8:17 pm

I am unable to convert the following SQL script into a macro, I can modify fields fine but cannot seem to get the insert function to work.

INSERT INTO ItemRecord (location,itemCode) values (0,00026600303167)

DBConnect>Driver={SQL Server};Server=%SQL_SERVER%\ACS;Database=item;Uid=sa;Pwd=%PASS%;,dbH
DBExec>dbH,ItemRecord (location,itemCode) values (0,00026600303167),r
DBCLOSE>dbH

Anyone have any suggestions???
:?

TheEek
Junior Coder
Posts: 31
Joined: Mon Jun 22, 2009 2:53 pm

Post by TheEek » Thu Apr 01, 2010 9:07 pm

Did you try:

Code: Select all

Let>SQLCmd=INSERT INTO ItemRecord (location,itemCode) values (0,00026600303167) 
DBConnect>Driver={SQL Server};Server=%SQL_SERVER%\ACS;Database=item;Uid=sa;Pwd=%PASS%;,dbH
DBExec>dbH,SQLCmd,r
DBCLOSE>dbH
I'm just not so sure about the SQL syntax. Best thing to do would be to try this within a command line (or myphpadmin - if using mysql) connection.

skiko
Newbie
Posts: 8
Joined: Sun Dec 16, 2007 8:40 pm
Location: USA
Contact:

Post by skiko » Fri Apr 02, 2010 1:49 am

Worked Great!!!!
:lol:

I am assuming you can do the same thing with UPDATE.

THANKS!!!

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts