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;








2















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.









share|improve this question
































    2















    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.









    share|improve this question




























      2












      2








      2








      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.









      share|improve this question
















      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






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      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

























          1 Answer
          1






          active

          oldest

          votes


















          1
















          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).






          share|improve this answer
























            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
            );



            );














            draft saved

            draft discarded
















            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









            1
















            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).






            share|improve this answer





























              1
















              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).






              share|improve this answer



























                1














                1










                1









                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).






                share|improve this answer













                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).







                share|improve this answer












                share|improve this answer



                share|improve this answer










                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





















                    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.




















                    draft saved

                    draft discarded















































                    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.




                    draft saved


                    draft discarded














                    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





















































                    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







                    Popular posts from this blog

                    How to preserve electronics (computers, tablets and phones) for hundreds of years Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) The network's official Twitter account is up and running again. What content…How might modern humans leave a message for 50,000 years?How would an aquatic race develop computers?How do we make computers care for human life?Keeping supplies for 1000 yearsWhat will cell phones become in 100 years?What body armor protects against a laser?Could a society attain 1800s technology if limited to using copper and bronze?Electricity power (magic) and electronicsScavenging metal resources in post-apocalypse after 100 yearsWhy would precursors create devices that can survive and still work after hundreds of years?

                    155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해

                    Convert JSON to MapSimplest way to convert a string representing JSON array into Java array List of key value pairsHow to take String JSON values into HashMapConvert a JSON String to a HashMapCreating BSON object from JSON stringJSONObject - How to get a value ?Better Map ConstructorReading JSON from Url javaUpdate columns if input values are not null otherwise ignore and keep the existing values of column in databaseHow to store object represented as Json string into Couchbase Lite?Go JSON into MapHow do I efficiently iterate over each entry in a Java Map?Sort a Map<Key, Value> by valuesHow to round a number to n decimal places in JavaCan comments be used in JSON?How do I read / convert an InputStream into a String in Java?How can I pretty-print JSON in a shell script?What is the correct JSON content type?How can I deserialize JSON to a simple Dictionary<string,string> in ASP.NET?Why does Google prepend while(1); to their JSON responses?Parse JSON in JavaScript?