Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  iWay Software Product Forum on Focal Point    SQL Object - insert statement

Read-Only Read-Only Topic
Go
Search
Notify
Tools
SQL Object - insert statement
 Login/Join
 
Member
posted
Hi All,

I created a SQL Object via Adapter Designer. It's used to insert a record into a table (for instance table1).

I put the following sql statement into statement tab.
INSERT INTO table1 (A,B) VALUES(?ValueA,?ValueB)

I definded two 'User defined properties'
ValueA - the value is string (for instance a)
ValueB - the value is a string (for instance b)

When I ran the sql object. I got "ORA-00917: missing comma" error.

The runtime sql statement is "INSERT INTO table1(A,B) VALUES(a,b)". It's not correct. The "a" and "b" should be put into a pair of single quote.

I tried _CONCAT("\'",a,"\'") and _CONCAT("\'",b,"\'") they dont work.

I am wondering if someone encountered the same problem before.

Thanks,


iWay adapter manager
SAP Adapter
Web Services
SAP BASIS, Java Core
 
Posts: 22 | Registered: January 15, 2008Report This Post
Guru
posted Hide Post
Hi,

If your table contains more fields than A and B, you may need to add them with null values in the insert statement.

Majid.


WebFocus 7.6.5
AND WebLogic server as web server
sql2005 as database server
 
Posts: 273 | Location: Europe | Registered: May 31, 2007Report This Post
Member
posted Hide Post
Maybe I didn't make myself cleary.

The problem is in the statement tab of SQL Object. The sql statment is "insert into table1(a,b) values(?ValueA,?ValueB)"

During runtime, after it gets the values. The sql statement looks like:

INSERT INTO table1 values(A,B).

which is not a valid statement. it should be:

INSERT INTO table1(a,b) values('A','B')

I am wondering if anybody knows how to put the pair of single quotes in.

thanks,
Dennis


iWay adapter manager
SAP Adapter
Web Services
SAP BASIS, Java Core
 
Posts: 22 | Registered: January 15, 2008Report This Post
<nklamen>
posted
Instead of:



INSERT INTO table1 (A, B) VALUES( ?ValueA, ?ValueB )



Code the statement as:



INSERT INTO table1 (A, B) VALUES(‘?ValueA’, ‘?ValueB’)



…making the single quotes part of the statement prior to parameter substitution. This approach should always work because the type (char vs. numeric.) is a known, fixed attribute of each target column. Obviously the single quotes should be omitted around parameters which do not need to be quoted at execution (those inserted into numeric columns).
 
Report This Post
Member
posted Hide Post
Thanks. It works.


iWay adapter manager
SAP Adapter
Web Services
SAP BASIS, Java Core
 
Posts: 22 | Registered: January 15, 2008Report This Post
Platinum Member
posted Hide Post
I'm using this syntax:

INSERT INTO table1(a,b) values('A','B')

But, if I have a numeric variable that I want to store in a numeric field and I put quote marks around it I get the following error message:

FOC1414) EXECUTE IMMEDIATE ERROR.(FOC1400) SQLCODE IS 8114 (HEX: 00001FB2) XOPEN: 22018: Microsoft OLE DB Provider for SQL Server: [22018] Error converting data: type varchar to numeric.

If I leaave the quote marks out, I get this error messaage:

: Microsoft OLE DB Provider for SQL Server: [42000] The name "SRS_CRTFC_PC: " is not permitted in this context. Valid expressions are constants, con: stant expressions, and (in some contexts) variables. Column names are no: t permitted.

So, what do I do?


7.7.02
Windows
EXCEL, PDF, CSV, TEXT
 
Posts: 106 | Registered: June 25, 2009Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  iWay Software Product Forum on Focal Point    SQL Object - insert statement

Copyright © 1996-2020 Information Builders