vvsrk76
asked on
Need Select SQL Return results includes the INPUT value..
I have select SQL with Where clause..
Select partnumber,description from IMCCRP.IMC_PARTSEARCH_MQT where partnumber = Replace('01 011',' ','')
Result Output:
PartNumber Description
01011 ignition
I need the SQL with input parameter in the result..
inputValue PartNumber Description
01 011 01011 ignition
input value should display in the result set as Column(inputValue).Please help me in this.
Thank You
Select partnumber,description from IMCCRP.IMC_PARTSEARCH_MQT where partnumber = Replace('01 011',' ','')
Result Output:
PartNumber Description
01011 ignition
I need the SQL with input parameter in the result..
inputValue PartNumber Description
01 011 01011 ignition
input value should display in the result set as Column(inputValue).Please help me in this.
Thank You
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank You.
I am using Preapred Statment in java. Can I put "?" in the statement..
Select ? as inputField, crossref, partnumber from imc.PARTSEARCH_MQT where crossref = Replace(?,' ','')
I am getting the below Error.
Error during Prepare
42610(-418)[IBM][CLI Driver][DB2/LINUXX8664] SQL0418N A statement contains a use of an untyped parameter marker, the DEFAULT keyword, or a null value that is not valid. SQLSTATE=42610
I am using Preapred Statment in java. Can I put "?" in the statement..
Select ? as inputField, crossref, partnumber from imc.PARTSEARCH_MQT where crossref = Replace(?,' ','')
I am getting the below Error.
Error during Prepare
42610(-418)[IBM][CLI Driver][DB2/LINUXX8664] SQL0418N A statement contains a use of an untyped parameter marker, the DEFAULT keyword, or a null value that is not valid. SQLSTATE=42610
ASKER
Thank You It is working with below statment..
Select cast(? as varchar(64)) as inputField, crossref, partnumber from imc.PARTSEARCH_MQT where crossref = Replace(?,' ','')
Thak You..
Select cast(? as varchar(64)) as inputField, crossref, partnumber from imc.PARTSEARCH_MQT where crossref = Replace(?,' ','')
Thak You..
ASKER
I've requested that this question be closed as follows:
Accepted answer: 0 points for vvsrk76's comment #a39049711
for the following reason:
Good
Accepted answer: 0 points for vvsrk76's comment #a39049711
for the following reason:
Good
ASKER
Thank you
Sorry, I were sleeping ! :)
You are right: my select statement can be used with java prepared statements, however, as you noticed, sometimes some casting is required.
I'm happy to know I have contributed to found your solution.
Regards.
You are right: my select statement can be used with java prepared statements, however, as you noticed, sometimes some casting is required.
I'm happy to know I have contributed to found your solution.
Regards.
From ...