Using Variables in Insert

2008-01-23 Thread Kc9cdt
Dan,
Thanks very much for responding to my problem post.
I was hoping I was just missing something in the syntax.

Looks like I made a very big mistake recommending MySql to my Client.
I have hundreds of SQL statements in the code I am converting for them. It is 
C code in IBM DB/2 running on OS/2 right now and I need to get them to 
Windows. It would take forever to do it the way the example shows. I 
recommended 
MySql because of previous experience with it being good (VB.net and IBM's 
DCConnect high level script language).

I never would have dreamed that a great DB engine like MySql would have so 
poor of implementation in C as this!

Question, I wander how the IBM DCConnect script applications I have written 
do not have this problem? They use ODBC connections. I know the IBM DCConnect 
is written in C (Under my code) and I know it works the 'same way' in DB/2, 
SqlServer AND MySql. I just use a colon in front of the variable name in the 
SQL 
statement to get it to substitute the real value in when executed (like the 
sample I provided on the post). What do you think about this?

I tried another approach... building the SQL statement string with sprintf, 
still a pain, but may be easier then the 'mysql_stmt_execute'.

Lee


**
Start the year off right.  Easy ways to stay in shape.
 
http://body.aol.com/fitness/winter-exercise?NCID=aolcmp0030002489


Newbie question, how do I respond to post?

2008-01-23 Thread Kc9cdt
Hello,
I feel stupid here... How do I respond to a specific post?
I posted last night, I got a response... now I want to post a response to the 
response.
Don't see a way to do that...
Thanks,
Lee


**
Start the year off right.  Easy ways to stay in shape.
 
http://body.aol.com/fitness/winter-exercise?NCID=aolcmp0030002489


Need to know how to do INSERTS, using variables for VALUE

2008-01-22 Thread Kc9cdt
Hello,
Doing C coding with MSql.
What am I missing here?

I am needing to do standard INSERT statements using variables for the VALUE 
fields
These fields are changed in the application befre I issue the INSERT. The 
current proram uses : before the variable to make it work.

Like this: INSERT INTO EMP_MASTER (EMP_NO, SUPERVISOR,BADGE_NO)
VALUES (:emp_no, :super, :badge_no);

The :emp_no etc.  is obviously what is not working...Why?

Works great in DB/2 .
I just can't find how to do it in MySql.

Thanks for any help here!
Lee


**
Start the year off right.  Easy ways to stay in shape.
 
http://body.aol.com/fitness/winter-exercise?NCID=aolcmp0030002489