Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 insert in to MSSQL server values dynamically From legacy

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2006-04-06 : 20:04:20
uday writes "Hi all ,

I am working on sap-abap with ms-sql server integartion .

I have a reqirement of inserting values into a sql system and trigger stored procedure .

From SAP we are connection to MS sql Server through a ODBC connection through syntax EXEC SQl: set connect END EXEC .

FOR Inserting values Into table . i have used following syntax's .

** when hard coding its inserting ( NO PR0BLEM with this )

A) when I am trying inserting through values hard coding it is getting inserting

EXEC sql.

Insert into RR_RATE_INQUIRY_SYSTEM_INPUT
(inquiry_user_id, inquiry_id, inquiry_count)
values ('4000596408000000' , '0314164944' , '001')
ENDEXEC

** when Passing values dynamically its not inserting ( PROBLEM )

B) when i am passing values dynamically it not getting inserted , as In my program passing values W_RATE_INPUT-INQUID = '4000596408000000'( on sap side user will From selection screen of a program )

i am Getting eror (207) , the set statement is unable to recognize the sap values ( i found the problem around SET Statemet

EXEC sql.
Declare
v1 varchar(30),
@v2 numeric(10),
@v3 int

SET @v1 = :W_RATE_INPUT-INQUID
SET @v2 = :W_RATE_INPUT-INQID
SET @v3 = :W_RATE_INPUT-INQCT

Insert into RR_RATE_INQUIRY_SYSTEM_INPUT
(inquiry_user_id, inquiry_id, inquiry_count)
values ( @v1 , @v2 , @v3 )


ENDEXEC.

PlsSSSSSSSSS can SQL Team look into this and let me know
its urgent
"

Srinika
Master Smack Fu Yak Hacker

1378 Posts

Posted - 2006-04-06 : 20:54:41
u have to have single quotation, sorrounding each variable value
Try
eg. SET @v1 = : ''' + W_RATE_INPUT-INQUID + '''


Srinika
Go to Top of Page
   

- Advertisement -