Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB6 - Insert Into Oracle 9i

Status
Not open for further replies.

DaveyCrockett

Programmer
Jul 15, 2003
36
US
Hello wizards. I have a question that has been boggling my mind for DAYS now. I have tried just about every scenario that I could in getting the Date and Time inserted into a field in an Oracle table.

Error = ORA-00917: Missing Comma

Insert Statement:

INSERT INTO BOB_PRO_DV(COD_LINE,NUM_BOBI, DIV_BOBI, ANCH_BOBI, ESP_BOBI,TIP_ACE,MON_BOBI, TIP_RECO,COD_GPCE, COD_GPCI,FEC_ULZM,TUR_ULZM,GRU_ULZM,ACB_CE,ACB_CI,INS_,INS_FLGIMP) VALUES '3310','0321M2',' ','48.000','.05750', '120','0809706','F','0','0',TO_DATE('14-Aug-2003 00:00:01','dd-mmm-yyyy hh24:mi:ss'),'2','E','22','22',TO_DATE('21-Aug-2003 15:59:10', 'dd-mmm-yyyy hh24:mi:ss'),'Y')

Does anyone have any idea as to where I could be missing a comma?

Thank you in advance.
 
INSERT INTO BOB_PRO_DV(
COD_LINE, NUM_BOBI, DIV_BOBI, ANCH_BOBI, ESP_BOBI,
TIP_ACE, MON_BOBI, TIP_RECO, COD_GPCE, COD_GPCI,
FEC_ULZM, TUR_ULZM, GRU_ULZM, ACB_CE, ACB_CI,
INS_, INS_FLGIMP)
VALUES
( '3310','0321M2',' ','48.000','.05750', '120','0809706','F','0','0',TO_DATE('14-Aug-2003 00:00:01','dd-mmm-yyyy hh24:mi:ss'),'2','E','22','22',TO_DATE('21-Aug-2003 15:59:10', 'dd-mmm-yyyy hh24:mi:ss'),'Y')
 
I am sorry, my cut and paste must not have been correct. Here is a current copy of the SQL statement to insert the record, but still is giving me the ORA-00917 Missing Comma error.

INSERT INTO BOB_PRO_DV(COD_LINE,NUM_BOBI,DIV_BOBI,ANCH_BOBI,ESP_BOBI,TIP_ACE,MON_BOBI,TIP_RECO,COD_GPCE,COD_GPCI,to_date(FEC_ULZM,'dd-mmm-yyyy hh:mi:ss'),TUR_ULZM,GRU_ULZM,ACB_CE,ACB_CI,to_date(INS_,'dd-mmm-yyyy hh:mi:ss'),INS_FLGIMP) VALUES ('3310','0421M2',' ','48.000','.10150','120','0809809','F','0','0',TO_DATE('14-Aug-2003 00:00:01', 'dd-mmm-yyyy hh:mi:ss'),'2','E','22','22',TO_DATE('21-Aug-2003 16:15:44', 'dd-mmm-yyyy hh:mi:ss'),'Y')

Any Help is greatly appreciated.

Thanks
 
You appear to be using a function in your list of field names. Is this correct?

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'People who live in windowed environments shouldn't cast pointers.'
 
Yes there is a function in the list of field names. What I am doing here is passing a string (strSQL) to Oracle9i for the insert of the above statement. The function is an Oracle function, but I have been told that since I am passing it from my Visual Basic application to Oracle, that oracle will know what to do with it. Is this not the case? Should I be posting in Oracle and not VB? Please advise if this is the case.

Thanks again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top