Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 778021
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T19:42:00+00:00 2026-05-14T19:42:00+00:00

I am using the fluent interface to create a Zend DB Select object/query. As

  • 0

I am using the fluent interface to create a Zend DB Select object/query. As part of the query, I would like to select an arbitrary string, like “SELECT ‘foo’ AS ‘type’ FROM …”. foo is not a column, it’s just a string literal.

When I select an arbitrary number, the query works as expected. When I change it to a string, Zend tries to treat foo as a column, and throws an error:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'l.foo' in 'field list'

I have tried wrapping the string in Zend_Db_Expr in various ways such as:

$select->columns(array('type' => new Zend_Db_Expr('foo')));

That stops Zend from adding the correlation name, but it still treats it as a column:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'foo' in 'field list'

I feel like I must be missing something obvious here. How do I tell Zend to stop treating this as a column?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T19:42:01+00:00Added an answer on May 14, 2026 at 7:42 pm

    Did you perhaps try:

    $select->columns(array('type' => new Zend_Db_Expr("'foo'")));
    

    You need to actually have quotes around the 'foo' in the SQL as well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to map an enum as a string using Fluent Nhibernate?
I'm using NHibernate and Fluent NHibernate to create a mapping file for a domain
I am using fluent Nhibernate. This code Loads an instance of type T from
I am using Fluent NHibernate and having some issues getting a many to many
I've just started using NHibernate and fluent-NHibernate which I think is great. I've been
I'm using Fluent NHibernate and I have two tables: BusinessPlan [Id, Year, CustomerCode] PreviousYearData
I'm using Fluent NHibernate in an attempt to improve testability and maintainability on a
I'm using Fluent NHibernate to generate a database schema from .Net entity classes. I
I'm using NHibernate / Fluent NHibernate with Oracle and I'm running into an issue.
Can you help-me with that database : I´m using Fluent NHibernate, but XML helps

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.