Parameter in SELECT statement's fields list - error: Data type unknownHow to explicitly set type of constant value in SELECT clauseIf statement error in FirebirdFirebird procedure is not performed only in PDOphp ibase_fetch_assoc(): Dynamic SQL Error SQL error code = -303 in long SQLIBPP: Get exception in transaction.prepare(…) when using question mark for table nameFirebird 2.5 C++ client: error with DATE data typePDO firebird and ParametersFind tables, columns with specific valueRetrieve Firebird ODS version in .Netcannot call firebird stored procedure from phpFirebird 3.x error “Attempt to execute an unprepared dynamic SQL statement” in Delphi IBX exception handling?
How can I create folders in folders in terminal
Tips for remembering the order of parameters for ln?
Talk about Grandpa's weird talk: Who are these folks?
Is a global DNS record a security risk for phpMyAdmin?
Compare FEM mesh with the mesh created within Mathematica
Slow query when having 'contains' and '=' together in where clause
Is it safe to unplug a blinking USB drive after 'safely' ejecting it?
Bash attempts to write two shell prompts?
Is Zack Morris's 'time stop' ability in "Saved By the Bell" a supernatural ability?
Is it possible that the shadow of The Moon is a single dot during solar eclipse?
How could artificial intelligence harm us?
What is the maximum viable speed for a projectile within earth's atmosphere?
Can I separate garlic into cloves for storage?
How to give my students a straightedge instead of a ruler
Plausibility and performance of a composite longbow
Why would a fighter use the afterburner and air brakes at the same time?
Unpredictability of Stock Market
Did slaves have slaves?
Cemented carbide swords - worth it?
How to make classical firearms effective on space habitats despite the coriolis effect?
Floating Point XOR
Why are two-stroke engines nearly unheard of in aviation?
Why don't airports use arresting gears to recover energy from landing passenger planes?
Hobby function generators
Parameter in SELECT statement's fields list - error: Data type unknown
How to explicitly set type of constant value in SELECT clauseIf statement error in FirebirdFirebird procedure is not performed only in PDOphp ibase_fetch_assoc(): Dynamic SQL Error SQL error code = -303 in long SQLIBPP: Get exception in transaction.prepare(…) when using question mark for table nameFirebird 2.5 C++ client: error with DATE data typePDO firebird and ParametersFind tables, columns with specific valueRetrieve Firebird ODS version in .Netcannot call firebird stored procedure from phpFirebird 3.x error “Attempt to execute an unprepared dynamic SQL statement” in Delphi IBX exception handling?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I have a problem with Firebird (embedded) database. I would like to set a parameter values in the select statement. For example:
SELECT name, surname, :string AS myText
FROM myTable
where :string is a parameter.
The above code works in SQLite and the result is (when the paramenter is "abcdef"):
+------+---------+---------+
|name |surname |myText |
+------+---------+---------+
|John |Black |abcdef |
+------+---------+---------+
|Thomas|Young |abcdef |
+------+---------+---------+
|... |... |abcdef |
+------+---------+---------+
|nameX |surnameY |abcdef |
+------+---------+---------+
When I try to execute this query then I get the following message: "An error was found in the application program input parameters for the SQL statement.
Dynamic SQL Error.
SQL error code = -804.
Data type unknown.
firebird firebird-3.0
add a comment
|
I have a problem with Firebird (embedded) database. I would like to set a parameter values in the select statement. For example:
SELECT name, surname, :string AS myText
FROM myTable
where :string is a parameter.
The above code works in SQLite and the result is (when the paramenter is "abcdef"):
+------+---------+---------+
|name |surname |myText |
+------+---------+---------+
|John |Black |abcdef |
+------+---------+---------+
|Thomas|Young |abcdef |
+------+---------+---------+
|... |... |abcdef |
+------+---------+---------+
|nameX |surnameY |abcdef |
+------+---------+---------+
When I try to execute this query then I get the following message: "An error was found in the application program input parameters for the SQL statement.
Dynamic SQL Error.
SQL error code = -804.
Data type unknown.
firebird firebird-3.0
add a comment
|
I have a problem with Firebird (embedded) database. I would like to set a parameter values in the select statement. For example:
SELECT name, surname, :string AS myText
FROM myTable
where :string is a parameter.
The above code works in SQLite and the result is (when the paramenter is "abcdef"):
+------+---------+---------+
|name |surname |myText |
+------+---------+---------+
|John |Black |abcdef |
+------+---------+---------+
|Thomas|Young |abcdef |
+------+---------+---------+
|... |... |abcdef |
+------+---------+---------+
|nameX |surnameY |abcdef |
+------+---------+---------+
When I try to execute this query then I get the following message: "An error was found in the application program input parameters for the SQL statement.
Dynamic SQL Error.
SQL error code = -804.
Data type unknown.
firebird firebird-3.0
I have a problem with Firebird (embedded) database. I would like to set a parameter values in the select statement. For example:
SELECT name, surname, :string AS myText
FROM myTable
where :string is a parameter.
The above code works in SQLite and the result is (when the paramenter is "abcdef"):
+------+---------+---------+
|name |surname |myText |
+------+---------+---------+
|John |Black |abcdef |
+------+---------+---------+
|Thomas|Young |abcdef |
+------+---------+---------+
|... |... |abcdef |
+------+---------+---------+
|nameX |surnameY |abcdef |
+------+---------+---------+
When I try to execute this query then I get the following message: "An error was found in the application program input parameters for the SQL statement.
Dynamic SQL Error.
SQL error code = -804.
Data type unknown.
firebird firebird-3.0
firebird firebird-3.0
edited Jul 26 '18 at 9:10
Arioch 'The
13.4k20 silver badges51 bronze badges
13.4k20 silver badges51 bronze badges
asked Jul 25 '18 at 19:49
Mirosław RychterMirosław Rychter
182 bronze badges
182 bronze badges
add a comment
|
add a comment
|
1 Answer
1
active
oldest
votes
The problem is that Firebird needs to know the datatype of the parameter. IIRC in SQLite, everything is a string, but that is not the case in Firebird.
You will need to explicitly cast the parameter to inform Firebird about the expected type, for example:
SELECT name, surname, cast(? as varchar(100)) AS myText
FROM myTable
Where the ? is a positional parameter. Firebird doesn't have named parameters (except in procedures), but if your access library simulates named parameters, then probably the following will work as well:
SELECT name, surname, cast(:string as varchar(100)) AS myText
FROM myTable
The ability to cast parameters in the select-clause does not work in older Firebird version (I believe it was introduced in Firebird 2.5, but I'm not 100% sure).
add a comment
|
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f51526646%2fparameter-in-select-statements-fields-list-error-data-type-unknown%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
The problem is that Firebird needs to know the datatype of the parameter. IIRC in SQLite, everything is a string, but that is not the case in Firebird.
You will need to explicitly cast the parameter to inform Firebird about the expected type, for example:
SELECT name, surname, cast(? as varchar(100)) AS myText
FROM myTable
Where the ? is a positional parameter. Firebird doesn't have named parameters (except in procedures), but if your access library simulates named parameters, then probably the following will work as well:
SELECT name, surname, cast(:string as varchar(100)) AS myText
FROM myTable
The ability to cast parameters in the select-clause does not work in older Firebird version (I believe it was introduced in Firebird 2.5, but I'm not 100% sure).
add a comment
|
The problem is that Firebird needs to know the datatype of the parameter. IIRC in SQLite, everything is a string, but that is not the case in Firebird.
You will need to explicitly cast the parameter to inform Firebird about the expected type, for example:
SELECT name, surname, cast(? as varchar(100)) AS myText
FROM myTable
Where the ? is a positional parameter. Firebird doesn't have named parameters (except in procedures), but if your access library simulates named parameters, then probably the following will work as well:
SELECT name, surname, cast(:string as varchar(100)) AS myText
FROM myTable
The ability to cast parameters in the select-clause does not work in older Firebird version (I believe it was introduced in Firebird 2.5, but I'm not 100% sure).
add a comment
|
The problem is that Firebird needs to know the datatype of the parameter. IIRC in SQLite, everything is a string, but that is not the case in Firebird.
You will need to explicitly cast the parameter to inform Firebird about the expected type, for example:
SELECT name, surname, cast(? as varchar(100)) AS myText
FROM myTable
Where the ? is a positional parameter. Firebird doesn't have named parameters (except in procedures), but if your access library simulates named parameters, then probably the following will work as well:
SELECT name, surname, cast(:string as varchar(100)) AS myText
FROM myTable
The ability to cast parameters in the select-clause does not work in older Firebird version (I believe it was introduced in Firebird 2.5, but I'm not 100% sure).
The problem is that Firebird needs to know the datatype of the parameter. IIRC in SQLite, everything is a string, but that is not the case in Firebird.
You will need to explicitly cast the parameter to inform Firebird about the expected type, for example:
SELECT name, surname, cast(? as varchar(100)) AS myText
FROM myTable
Where the ? is a positional parameter. Firebird doesn't have named parameters (except in procedures), but if your access library simulates named parameters, then probably the following will work as well:
SELECT name, surname, cast(:string as varchar(100)) AS myText
FROM myTable
The ability to cast parameters in the select-clause does not work in older Firebird version (I believe it was introduced in Firebird 2.5, but I'm not 100% sure).
answered Jul 26 '18 at 8:52
Mark RotteveelMark Rotteveel
65.7k14 gold badges86 silver badges126 bronze badges
65.7k14 gold badges86 silver badges126 bronze badges
add a comment
|
add a comment
|
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f51526646%2fparameter-in-select-statements-fields-list-error-data-type-unknown%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown